git 5.0.0.beta.3 → 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 (268) 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 +47 -12
  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 +123 -63
  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 +21 -7
  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 +398 -314
  255. data/redesign/3_architecture_implementation.md +59 -29
  256. data/redesign/Phase 4 - Step B.md +921 -0
  257. data/redesign/Phase 4 - Step C.md +833 -0
  258. data/redesign/c1a-public-api-scope.tsv +256 -0
  259. data/redesign/phase-4-step-b-test-audit.tsv +485 -0
  260. data/tasks/yard.rake +24 -17
  261. metadata +24 -57
  262. data/commitlint.test +0 -4
  263. data/lib/git/args_builder.rb +0 -103
  264. data/lib/git/command_line_result.rb +0 -8
  265. data/lib/git/deprecation.rb +0 -9
  266. data/tasks/test.rake +0 -25
  267. /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
  268. /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
@@ -62,80 +62,83 @@ module Git
62
62
  operand :pattern, repeatable: true
63
63
  end
64
64
 
65
- # @!method call(*, **)
65
+ # @!method call(*pattern, **options)
66
66
  #
67
- # Execute the git tag --list command
67
+ # Execute the `git tag --list` command
68
68
  #
69
- # @overload call(*pattern, **options)
69
+ # @param pattern [Array<String>] shell wildcard patterns to filter tags
70
70
  #
71
- # @param pattern [Array<String>] Shell wildcard patterns to filter tags
71
+ # Multiple patterns can be provided; a tag is shown if it matches any pattern.
72
72
  #
73
- # Multiple patterns can be provided; a tag is shown if it matches any pattern.
73
+ # @param options [Hash] command options
74
74
  #
75
- # @param options [Hash] command options
75
+ # @option options [Boolean, Integer, nil] :n (nil) number of annotation lines to print
76
76
  #
77
- # @option options [Boolean, Integer, nil] :n (nil) Number of annotation lines to print
77
+ # Pass `true` to print the first annotation line, or an integer to print that
78
+ # many lines. If the tag is not annotated, the commit message is displayed instead.
78
79
  #
79
- # Pass `true` to print the first annotation line, or an integer to print that
80
- # many lines. If the tag is not annotated, the commit message is displayed instead.
80
+ # @option options [String, Array<String>] :sort (nil) sort tags by the specified
81
+ # key(s)
81
82
  #
82
- # @option options [String, Array<String>] :sort (nil) Sort tags by the specified
83
- # key(s)
83
+ # Prefix `-` to sort in descending order. Common keys: 'refname',
84
+ # '-refname', 'creatordate', '-creatordate', and 'version:refname'.
84
85
  #
85
- # Prefix `-` to sort in descending order. Common keys: 'refname',
86
- # '-refname', 'creatordate', '-creatordate', 'version:refname' (for semantic
87
- # version sorting).
86
+ # @option options [Boolean, String, nil] :color (nil) colorize output per colors
87
+ # specified in `--format`
88
88
  #
89
- # @option options [Boolean, String, nil] :color (nil) Colorize output per colors
90
- # specified in `--format`
89
+ # Pass `true` for `--color`, or one of `'always'`, `'never'`, `'auto'`.
91
90
  #
92
- # Pass `true` for `--color`, or one of `'always'`, `'never'`, `'auto'`.
91
+ # @option options [Boolean, nil] :ignore_case (nil) sort and filter tags without
92
+ # case sensitivity
93
93
  #
94
- # @option options [Boolean, nil] :ignore_case (nil) Sorting and filtering tags are
95
- # case insensitive
94
+ # Alias: :i
96
95
  #
97
- # Alias: :i
96
+ # @option options [Boolean, nil] :omit_empty (nil) skip trailing newlines for
97
+ # refs whose formatted output is empty
98
98
  #
