git 5.0.0.beta.2 → 5.0.0.beta.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +27 -0
  3. data/.github/copilot-instructions.md +3 -8
  4. data/.github/hooks/bin-setup-on-worktree.json +11 -0
  5. data/.github/hooks/run-bin-setup-once.sh +14 -0
  6. data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
  7. data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
  8. data/.github/skills/command-implementation/REFERENCE.md +34 -33
  9. data/.github/skills/command-implementation/SKILL.md +5 -4
  10. data/.github/skills/command-test-conventions/SKILL.md +13 -9
  11. data/.github/skills/command-yard-documentation/SKILL.md +14 -6
  12. data/.github/skills/development-workflow/SKILL.md +20 -14
  13. data/.github/skills/facade-implementation/REFERENCE.md +19 -22
  14. data/.github/skills/facade-implementation/SKILL.md +0 -5
  15. data/.github/skills/facade-test-conventions/SKILL.md +4 -7
  16. data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
  17. data/.github/skills/make-skill-template/SKILL.md +53 -3
  18. data/.github/skills/pr-readiness-review/SKILL.md +22 -2
  19. data/.github/skills/project-context/SKILL.md +16 -23
  20. data/.github/skills/pull-request-review/SKILL.md +2 -2
  21. data/.github/skills/rebase/SKILL.md +148 -0
  22. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
  23. data/.github/skills/resolve-feedback/SKILL.md +288 -0
  24. data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
  25. data/.github/skills/reviewing-skills/SKILL.md +28 -3
  26. data/.github/skills/test-debugging/SKILL.md +20 -19
  27. data/.github/skills/yard-documentation/SKILL.md +671 -483
  28. data/.github/skills/yard-documentation/element-rules.md +162 -0
  29. data/.github/skills-deprecated/README.md +21 -0
  30. data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
  31. data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
  32. data/.github/workflows/continuous_integration.yml +3 -2
  33. data/.rubocop.yml +7 -39
  34. data/.yard-lint.yml +75 -0
  35. data/CONTRIBUTING.md +186 -174
  36. data/Gemfile +17 -0
  37. data/README.md +86 -23
  38. data/Rakefile +3 -21
  39. data/UPGRADING.md +219 -70
  40. data/docker/test/Dockerfile +32 -0
  41. data/docker/test/docker-compose.yml +0 -0
  42. data/git.gemspec +3 -4
  43. data/lib/git/author.rb +20 -1
  44. data/lib/git/branch.rb +26 -6
  45. data/lib/git/branch_delete_failure.rb +3 -0
  46. data/lib/git/branch_delete_result.rb +6 -3
  47. data/lib/git/branch_info.rb +6 -6
  48. data/lib/git/command_line/base.rb +6 -13
  49. data/lib/git/command_line/capturing.rb +67 -10
  50. data/lib/git/command_line/result.rb +0 -8
  51. data/lib/git/command_line/streaming.rb +45 -5
  52. data/lib/git/command_line.rb +4 -3
  53. data/lib/git/commands/add.rb +61 -53
  54. data/lib/git/commands/am/abort.rb +2 -2
  55. data/lib/git/commands/am/apply.rb +109 -98
  56. data/lib/git/commands/am/continue.rb +2 -2
  57. data/lib/git/commands/am/quit.rb +2 -2
  58. data/lib/git/commands/am/retry.rb +4 -2
  59. data/lib/git/commands/am/show_current_patch.rb +1 -1
  60. data/lib/git/commands/am/skip.rb +2 -2
  61. data/lib/git/commands/am.rb +2 -2
  62. data/lib/git/commands/apply.rb +7 -2
  63. data/lib/git/commands/archive/list_formats.rb +3 -3
  64. data/lib/git/commands/archive.rb +7 -2
  65. data/lib/git/commands/arguments.rb +1370 -359
  66. data/lib/git/commands/base.rb +111 -13
  67. data/lib/git/commands/branch/copy.rb +29 -21
  68. data/lib/git/commands/branch/create.rb +72 -68
  69. data/lib/git/commands/branch/delete.rb +25 -17
  70. data/lib/git/commands/branch/list.rb +76 -60
  71. data/lib/git/commands/branch/move.rb +29 -21
  72. data/lib/git/commands/branch/set_upstream.rb +8 -8
  73. data/lib/git/commands/branch/show_current.rb +3 -3
  74. data/lib/git/commands/branch/unset_upstream.rb +4 -8
  75. data/lib/git/commands/branch.rb +2 -2
  76. data/lib/git/commands/cat_file/batch.rb +36 -20
  77. data/lib/git/commands/cat_file/filtered.rb +12 -12
  78. data/lib/git/commands/cat_file/raw.rb +13 -13
  79. data/lib/git/commands/cat_file.rb +4 -4
  80. data/lib/git/commands/checkout/branch.rb +7 -5
  81. data/lib/git/commands/checkout/files.rb +5 -4
  82. data/lib/git/commands/checkout.rb +4 -4
  83. data/lib/git/commands/checkout_index.rb +5 -4
  84. data/lib/git/commands/clean.rb +6 -4
  85. data/lib/git/commands/clone.rb +5 -4
  86. data/lib/git/commands/commit.rb +5 -4
  87. data/lib/git/commands/commit_tree.rb +5 -4
  88. data/lib/git/commands/config_option_syntax/add.rb +7 -4
  89. data/lib/git/commands/config_option_syntax/get.rb +9 -5
  90. data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
  91. data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
  92. data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
  93. data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
  94. data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
  95. data/lib/git/commands/config_option_syntax/list.rb +8 -4
  96. data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
  97. data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
  98. data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
  99. data/lib/git/commands/config_option_syntax/set.rb +7 -2
  100. data/lib/git/commands/config_option_syntax/unset.rb +7 -4
  101. data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
  102. data/lib/git/commands/describe.rb +5 -4
  103. data/lib/git/commands/diff.rb +13 -12
  104. data/lib/git/commands/diff_files.rb +7 -6
  105. data/lib/git/commands/diff_index.rb +10 -7
  106. data/lib/git/commands/fetch.rb +6 -4
  107. data/lib/git/commands/fsck.rb +6 -4
  108. data/lib/git/commands/gc.rb +6 -4
  109. data/lib/git/commands/grep.rb +6 -5
  110. data/lib/git/commands/init.rb +6 -4
  111. data/lib/git/commands/log.rb +287 -285
  112. data/lib/git/commands/ls_files.rb +69 -65
  113. data/lib/git/commands/ls_remote.rb +62 -56
  114. data/lib/git/commands/ls_tree.rb +50 -46
  115. data/lib/git/commands/maintenance/register.rb +25 -23
  116. data/lib/git/commands/maintenance/run.rb +7 -2
  117. data/lib/git/commands/maintenance/start.rb +7 -2
  118. data/lib/git/commands/maintenance/stop.rb +7 -2
  119. data/lib/git/commands/maintenance/unregister.rb +7 -2
  120. data/lib/git/commands/merge/abort.rb +2 -2
  121. data/lib/git/commands/merge/continue.rb +2 -2
  122. data/lib/git/commands/merge/quit.rb +2 -2
  123. data/lib/git/commands/merge/start.rb +7 -2
  124. data/lib/git/commands/merge.rb +2 -2
  125. data/lib/git/commands/merge_base.rb +7 -2
  126. data/lib/git/commands/mv.rb +7 -2
  127. data/lib/git/commands/name_rev.rb +7 -2
  128. data/lib/git/commands/pull.rb +7 -2
  129. data/lib/git/commands/push.rb +7 -2
  130. data/lib/git/commands/read_tree.rb +7 -2
  131. data/lib/git/commands/remote/add.rb +7 -2
  132. data/lib/git/commands/remote/get_url.rb +4 -2
  133. data/lib/git/commands/remote/list.rb +4 -2
  134. data/lib/git/commands/remote/prune.rb +4 -2
  135. data/lib/git/commands/remote/remove.rb +4 -2
  136. data/lib/git/commands/remote/rename.rb +4 -2
  137. data/lib/git/commands/remote/set_branches.rb +9 -2
  138. data/lib/git/commands/remote/set_head.rb +12 -5
  139. data/lib/git/commands/remote/set_url.rb +9 -2
  140. data/lib/git/commands/remote/set_url_add.rb +11 -2
  141. data/lib/git/commands/remote/set_url_delete.rb +9 -2
  142. data/lib/git/commands/remote/show.rb +18 -12
  143. data/lib/git/commands/remote/update.rb +19 -12
  144. data/lib/git/commands/remote.rb +2 -2
  145. data/lib/git/commands/repack.rb +67 -63
  146. data/lib/git/commands/reset.rb +51 -44
  147. data/lib/git/commands/rev_parse.rb +135 -128
  148. data/lib/git/commands/revert/abort.rb +2 -2
  149. data/lib/git/commands/revert/continue.rb +7 -2
  150. data/lib/git/commands/revert/quit.rb +2 -2
  151. data/lib/git/commands/revert/skip.rb +2 -2
  152. data/lib/git/commands/revert/start.rb +7 -2
  153. data/lib/git/commands/revert.rb +2 -2
  154. data/lib/git/commands/rm.rb +35 -36
  155. data/lib/git/commands/show.rb +1 -1
  156. data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
  157. data/lib/git/commands/show_ref/exists.rb +15 -13
  158. data/lib/git/commands/show_ref/list.rb +39 -35
  159. data/lib/git/commands/show_ref/verify.rb +29 -27
  160. data/lib/git/commands/show_ref.rb +4 -4
  161. data/lib/git/commands/stash/apply.rb +31 -25
  162. data/lib/git/commands/stash/branch.rb +10 -8
  163. data/lib/git/commands/stash/clear.rb +7 -5
  164. data/lib/git/commands/stash/create.rb +10 -8
  165. data/lib/git/commands/stash/drop.rb +15 -9
  166. data/lib/git/commands/stash/list.rb +9 -5
  167. data/lib/git/commands/stash/pop.rb +21 -12
  168. data/lib/git/commands/stash/push.rb +20 -11
  169. data/lib/git/commands/stash/show.rb +21 -12
  170. data/lib/git/commands/stash/store.rb +19 -10
  171. data/lib/git/commands/stash.rb +2 -2
  172. data/lib/git/commands/status.rb +7 -2
  173. data/lib/git/commands/symbolic_ref/delete.rb +18 -14
  174. data/lib/git/commands/symbolic_ref/read.rb +24 -20
  175. data/lib/git/commands/symbolic_ref/update.rb +20 -17
  176. data/lib/git/commands/symbolic_ref.rb +4 -4
  177. data/lib/git/commands/tag/create.rb +45 -42
  178. data/lib/git/commands/tag/delete.rb +5 -3
  179. data/lib/git/commands/tag/list.rb +47 -44
  180. data/lib/git/commands/tag/verify.rb +12 -12
  181. data/lib/git/commands/tag.rb +2 -2
  182. data/lib/git/commands/update_ref/batch.rb +6 -1
  183. data/lib/git/commands/update_ref/delete.rb +19 -21
  184. data/lib/git/commands/update_ref/update.rb +22 -25
  185. data/lib/git/commands/update_ref.rb +4 -4
  186. data/lib/git/commands/version.rb +14 -11
  187. data/lib/git/commands/worktree/add.rb +50 -51
  188. data/lib/git/commands/worktree/list.rb +17 -17
  189. data/lib/git/commands/worktree/lock.rb +12 -12
  190. data/lib/git/commands/worktree/move.rb +16 -16
  191. data/lib/git/commands/worktree/prune.rb +2 -2
  192. data/lib/git/commands/worktree/remove.rb +2 -2
  193. data/lib/git/commands/worktree/repair.rb +2 -2
  194. data/lib/git/commands/worktree/unlock.rb +2 -2
  195. data/lib/git/commands/write_tree.rb +2 -2
  196. data/lib/git/commands.rb +4 -3
  197. data/lib/git/config.rb +47 -1
  198. data/lib/git/configuring.rb +89 -15
  199. data/lib/git/detached_head_info.rb +4 -1
  200. data/lib/git/diff.rb +2 -5
  201. data/lib/git/diff_file_numstat_info.rb +3 -1
  202. data/lib/git/diff_file_patch_info.rb +3 -1
  203. data/lib/git/diff_file_raw_info.rb +3 -1
  204. data/lib/git/diff_info.rb +8 -15
  205. data/lib/git/diff_path_status.rb +16 -3
  206. data/lib/git/diff_result.rb +3 -1
  207. data/lib/git/diff_stats.rb +15 -0
  208. data/lib/git/dirstat_info.rb +24 -8
  209. data/lib/git/encoding_utils.rb +32 -1
  210. data/lib/git/errors.rb +19 -9
  211. data/lib/git/escaped_path.rb +55 -3
  212. data/lib/git/execution_context/repository.rb +15 -0
  213. data/lib/git/execution_context.rb +76 -74
  214. data/lib/git/file_ref.rb +6 -3
  215. data/lib/git/fsck_object.rb +8 -0
  216. data/lib/git/fsck_result.rb +26 -15
  217. data/lib/git/log.rb +152 -5
  218. data/lib/git/object.rb +284 -8
  219. data/lib/git/parsers/branch.rb +18 -0
  220. data/lib/git/parsers/cat_file.rb +2 -2
  221. data/lib/git/parsers/diff.rb +213 -5
  222. data/lib/git/parsers/fsck.rb +11 -0
  223. data/lib/git/parsers/ls_remote.rb +1 -1
  224. data/lib/git/parsers/stash.rb +51 -0
  225. data/lib/git/parsers/tag.rb +38 -0
  226. data/lib/git/remote.rb +34 -2
  227. data/lib/git/repository/branching.rb +23 -21
  228. data/lib/git/repository/committing.rb +46 -6
  229. data/lib/git/repository/context_helpers.rb +45 -16
  230. data/lib/git/repository/diffing.rb +32 -23
  231. data/lib/git/repository/factories.rb +153 -28
  232. data/lib/git/repository/inspecting.rb +1 -1
  233. data/lib/git/repository/logging.rb +169 -30
  234. data/lib/git/repository/maintenance.rb +1 -1
  235. data/lib/git/repository/merging.rb +3 -3
  236. data/lib/git/repository/object_operations.rb +108 -14
  237. data/lib/git/repository/remote_operations.rb +150 -171
  238. data/lib/git/repository/shared_private.rb +7 -5
  239. data/lib/git/repository/staging.rb +36 -12
  240. data/lib/git/repository/stashing.rb +16 -16
  241. data/lib/git/repository/status_operations.rb +1 -1
  242. data/lib/git/repository/worktree_operations.rb +1 -1
  243. data/lib/git/repository.rb +287 -6
  244. data/lib/git/stash.rb +16 -21
  245. data/lib/git/stash_info.rb +4 -4
  246. data/lib/git/stashes.rb +20 -26
  247. data/lib/git/status.rb +25 -13
  248. data/lib/git/tag_delete_failure.rb +3 -0
  249. data/lib/git/tag_delete_result.rb +6 -3
  250. data/lib/git/tag_info.rb +1 -0
  251. data/lib/git/url.rb +12 -5
  252. data/lib/git/version.rb +6 -4
  253. data/lib/git/version_constraint.rb +4 -0
  254. data/lib/git.rb +400 -314
  255. data/redesign/3_architecture_implementation.md +81 -30
  256. data/redesign/Phase 4 - Step A.md +6 -0
  257. data/redesign/Phase 4 - Step B.md +921 -0
  258. data/redesign/Phase 4 - Step C.md +833 -0
  259. data/redesign/c1a-public-api-scope.tsv +256 -0
  260. data/redesign/phase-4-step-b-test-audit.tsv +485 -0
  261. data/tasks/yard.rake +24 -17
  262. metadata +24 -58
  263. data/commitlint.test +0 -4
  264. data/lib/git/args_builder.rb +0 -103
  265. data/lib/git/command_line_result.rb +0 -8
  266. data/lib/git/deprecation.rb +0 -9
  267. data/lib/git/repository/configuring.rb +0 -351
  268. data/tasks/test.rake +0 -25
  269. /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
  270. /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