99
- # @option options [Boolean, nil] :omit_empty (nil) Do not print a newline after
100
- # formatted refs where the format expands to the empty string
99
+ # @option options [Boolean, String, nil] :column (nil) display tag listing in
100
+ # columns
101
101
  #
102
- # @option options [Boolean, String, nil] :column (nil) Display tag listing in columns
102
+ # Pass `true` for `--column` or a comma-separated options string for
103
+ # `--column=<options>`.
103
104
  #
104
- # Pass `true` for `--column` or a comma-separated options string
105
- # (see `column.tag` configuration for syntax) for `--column=<options>`.
105
+ # @option options [Boolean, nil] :no_column (nil) disable column output
106
+ # (`--no-column`)
106
107
  #
107
- # @option options [Boolean, nil] :no_column (nil) disable column output (`--no-column`)
108
+ # @option options [Boolean, String, nil] :contains (nil) list only tags that
109
+ # contain the specified commit
108
110
  #
109
- # @option options [Boolean, String, nil] :contains (nil) List only tags that contain the
110
- # specified commit
111
+ # Pass `true` to use HEAD, or a commit reference string.
111
112
  #
112
- # Pass `true` to use HEAD, or a commit reference string.
113
+ # @option options [Boolean, String, nil] :no_contains (nil) list only tags that do
114
+ # not contain the specified commit
113
115
  #
114
- # @option options [Boolean, String, nil] :no_contains (nil) List only tags that don't contain
115
- # the specified commit
116
+ # Pass `true` to use HEAD, or a commit reference string.
116
117
  #
117
- # Pass `true` to use HEAD, or a commit reference string.
118
+ # @option options [Boolean, String, nil] :merged (nil) list only tags whose commits
119
+ # are reachable from the specified commit
118
120
  #
119
- # @option options [Boolean, String, nil] :merged (nil) List only tags whose commits are
120
- # reachable from the specified commit
121
+ # Pass `true` to use HEAD, or a commit reference string.
121
122
  #
122
- # Pass `true` to use HEAD, or a commit reference string.
123
+ # @option options [Boolean, String, nil] :no_merged (nil) list only tags whose
124
+ # commits are not reachable from the specified commit
123
125
  #
124
- # @option options [Boolean, String, nil] :no_merged (nil) List only tags whose commits are
125
- # not reachable from the specified commit
126
+ # Pass `true` to use HEAD, or a commit reference string.
126
127
  #
127
- # Pass `true` to use HEAD, or a commit reference string.
128
+ # @option options [Boolean, String, nil] :points_at (nil) list only tags that point
129
+ # at the specified object
128
130
  #
129
- # @option options [Boolean, String, nil] :points_at (nil) List only tags that point at the
130
- # specified object
131
+ # Pass `true` to use HEAD, or an object reference string.
131
132
  #
132
- # Pass `true` to use HEAD, or an object reference string.
133
+ # @option options [String] :format (nil) output format string for each tag
133
134
  #
134
- # @option options [String] :format (nil) Output format string for each tag
135
+ # @return [Git::CommandLine::Result] the result of calling `git tag --list`
135
136
  #
136
- # @return [Git::CommandLineResult] the result of calling `git tag --list`
137
+ # @raise [ArgumentError] if unsupported options are provided
137
138
  #
138
- # @raise [Git::FailedError] if git returns a non-zero exit code
139
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
140
+ #
141
+ # @api public
139
142
  #
140
143
  end
141
144
  end
@@ -42,28 +42,28 @@ module Git
42
42
  operand :tagname, repeatable: true, required: true
43
43
  end
44
44
 
45
- # @!method call(*, **)
45
+ # @!method call(*tagname, **options)
46
46
  #
47
- # Execute the git tag --verify command to verify tag signatures
47
+ # Execute the `git tag --verify` command to verify tag signatures
48
48
  #
49
- # @overload call(*tagname, **options)
49
+ # @param tagname [Array<String>] one or more tag names to verify
50
50
  #