@@ -10,14 +10,6 @@ module Git
10
10
  # Like {Apply}, but removes the stash from the stash list after
11
11
  # applying, unless there are conflicts.
12
12
  #
13
- # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
14
- #
15
- # @see Git::Commands::Stash Git::Commands::Stash for usage examples
16
- #
17
- # @see https://git-scm.com/docs/git-stash git-stash documentation
18
- #
19
- # @api private
20
- #
21
13
  # @example Pop the latest stash
22
14
  # Git::Commands::Stash::Pop.new(execution_context).call
23
15
  #
@@ -30,6 +22,14 @@ module Git
30
22
  # @example Pop quietly
31
23
  # Git::Commands::Stash::Pop.new(execution_context).call(quiet: true)
32
24
  #
25
+ # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
26
+ #
27
+ # @see Git::Commands::Stash Git::Commands::Stash for usage examples
28
+ #
29
+ # @see https://git-scm.com/docs/git-stash git-stash documentation
30
+ #
31
+ # @api private
32
+ #
33
33
  class Pop < Git::Commands::Base
34
34
  arguments do
35
35
  literal 'stash'
@@ -39,9 +39,12 @@ module Git
39
39
  operand :stash
40
40
  end
41
41
 
42
- # @!method call(*, **)
42
+ # @!method call(*, **options)
43
+ #
44
+ # @param options [Hash] command options
43
45
  #
44
- # Pop stashed changes
46
+ # @option options [Boolean, nil] :index (nil) command option key; see overload docs
47
+ # for the full option list
45
48
  #
46
49
  # @overload call(**options)
47
50
  #
@@ -55,6 +58,8 @@ module Git
55
58
  #
56
59
  # Alias: :q
57
60
  #
61
+ # @return [Git::CommandLine::Result] the result of calling `git stash pop`
62
+ #
58
63
  # @overload call(stash, **options)
59
64
  #
60
65
  # Pop a specific stash
@@ -69,9 +74,13 @@ module Git
69
74
  #
70
75
  # Alias: :q
71
76
  #
72
- # @return [Git::CommandLineResult] the result of calling `git stash pop`
77
+ # @return [Git::CommandLine::Result] the result of calling `git stash pop`
78
+ #
79
+ # @raise [ArgumentError] if unsupported options are provided
80
+ #
81
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
73
82
  #
74
- # @raise [Git::FailedError] if the stash does not exist
83
+ # @api public
75
84
  end
76
85
  end
77
86
  end
@@ -11,14 +11,6 @@ module Git
11
11
  # to HEAD (in the working tree and index). The command takes
12
12
  # various options to customize what gets stashed.
13
13
  #
14
- # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
15
- #
16
- # @see Git::Commands::Stash Git::Commands::Stash for usage examples
17
- #
18
- # @see https://git-scm.com/docs/git-stash git-stash documentation
19
- #
20
- # @api private
21
- #
22
14
  # @example Save all changes with a message