51
- # @param tagname [Array<String>] one or more tag names to verify
51
+ # @param options [Hash] command options
52
52
  #
53
- # @param options [Hash] command options
53
+ # @option options [String] :format (nil) a format string interpolating
54
+ # `%(fieldname)` from the tag ref being shown and the object it points at
54
55
  #
55
- # @option options [String] :format (nil) a format string interpolating
56
- # `%(fieldname)` from the tag ref being shown and the object it points at
56
+ # The format is the same as that of git-for-each-ref(1)
57
57
  #
58
- # The format is the same as that of git-for-each-ref(1).
58
+ # @return [Git::CommandLine::Result] the result of calling `git tag --verify`
59
59
  #
60
- # @return [Git::CommandLineResult] the result of calling `git tag --verify`
60
+ # @raise [ArgumentError] if unsupported options are provided
61
61
  #
62
- # @raise [ArgumentError] if unsupported options are provided
62
+ # @raise [ArgumentError] if no tagname operands are provided
63
63
  #
64
- # @raise [ArgumentError] if no tagname operands are provided
64
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
65
65
  #
66
- # @raise [Git::FailedError] if git exits with a non-zero exit status
66
+ # @api public
67
67
  #
68
68
  end
69
69
  end
@@ -16,10 +16,10 @@ module Git
16
16
  # - {Tag::List} — list tags with optional filtering (`--list`)
17
17
  # - {Tag::Verify} — verify GPG signatures of tags (`--verify`)
18
18
  #
19
- # @api private
20
- #
21
19
  # @see https://git-scm.com/docs/git-tag git-tag documentation
22
20
  #
21
+ # @api private
22
+ #
23
23
  module Tag
24
24
  end
25
25
  end
@@ -108,7 +108,7 @@ module Git
108
108
  #
109
109
  # @option options [Numeric] :timeout (nil) abort the command after this many seconds
110
110
  #
111
- # @return [Git::CommandLineResult] the result of calling
111
+ # @return [Git::CommandLine::Result] the result of calling
112
112
  # `git update-ref --stdin`
113
113
  #
114
114
  # @raise [ArgumentError] if unsupported options are provided
@@ -130,6 +130,11 @@ module Git
130
130
 
131
131
  private
132
132
 
133
+ # Build stdin payload for `git update-ref --stdin`
134
+ #
135
+ # @param bound [Git::Commands::Arguments::Bound] bound command arguments
136
+ #
137
+ # @return [String] instruction stream with delimiter applied per `z:`
133
138
  def build_stdin(bound)
134
139
  delimiter = bound.z? ? "\0" : "\n"
135
140
  Array(bound.instructions).map { |i| "#{i}#{delimiter}" }.join
@@ -52,40 +52,38 @@ module Git
52
52
  operand :oldvalue
53
53
  end
54
54
 
55
- # @!method call(*, **)
55
+ # @!method call(ref, oldvalue = nil, **options)
56
56
  #
57
- # @overload call(ref, oldvalue = nil, **options)
57
+ # Execute the `git update-ref -d` command
58
58
  #
59
- # Execute the `git update-ref -d` command
59
+ # @param ref [String] the ref to delete
60
+ # (e.g. `refs/heads/old-branch`)
60
61
  #
61
- # @param ref [String] the ref to delete
62
- # (e.g. `refs/heads/old-branch`)
62
+ # @param oldvalue [String, nil] (nil) expected current value of the ref
63
63
  #
64
- # @param oldvalue [String, nil] (nil) expected current value of
65
- # the ref
64
+ # When provided, the delete is rejected unless the ref currently points to this
65
+ # object.
66
66
  #
67
- # When provided, the delete is rejected unless the ref
68
- # currently points to this object.
67
+ # @param options [Hash] command options
69
68
  #
70
- # @param options [Hash] command options
69
+ # @option options [String] :m (nil) a reflog message for the deletion
71
70
  #