23
15
  # Git::Commands::Stash::Push.new(execution_context).call(message: 'WIP: feature work')
24
16
  #
@@ -31,6 +23,14 @@ module Git
31
23
  # @example Include untracked files
32
24
  # Git::Commands::Stash::Push.new(execution_context).call(include_untracked: true)
33
25
  #
26
+ # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
27
+ #
28
+ # @see Git::Commands::Stash Git::Commands::Stash for usage examples
29
+ #
30
+ # @see https://git-scm.com/docs/git-stash git-stash documentation
31
+ #
32
+ # @api private
33
+ #
34
34
  class Push < Git::Commands::Base
35
35
  arguments do
36
36
  literal 'stash'
@@ -48,7 +48,12 @@ module Git
48
48
  operand :pathspec, repeatable: true
49
49
  end
50
50
 
51
- # @!method call(*, **)
51
+ # @!method call(*, **options)
52
+ #
53
+ # @param options [Hash] command options
54
+ #
55
+ # @option options [Boolean, nil] :patch (nil) command option key; see overload docs
56
+ # for the full option list
52
57
  #
53
58
  # @overload call(*pathspec, **options)
54
59
  #
@@ -93,9 +98,13 @@ module Git
93
98
  #
94
99
  # @option options [Boolean, nil] :pathspec_file_nul (nil) pathspecs in the file are NUL-separated
95
100
  #
96
- # @return [Git::CommandLineResult] the result of calling `git stash push`
101
+ # @return [Git::CommandLine::Result] the result of calling `git stash push`
102
+ #
103
+ # @raise [ArgumentError] if unsupported options are provided
104
+ #
105
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
97
106
  #
98
- # @raise [Git::FailedError] if git exits with a non-zero exit status
107
+ # @api public
99
108
  #
100
109
  end
101
110
  end
@@ -11,14 +11,6 @@ module Git
11
11
  # stashed contents and the commit back when the stash entry was first
12
12
  # created.
13
13
  #
14
- # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
15
- #
16
- # @see Git::Commands::Stash Git::Commands::Stash for usage examples
17
- #
18
- # @see https://git-scm.com/docs/git-stash git-stash documentation
19
- #
20
- # @api private
21
- #
22
14
  # @example Show numstat for the latest stash
23
15
  # Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true)
24
16
  #
@@ -29,6 +21,14 @@ module Git
29
21
  # Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: true)
30
22
  # Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: 'lines,cumulative')
31
23
  #
24
+ # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
25
+ #
26
+ # @see Git::Commands::Stash Git::Commands::Stash for usage examples
27
+ #
28
+ # @see https://git-scm.com/docs/git-stash git-stash documentation
29
+ #
30
+ # @api private
31
+ #
32
32
  class Show < Git::Commands::Base
33
33
  arguments do
34
34
  literal 'stash'
@@ -50,9 +50,12 @@ module Git
50
50
  operand :stash
51
51
  end
52
52
 
53
- # @!method call(*, **)
53
+ # @!method call(*, **options)
54
+ #
55
+ # @param options [Hash] command options
54
56
  #
55
- # Show stash diff
57
+ # @option options [Boolean, nil] :patch (nil) command option key; see overload docs
58
+ # for the full option list
56
59
  #
57
60
  # @overload call(**options)
58
61
  #
@@ -96,6 +99,8 @@ module Git
96
99
  #
97
100
  # Pass `true` for default, or a string like `'lines,cumulative'` for options.
98
101
  #
102
+ # @return [Git::CommandLine::Result] the result of calling `git stash show`
103
+ #
99
104
  # @overload call(stash, **options)
100
105
  #
101
106
  # Show diff for a specific stash
@@ -140,9 +145,13 @@ module Git
140
145
  #
141
146
  # Pass `true` for default, or a string like `'lines,cumulative'` for options.
142
147
  #
143
- # @return [Git::CommandLineResult] the result of calling `git stash show`
148
+ # @return [Git::CommandLine::Result] the result of calling `git stash show`
149
+ #
150
+ # @raise [ArgumentError] if unsupported options are provided
151
+ #
152
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
144
153
  #
145
- # @raise [Git::FailedError] if git returns a non-zero exit status
154
+ # @api public
146
155
  end
147
156
  end
148
157
  end
@@ -13,6 +13,12 @@ module Git
13
13
  # This command is typically used after {Create} to actually record
14
14
  # the stash in the reflog.
15
15
  #
16
+ # @example Store a stash commit
17
+ # Git::Commands::Stash::Store.new(execution_context).call('abc123def456')
18
+ #
19
+ # @example Store with a custom message
20
+ # Git::Commands::Stash::Store.new(execution_context).call('abc123def456', message: 'WIP: feature')
21
+ #
16
22
  # @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
17
23
  #
18
24
  # @see Git::Commands::Stash Git::Commands::Stash for usage examples
@@ -21,12 +27,6 @@ module Git
21
27
  #
22
28
  # @api private
23
29
  #
24
- # @example Store a stash commit
25
- # Git::Commands::Stash::Store.new(execution_context).call('abc123def456')
26
- #
27
- # @example Store with a custom message
28
- # Git::Commands::Stash::Store.new(execution_context).call('abc123def456', message: 'WIP: feature')
29
- #
30
30
  class Store < Git::Commands::Base
31
31
  arguments do
32
32
  literal 'stash'
@@ -36,12 +36,17 @@ module Git
36
36
  operand :commit, required: true
37
37
  end
38
38
 
39
- # @!method call(*, **)
39
+ # @!method call(*, **options)
40
40
  #
41
- # Store a commit in the stash reflog
41
+ # @param options [Hash] command options
42
+ #
43
+ # @option options [String] :message (nil) command option key; see overload docs for
44
+ # the full option list
42
45
  #
43
46
  # @overload call(commit, **options)
44
47
  #
48
+ # Store a commit in the stash reflog
49
+ #
45
50
  # @param commit [String] the commit SHA to store in the stash (required)
46
51
  #
47
52
  # @param options [Hash] command options
@@ -54,9 +59,13 @@ module Git
54
59
  #
55
60
  # Alias: :q
56
61
  #
57
- # @return [Git::CommandLineResult] the result of calling `git stash store`
62
+ # @return [Git::CommandLine::Result] the result of calling `git stash store`
63
+ #
64
+ # @raise [ArgumentError] if unsupported options are provided
65
+ #
66
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
58
67
  #
59
- # @raise [Git::FailedError] if the commit is not a valid stash commit
68
+ # @api public
60
69
  end
61
70
  end
62
71
  end
@@ -28,10 +28,10 @@ module Git
28
28
  # - {Stash::Create} — create a stash object without storing it
29
29
  # - {Stash::Store} — store a stash object created with `create`
30
30
  #
31
- # @api private
32
- #
33
31
  # @see https://git-scm.com/docs/git-stash git-stash documentation
34
32
  #
33
+ # @api private
34
+ #
35
35
  module Stash
36
36
  end