72
- # @option options [String] :m (nil) a reflog message for
73
- # the deletion
71
+ # @option options [Boolean, nil] :no_deref (nil) overwrite the ref itself rather
72
+ # than following symbolic refs
74
73
  #
75
- # @option options [Boolean, nil] :no_deref (nil) overwrite the ref
76
- # itself rather than following symbolic refs
74
+ # @option options [Numeric] :timeout (nil) abort the command after this many
75
+ # seconds
77
76
  #
78
- # @option options [Numeric] :timeout (nil) abort the command after this many
79
- # seconds
77
+ # @return [Git::CommandLine::Result] the result of calling `git update-ref -d`
80
78
  #
81
- # @return [Git::CommandLineResult] the result of calling
82
- # `git update-ref -d`
79
+ # @raise [ArgumentError] if unsupported options are provided
83
80
  #
84
- # @raise [ArgumentError] if unsupported options are provided
81
+ # @raise [ArgumentError] if the ref operand is missing
85
82
  #
86
- # @raise [ArgumentError] if the ref operand is missing
83
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
84
+ #
85
+ # @api public
87
86
  #
88
- # @raise [Git::FailedError] if git exits with a non-zero exit status
89
87
  end
90
88
  end
91
89
  end
@@ -60,46 +60,43 @@ module Git
60
60
  operand :oldvalue
61
61
  end
62
62
 
63
- # @!method call(*, **)
63
+ # @!method call(ref, newvalue, oldvalue = nil, **options)
64
64
  #
65
- # @overload call(ref, newvalue, oldvalue = nil, **options)
65
+ # Execute the `git update-ref` command
66
66
  #
67
- # Execute the `git update-ref` command
67
+ # @param ref [String] the ref to update (e.g. `refs/heads/main`)
68
68
  #
69
- # @param ref [String] the ref to update (e.g. `refs/heads/main`)
69
+ # @param newvalue [String] the new object name to store
70
70
  #
71
- # @param newvalue [String] the new object name to store
71
+ # @param oldvalue [String, nil] (nil) expected current value of the ref
72
72
  #
73
- # @param oldvalue [String, nil] (nil) expected current value of
74
- # the ref
73
+ # When provided, the update is rejected unless the ref currently points to this
74
+ # object. Use 40 `"0"` characters or an empty string to assert the ref does
75
+ # not yet exist.
75
76
  #
76
- # When provided, the update is rejected unless the ref
77
- # currently points to this object. Use 40 `"0"` characters
78
- # or an empty string to assert the ref does not yet exist.
77
+ # @param options [Hash] command options
79
78
  #
80
- # @param options [Hash] command options
79
+ # @option options [String] :m (nil) a reflog message for the update
81
80
  #
82
- # @option options [String] :m (nil) a reflog message for
83
- # the update
81
+ # @option options [Boolean, nil] :no_deref (nil) overwrite the ref itself rather
82
+ # than following symbolic refs
84
83
  #
85
- # @option options [Boolean, nil] :no_deref (nil) overwrite the ref
86
- # itself rather than following symbolic refs
84
+ # @option options [Boolean, nil] :create_reflog (nil) create a reflog even if one
85
+ # would not ordinarily be created
87
86
  #
88
- # @option options [Boolean, nil] :create_reflog (nil) create a reflog
89
- # even if one would not ordinarily be created
87
+ # @option options [Numeric] :timeout (nil) abort the command after this many
88
+ # seconds
90
89
  #
91
- # @option options [Numeric] :timeout (nil) abort the command after this many
92
- # seconds
90
+ # @return [Git::CommandLine::Result] the result of calling `git update-ref`
93
91
  #
94
- # @return [Git::CommandLineResult] the result of calling
95
- # `git update-ref`
92
+ # @raise [ArgumentError] if unsupported options are provided
96
93
  #