37
37
  end
@@ -77,7 +77,12 @@ module Git
77
77
  operand :pathspec, repeatable: true
78
78
  end
79
79
 
80
- # @!method call(*, **)
80
+ # @!method call(*, **options)
81
+ #
82
+ # @param options [Hash] command options
83
+ #
84
+ # @option options [Boolean, nil] :short (nil) command option key; see overload docs
85
+ # for the full option list
81
86
  #
82
87
  # @overload call(*pathspecs, **options)
83
88
  #
@@ -157,7 +162,7 @@ module Git
157
162
  # When `true`, enables rename detection without a threshold. When a string
158
163
  # (e.g. `'50'`), adds `--find-renames=<n>`.
159
164
  #
160
- # @return [Git::CommandLineResult] the result of calling `git status`
165
+ # @return [Git::CommandLine::Result] the result of calling `git status`
161
166
  #
162
167
  # @raise [ArgumentError] if unsupported options are provided
163
168
  #
@@ -38,30 +38,34 @@ module Git
38
38
  operand :name, required: true
39
39
  end
40
40
 
41
- # @!method call(*, **)
41
+ # Executes the git symbolic-ref --delete command
42
42
  #
43
- # @overload call(name, **options)
43
+ # @overload call(name, **options)
44
44
  #
45
- # Execute the `git symbolic-ref --delete` command
45
+ # @param name [String] the symbolic ref name to delete
46
+ # (e.g. `HEAD`)
46
47
  #
47
- # @param name [String] the symbolic ref name to delete
48
- # (e.g. `HEAD`)
48
+ # @param options [Hash] command options
49
49
  #
50
- # @param options [Hash] command options
50
+ # @option options [Boolean, nil] :quiet (nil) suppress error message
51
+ # when the name is not a symbolic ref
51
52
  #
52
- # @option options [Boolean, nil] :quiet (nil) suppress error message
53
- # when the name is not a symbolic ref
53
+ # Alias: :q
54
54
  #
55
- # Alias: :q
55
+ # @return [Git::CommandLine::Result] the result of calling
56
+ # `git symbolic-ref --delete`
56
57
  #
57
- # @return [Git::CommandLineResult] the result of calling
58
- # `git symbolic-ref --delete`
58
+ # @raise [ArgumentError] if unsupported options are provided
59
59
  #
60
- # @raise [ArgumentError] if unsupported options are provided
60
+ # @raise [ArgumentError] if the name operand is missing
61
61
  #
62
- # @raise [ArgumentError] if the name operand is missing
62
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
63
63
  #
64
- # @raise [Git::FailedError] if git exits with a non-zero exit status
64
+ # @api public
65
+ #
66
+ def call(*, **)
67
+ super
68
+ end
65
69
  end
66
70
  end
67
71
  end
@@ -56,39 +56,43 @@ module Git
56
56
  # (e.g. detached HEAD) — this is not an error
57
57
  allow_exit_status 0..1
58
58
 
59
- # @!method call(*, **)
59
+ # Executes the git symbolic-ref command to read a symbolic ref
60
60
  #
61
- # @overload call(name, **options)
61
+ # @overload call(name, **options)
62
62
  #
63
- # Execute the `git symbolic-ref` command to read a symbolic ref
63
+ # @param name [String] the symbolic ref name to read
64
+ # (e.g. `HEAD`)
64
65
  #
65
- # @param name [String] the symbolic ref name to read
66
- # (e.g. `HEAD`)
66
+ # @param options [Hash] command options
67
67
  #
68
- # @param options [Hash] command options
68
+ # @option options [Boolean, nil] :quiet (nil) suppress error message
69
+ # when the name is not a symbolic ref
69
70
  #
70
- # @option options [Boolean, nil] :quiet (nil) suppress error message
71
- # when the name is not a symbolic ref
71
+ # Alias: :q
72
72
  #
73
- # Alias: :q
73
+ # @option options [Boolean, nil] :short (nil) shorten the ref output
74
+ # (e.g. `refs/heads/main` → `main`)
74
75
  #
75
- # @option options [Boolean, nil] :short (nil) shorten the ref output
76
- # (e.g. `refs/heads/main` `main`)
76
+ # @option options [Boolean, nil] :recurse (nil) follow chain of symbolic refs
77
+ # until result no longer points at a symbolic ref (`--recurse`)
77
78
  #
78
- # @option options [Boolean, nil] :recurse (nil) follow chain of symbolic refs
79
- # until result no longer points at a symbolic ref (`--recurse`)
79
+ # @option options [Boolean, nil] :no_recurse (nil) stop after a single level
80
+ # of dereferencing (`--no-recurse`)
80
81
  #
81
- # @option options [Boolean, nil] :no_recurse (nil) stop after a single level
82
- # of dereferencing (`--no-recurse`)
82
+ # @return [Git::CommandLine::Result] the result of calling
83
+ # `git symbolic-ref`
83
84
  #
84
- # @return [Git::CommandLineResult] the result of calling
85
- # `git symbolic-ref`
85
+ # @raise [ArgumentError] if unsupported options are provided
86
86
  #
87
- # @raise [ArgumentError] if unsupported options are provided
87
+ # @raise [ArgumentError] if the name operand is missing
88
88
  #