97
- # @raise [ArgumentError] if unsupported options are provided
94
+ # @raise [ArgumentError] if the ref or newvalue operand is missing
98
95
  #
99
- # @raise [ArgumentError] if the ref or newvalue operand is
100
- # missing
96
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
97
+ #
98
+ # @api public
101
99
  #
102
- # @raise [Git::FailedError] if git exits with a non-zero exit status
103
100
  end
104
101
  end
105
102
  end
@@ -17,10 +17,6 @@ module Git
17
17
  # - {UpdateRef::Batch} — read update/create/delete/verify instructions
18
18
  # from stdin (`--stdin`); all modifications are applied atomically
19
19
  #
20
- # @api private
21
- #
22
- # @see https://git-scm.com/docs/git-update-ref git-update-ref documentation
23
- #
24
20
  # @example Update a branch ref to a new commit SHA
25
21
  # cmd = Git::Commands::UpdateRef::Update.new(lib)
26
22
  # cmd.call('refs/heads/main', 'abc1234')
@@ -36,6 +32,10 @@ module Git
36
32
  # 'delete refs/heads/old'
37
33
  # )
38
34
  #
35
+ # @see https://git-scm.com/docs/git-update-ref git-update-ref documentation
36
+ #
37
+ # @api private
38
+ #
39
39
  module UpdateRef
40
40
  end
41
41
  end
@@ -33,25 +33,28 @@ module Git
33
33
  flag_option :build_options
34
34
  end
35
35
 
36
- # @!method call(*, **)
36
+ # @overload call(**options)
37
37
  #
38
- # @overload call(**options)
38
+ # Execute the `git version` command
39
39
  #
40
- # Execute the `git version` command.
40
+ # @param options [Hash] command options
41
41
  #
42
- # @param options [Hash] command options
42
+ # @option options [Numeric, nil] :timeout (nil) the number of seconds to wait
43
+ # for the command to complete; if nil, uses the global timeout from
44
+ # {Git::Config}; if 0, no timeout is enforced
43
45
  #
44
- # @option options [Boolean, nil] :build_options (nil) include build options in the output
46
+ # @option options [Boolean, nil] :build_options (nil) include build options in
47
+ # the output
45
48
  #
46
- # @option options [Numeric, nil] :timeout (nil) the number of seconds to wait
47
- # for the command to complete; if nil, uses the global timeout from
48
- # {Git::Config}; if 0, no timeout is enforced
49
+ # @return [Git::CommandLine::Result] the result of calling `git version`
49
50
  #
50
- # @return [Git::CommandLineResult] the result of calling `git version`
51
+ # @raise [ArgumentError] if unsupported options are provided
51
52
  #
52
- # @raise [ArgumentError] if unsupported options are provided
53
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
53
54
  #
54
- # @raise [Git::FailedError] if git exits with a non-zero exit status
55
+ # @api public
56
+ #
57
+ def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
55
58
  end
56
59
  end
57
60
  end
@@ -49,91 +49,90 @@ module Git
49
49
  operand :commit_ish
50
50
  end
51
51
 
52
- # @!method call(*, **)
52
+ # @overload call(path, commit_ish = nil, **options)
53
53
  #
54
- # @overload call(path, commit_ish = nil, **options)
54
+ # Create a new linked worktree and check out `commit_ish` into it
55
55
  #
56
- # Create a new linked worktree and check out `commit_ish` into it
56
+ # @param path [String] filesystem path for the new worktree
57
57
  #
58
- # @param path [String] filesystem path for the new worktree
58
+ # @param commit_ish [String, nil] (nil) branch, tag, or commit to check out
59
59
  #
60
- # @param commit_ish [String, nil] (nil) branch, tag, or commit to check out
60
+ # When omitted, git creates a new branch named after the final path
61
+ # component and checks it out
61
62
  #
62
- # When omitted, git creates a new branch named after the final path
63
- # component and checks it out.
63
+ # @param options [Hash] command options
64
64
  #
65
- # @param options [Hash] command options
65
+ # @option options [Boolean, Integer, nil] :force (nil) override safety guards
66
66
  #
67
- # @option options [Boolean, Integer, nil] :force (nil) override safety guards
67
+ # Pass `true` or `1` to emit `--force` once. Pass `2` to emit
68
+ # `--force --force`, which also allows adding worktrees for locked branches.
68
69
  #
69
- # Pass `true` or `1` to emit `--force` once. Pass `2` to emit
70
- # `--force --force`, which also allows adding worktrees for locked branches.
70
+ # Alias: :f
71
71
  #
72
- # Alias: :f
72
+ # @option options [String] :b (nil) create a new branch with this name and
73
+ # check it out
73
74
  #
74
- # @option options [String] :b (nil) create a new branch with this name
75
- # and check it out
75
+ # @option options [String] :B (nil) create or reset a branch with this name and
76
+ # check it out
76
77
  #
77
- # @option options [String] :B (nil) create or reset a branch with this
78
- # name and check it out
78
+ # @option options [Boolean, nil] :detach (nil) check out in detached-HEAD state
79
79
  #
80
- # @option options [Boolean, nil] :detach (nil) check out in
81
- # detached-HEAD state
80
+ # Alias: :d
82
81
  #
83
- # Alias: :d
82
+ # @option options [Boolean, nil] :checkout (nil) control whether the working
83
+ # tree is checked out after creation (`--checkout`)
84
84
  #
85
- # @option options [Boolean, nil] :checkout (nil) control whether the working
86
- # tree is checked out after creation (`--checkout`)
85
+ # @option options [Boolean, nil] :no_checkout (nil) suppress the initial
86
+ # checkout after worktree creation (`--no-checkout`)
87
87
  #
88
- # @option options [Boolean, nil] :no_checkout (nil) suppress the initial
89
- # checkout after worktree creation (`--no-checkout`)
88
+ # @option options [Boolean, nil] :guess_remote (nil) base new branch on a
89
+ # matching remote-tracking branch (`--guess-remote`)
90
90
  #
91
- # @option options [Boolean, nil] :guess_remote (nil) base new branch on a
92
- # matching remote-tracking branch (`--guess-remote`)
91
+ # Applied when no `commit_ish` argument is provided.
93
92
  #
94
- # Applied when no `commit_ish` argument is provided.
93
+ # @option options [Boolean, nil] :no_guess_remote (nil) disable guess-remote
94
+ # behavior (`--no-guess-remote`)
95
95
  #
96
- # @option options [Boolean, nil] :no_guess_remote (nil) disable guess-remote
97
- # behavior (`--no-guess-remote`)
96
+ # @option options [Boolean, nil] :relative_paths (nil) link worktrees using
97
+ # relative paths (`--relative-paths`)
98
98
  #
99
- # @option options [Boolean, nil] :relative_paths (nil) link worktrees using
100
- # relative paths (`--relative-paths`)
99
+ # Overrides the `worktree.useRelativePaths` config option.
101
100
  #
102
- # Overrides the `worktree.useRelativePaths` config option.
101
+ # @option options [Boolean, nil] :no_relative_paths (nil) use absolute paths for
102
+ # worktree links (`--no-relative-paths`)
103
103
  #
104
- # @option options [Boolean, nil] :no_relative_paths (nil) use absolute paths
105
- # for worktree links (`--no-relative-paths`)
104
+ # Overrides the `worktree.useRelativePaths` config option.
106
105
  #
107
- # Overrides the `worktree.useRelativePaths` config option.
106
+ # @option options [Boolean, nil] :track (nil) mark the upstream branch for
107
+ # tracking (`--track`)
108
108
  #
109
- # @option options [Boolean, nil] :track (nil) mark the upstream branch for
110
- # tracking (`--track`)
109
+ # @option options [Boolean, nil] :no_track (nil) do not mark the upstream
110
+ # branch for tracking (`--no-track`)
111
111
  #