89
- # @raise [ArgumentError] if the name operand is missing
89
+ # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
90
90
  #
91
- # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
91
+ # @api public
92
+ #
93
+ def call(*, **)
94
+ super
95
+ end
92
96
  end
93
97
  end
94
98
  end
@@ -42,34 +42,37 @@ module Git
42
42
  operand :ref, required: true
43
43
  end
44
44
 
45
- # @!method call(*, **)
45
+ # Executes the git symbolic-ref command to create or update a symbolic ref
46
46
  #
47
- # @overload call(name, ref, **options)
47
+ # @overload call(name, ref, **options)
48
48
  #
49
- # Execute the `git symbolic-ref` command to create or update a
50
- # symbolic ref
49
+ # @param name [String] the symbolic ref name to update
50
+ # (e.g. `HEAD`)
51
51
  #
52
- # @param name [String] the symbolic ref name to update
53
- # (e.g. `HEAD`)
52
+ # @param ref [String] the target ref to point to
53
+ # (e.g. `refs/heads/main`)
54
54
  #
55
- # @param ref [String] the target ref to point to
56
- # (e.g. `refs/heads/main`)
55
+ # @param options [Hash] command options
57
56
  #
58
- # @param options [Hash] command options
57
+ # @option options [String] :m (nil) a reflog message for
58
+ # the update
59
59
  #
60
- # @option options [String] :m (nil) a reflog message for
61
- # the update
60
+ # @return [Git::CommandLine::Result] the result of calling
61
+ # `git symbolic-ref`
62
62
  #
63
- # @return [Git::CommandLineResult] the result of calling
64
- # `git symbolic-ref`
63
+ # @raise [ArgumentError] if unsupported options are provided
65
64
  #
66
- # @raise [ArgumentError] if unsupported options are provided
65
+ # @raise [ArgumentError] if the name operand is missing
67
66
  #
68
- # @raise [ArgumentError] if the name operand is missing
67
+ # @raise [ArgumentError] if the ref operand is missing
69
68
  #
70
- # @raise [ArgumentError] if the ref operand is missing
69
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
71
70
  #
72
- # @raise [Git::FailedError] if git exits with a non-zero exit status
71
+ # @api public
72
+ #
73
+ def call(*, **)
74
+ super
75
+ end
73
76
  end
74
77
  end
75
78
  end
@@ -16,10 +16,6 @@ module Git
16
16
  # at a given branch
17
17
  # - {SymbolicRef::Delete} — delete a symbolic ref
18
18
  #
19
- # @api private
20
- #
21
- # @see https://git-scm.com/docs/git-symbolic-ref git-symbolic-ref documentation
22
- #
23
19
  # @example Read the current HEAD
24
20
  # cmd = Git::Commands::SymbolicRef::Read.new(lib)
25
21
  # cmd.call('HEAD')
@@ -32,6 +28,10 @@ module Git
32
28
  # cmd = Git::Commands::SymbolicRef::Delete.new(lib)
33
29
  # cmd.call('HEAD')
34
30
  #
31
+ # @see https://git-scm.com/docs/git-symbolic-ref git-symbolic-ref documentation
32
+ #
33
+ # @api private
34
+ #
35
35
  module SymbolicRef
36
36
  end
37
37
  end
@@ -54,85 +54,88 @@ module Git
54
54
  operand :commit
55
55
  end
56
56
 
57
- # @!method call(*, **)
57
+ # Executes the git tag command to create a new tag
58
58
  #
59
- # Execute the git tag command to create a new tag
59
+ # @overload call(tagname, commit = nil, **options)
60
60
  #
61
- # @overload call(tagname, commit = nil, **options)
61
+ # @param tagname [String] the name of the tag to create
62
62
  #
63
- # @param tagname [String] the name of the tag to create
63
+ # @param commit [String, nil] the commit, branch, or object to tag
64
64
  #
65
- # @param commit [String, nil] the commit, branch, or object to tag
65
+ # Defaults to HEAD when omitted.
66
66
  #
67
- # Defaults to HEAD when omitted.
67
+ # @param options [Hash] command options
68
68
  #
69
- # @param options [Hash] command options
69
+ # @option options [Boolean, nil] :annotate (nil) make an unsigned, annotated tag object
70
70
  #
71
- # @option options [Boolean, nil] :annotate (nil) make an unsigned, annotated tag object
71
+ # Requires a message via `:message` or `:file`.
72
72
  #
73
- # Requires a message via `:message` or `:file`.
73
+ # Alias: :a
74
74
  #
75
- # Alias: :a
75
+ # @option options [Boolean, nil] :sign (nil) make a GPG-signed tag using the default signing
76
+ # key (`--sign`)
76
77
  #
77
- # @option options [Boolean, nil] :sign (nil) make a GPG-signed tag using the default signing
78
- # key (`--sign`)
78
+ # Requires a message via `:message` or `:file`.
79
79
  #
80
- # Requires a message via `:message` or `:file`.
80
+ # Alias: :s
81
81
  #
82
- # Alias: :s
82
+ # @option options [Boolean, nil] :no_sign (nil) override `tag.gpgSign` config to disable
83
+ # signing (`--no-sign`)
83
84
  #