112
- # @option options [Boolean, nil] :no_track (nil) do not mark the upstream
113
- # branch for tracking (`--no-track`)
112
+ # @option options [Boolean, nil] :lock (nil) lock the worktree immediately after
113
+ # creation
114
114
  #
115
- # @option options [Boolean, nil] :lock (nil) lock the worktree immediately
116
- # after creation
115
+ # @option options [Boolean, nil] :orphan (nil) create an empty worktree
116
+ # associated with a new unborn branch
117
117
  #
118
- # @option options [Boolean, nil] :orphan (nil) create an empty worktree
119
- # associated with a new unborn branch
118
+ # @option options [Boolean, nil] :quiet (nil) suppress informational messages
120
119
  #
121
- # @option options [Boolean, nil] :quiet (nil) suppress informational messages
120
+ # Alias: :q
122
121
  #
123
- # Alias: :q
122
+ # @option options [String] :reason (nil) explanation for why the worktree is
123
+ # locked
124
124
  #
125
- # @option options [String] :reason (nil) explanation for why the worktree
126
- # is locked
125
+ # Only meaningful when used with `:lock`.
127
126
  #
128
- # Only meaningful when used with `:lock`.
127
+ # @return [Git::CommandLine::Result] the result of calling `git worktree add`
129
128
  #
130
- # @return [Git::CommandLineResult] the result of calling `git worktree add`
129
+ # @raise [ArgumentError] if unsupported options are provided
131
130
  #
132
- # @raise [ArgumentError] if unsupported options are provided
131
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
133
132
  #
134
- # @raise [Git::FailedError] if git exits with a non-zero exit status
133
+ # @api public
135
134
  #
136
- # @api public
135
+ def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
137
136
  end
138
137
  end
139
138
  end
@@ -29,35 +29,35 @@ module Git
29
29
  value_option :expire
30
30
  end
31
31
 
32
- # @!method call(*, **)
32
+ # @overload call(**options)
33
33
  #
34
- # @overload call(**options)
34
+ # List all worktrees attached to the repository
35
35
  #
36
- # List all worktrees attached to the repository
36
+ # @param options [Hash] command options
37
37
  #
38
- # @param options [Hash] command options
38
+ # @option options [Boolean, nil] :porcelain (nil) produce machine-readable
39
+ # output
39
40
  #
40
- # @option options [Boolean, nil] :porcelain (nil) produce machine-readable
41
- # output
41
+ # @option options [Boolean, nil] :z (nil) terminate output lines with NUL
42
+ # bytes (use with `:porcelain`)
42
43
  #
43
- # @option options [Boolean, nil] :z (nil) terminate output lines with NUL
44
- # bytes (use with `:porcelain`)
44
+ # @option options [Boolean, nil] :verbose (nil) output additional information
45
+ # about worktrees
45
46
  #
46
- # @option options [Boolean, nil] :verbose (nil) output additional information
47
- # about worktrees
47
+ # Alias: :v
48
48
  #
49
- # Alias: :v
49
+ # @option options [String] :expire (nil) annotate missing worktrees as
50
+ # prunable if older than this time expression
50
51
  #
51
- # @option options [String] :expire (nil) annotate missing worktrees as
52
- # prunable if older than this time expression
52
+ # @return [Git::CommandLine::Result] the result of calling `git worktree list`
53
53
  #
54
- # @return [Git::CommandLineResult] the result of calling `git worktree list`
54
+ # @raise [ArgumentError] if unsupported options are provided
55
55
  #
56
- # @raise [ArgumentError] if unsupported options are provided
56
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
57
57
  #
58
- # @raise [Git::FailedError] if git exits with a non-zero exit status
58
+ # @api public
59
59
  #
60
- # @api public
60
+ def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
61
61
  end
62
62
  end
63
63
  end