84
- # @option options [Boolean, nil] :no_sign (nil) override `tag.gpgSign` config to disable
85
- # signing (`--no-sign`)
85
+ # @option options [String] :local_user (nil) make a cryptographically signed tag using the given key
86
86
  #
87
- # @option options [String] :local_user (nil) make a cryptographically signed tag using the given key
87
+ # Requires a message via `:message` or `:file`.
88
88
  #
89
- # Requires a message via `:message` or `:file`.
89
+ # Alias: :u
90
90
  #
91
- # Alias: :u
91
+ # @option options [Boolean, nil] :force (nil) replace an existing tag with the given name instead of failing
92
92
  #
93
- # @option options [Boolean, nil] :force (nil) replace an existing tag with the given name instead of failing
93
+ # Alias: :f
94
94
  #
95
- # Alias: :f
95
+ # @option options [String] :message (nil) use the given message as the tag message
96
96
  #
97
- # @option options [String] :message (nil) use the given message as the tag message
97
+ # Implies `--annotate` if none of `--annotate`, `--sign`, or `--local-user` is given.
98
98
  #
99
- # Implies `--annotate` if none of `--annotate`, `--sign`, or `--local-user` is given.
99
+ # Alias: :m
100
100
  #
101
- # Alias: :m
101
+ # @option options [String] :file (nil) take the tag message from the given file
102
102
  #
103
- # @option options [String] :file (nil) take the tag message from the given file
103
+ # Use `-` to read from standard input. Implies `--annotate` if none of
104
+ # `--annotate`, `--sign`, or `--local-user` is given.
104
105
  #
105
- # Use `-` to read from standard input. Implies `--annotate` if none of
106
- # `--annotate`, `--sign`, or `--local-user` is given.
106
+ # Alias: :F
107
107
  #
108
- # Alias: :F
108
+ # @option options [Boolean, nil] :edit (nil) open an editor to further edit the tag message (`--edit`)
109
109
  #
110
- # @option options [Boolean, nil] :edit (nil) open an editor to further edit the tag message (`--edit`)
110
+ # Alias: :e
111
111
  #
112
- # Alias: :e
112
+ # @option options [Boolean, nil] :no_edit (nil) suppress the editor (`--no-edit`)
113
113
  #
114
- # @option options [Boolean, nil] :no_edit (nil) suppress the editor (`--no-edit`)
114
+ # @option options [Hash, Array<Array>] :trailer (nil) add trailers to the tag message
115
115
  #
116
- # @option options [Hash, Array<Array>] :trailer (nil) add trailers to the tag message
116
+ # Can be a Hash `{ 'Key' => 'value' }` or Array of pairs `[['Key', 'value']]`.
117
+ # Multiple trailers can be specified.
117
118
  #
118
- # Can be a Hash `{ 'Key' => 'value' }` or Array of pairs `[['Key', 'value']]`.
119
- # Multiple trailers can be specified.
119
+ # @option options [String] :cleanup (nil) set how the tag message is cleaned up
120
120
  #
121
- # @option options [String] :cleanup (nil) set how the tag message is cleaned up
121
+ # Must be one of: `verbatim` (no changes), `whitespace` (remove leading/trailing
122
+ # whitespace lines), or `strip` (remove whitespace and commentary). Default is `strip`.
122
123
  #
123
- # Must be one of: `verbatim` (no changes), `whitespace` (remove leading/trailing
124
- # whitespace lines), or `strip` (remove whitespace and commentary). Default is `strip`.
124
+ # @option options [Boolean, nil] :create_reflog (nil) create a reflog for the tag
125
125
  #
126
- # @option options [Boolean, nil] :create_reflog (nil) create a reflog for the tag
126
+ # Enables date-based sha1 expressions such as `tag@{yesterday}`.
127
127
  #
128
- # Enables date-based sha1 expressions such as `tag@{yesterday}`.
128
+ # @return [Git::CommandLine::Result] the result of calling `git tag`
129
129
  #
130
- # @return [Git::CommandLineResult] the result of calling `git tag`
130
+ # @raise [ArgumentError] if unsupported options are provided
131
131
  #
132
- # @raise [ArgumentError] if unsupported options are provided
132
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
133
133
  #
134
- # @raise [Git::FailedError] if git exits with a non-zero exit status
134
+ # @api public
135
135
  #
136
+ def call(*, **)
137
+ super
138
+ end
136
139
  end
137
140
  end
138
141
  end
@@ -35,7 +35,7 @@ module Git
35
35
  # git tag --delete exits with status 1 when a tag does not exist, which is acceptable
36
36
  allow_exit_status 0..1
37
37
 
38
- # @!method call(*, **)
38
+ # @!method call(*)
39
39
  #
40
40
  # @overload call(*tagname)
41
41
  #
@@ -43,12 +43,14 @@ module Git
43
43
  #
44
44
  # @param tagname [Array<String>] one or more tag names to delete
45
45
  #
46
- # @return [Git::CommandLineResult] the result of calling `git tag --delete`
46
+ # @return [Git::CommandLine::Result] the result of calling `git tag --delete`
47
47
  #
48
- # @raise [ArgumentError] if no tag names are provided or unsupported options are provided
48
+ # @raise [ArgumentError] if no tag names are provided
49
49
  #
50
50
  # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
51
51
  #
52
+ # @api public
53
+ #
52
54
  end
53
55
  end
54
56
  end