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
@@ -101,197 +101,204 @@ module Git
101
101
  operand :args, repeatable: true
102
102
  end
103
103
 
104
- # @!method call(*, **)
104
+ # @overload call(*args, **options)
105
105
  #
106
- # @overload call(*args, **options)
106
+ # Execute the `git rev-parse` command
107
107
  #
108
- # Execute the `git rev-parse` command
108
+ # @param args [Array<String>] zero or more revision specifiers,
109
+ # object names, or file paths to parse. Include `'--'` to
110
+ # separate verified arguments from those echoed back without
111
+ # verification, e.g. `call('HEAD', '--', 'file.txt')`
109
112
  #
110
- # @param args [Array<String>] zero or more revision specifiers,
111
- # object names, or file paths to parse. Include `'--'` to
112
- # separate verified arguments from those echoed back without
113
- # verification, e.g. `call('HEAD', '--', 'file.txt')`.
113
+ # @param options [Hash] command options
114
114
  #
115
- # @param options [Hash] command options
115
+ # @option options [Boolean, nil] :revs_only (nil) do not output flags
116
+ # and parameters not meant for `git rev-list`
116
117
  #
117
- # @option options [Boolean, nil] :revs_only (nil) do not output flags
118
- # and parameters not meant for `git rev-list`
118
+ # @option options [Boolean, nil] :no_revs (nil) do not output flags and
119
+ # parameters meant for `git rev-list`
119
120
  #
120
- # @option options [Boolean, nil] :no_revs (nil) do not output flags and
121
- # parameters meant for `git rev-list`
121
+ # @option options [Boolean, nil] :flags (nil) do not output non-flag
122
+ # parameters (`--flags`)
122
123
  #
123
- # @option options [Boolean, nil] :flags (nil) do not output non-flag
124
- # parameters (`--flags`)
124
+ # @option options [Boolean, nil] :no_flags (nil) do not output flag
125
+ # parameters (`--no-flags`)
125
126
  #
126
- # @option options [Boolean, nil] :no_flags (nil) do not output flag
127
- # parameters (`--no-flags`)
127
+ # @option options [String] :default (nil) use this value if no
128
+ # parameter is given by the user
128
129
  #
129
- # @option options [String] :default (nil) use this value if no
130
- # parameter is given by the user
130
+ # @option options [String] :prefix (nil) behave as if invoked from
131
+ # this subdirectory of the working tree
131
132
  #
132
- # @option options [String] :prefix (nil) behave as if invoked from
133
- # this subdirectory of the working tree
133
+ # @option options [Boolean, nil] :verify (nil) verify that exactly one
134
+ # parameter is provided and that it can be resolved to an object
134
135
  #
135
- # @option options [Boolean, nil] :verify (nil) verify that exactly one
136
- # parameter is provided and that it can be resolved to an object
136
+ # @option options [Boolean, nil] :quiet (nil) do not output an error
137
+ # message if the first argument is not a valid object name;
138
+ # exit with non-zero status silently
137
139
  #
138
- # @option options [Boolean, nil] :quiet (nil) do not output an error
139
- # message if the first argument is not a valid object name;
140
- # exit with non-zero status silently
140
+ # Only meaningful with `:verify`.
141
141
  #
142
- # Only meaningful with `:verify`.
142
+ # Alias: :q
143
143
  #
144
- # Alias: :q
144
+ # @option options [Boolean, nil] :sq (nil) output a single line
145
+ # properly quoted for shell consumption
145
146
  #
146
- # @option options [Boolean, nil] :sq (nil) output a single line
147
- # properly quoted for shell consumption
147
+ # @option options [Boolean, Integer, String, nil] :short (nil) shorten
148
+ # the object name to a unique prefix
148
149
  #
149
- # @option options [Boolean, String, nil] :short (nil) shorten the
150
- # object name to a unique prefix
150
+ # When `true`, emits `--short` (git default length). When an Integer
151
+ # or String, emits `--short=<length>`.
151
152
  #
152
- # When `true`, emits `--short` (git default length). When a
153
- # String, emits `--short=<length>`.
153
+ # @option options [Boolean, nil] :not (nil) prefix object names with
154
+ # `^` and strip `^` from names that already have one
154
155
  #
155
- # @option options [Boolean, nil] :not (nil) prefix object names with
156
- # `^` and strip `^` from names that already have one
156
+ # @option options [Boolean, String, nil] :abbrev_ref (nil) output a
157
+ # non-ambiguous short name of the object
157
158
  #
158
- # @option options [Boolean, String, nil] :abbrev_ref (nil) output a
159
- # non-ambiguous short name of the object
159
+ # When `true`, emits `--abbrev-ref`. When a String (`"strict"`
160
+ # or `"loose"`), emits `--abbrev-ref=<mode>`.
160
161
  #
161
- # When `true`, emits `--abbrev-ref`. When a String (`"strict"`
162
- # or `"loose"`), emits `--abbrev-ref=<mode>`.
162
+ # @option options [Boolean, nil] :symbolic (nil) output object names
163
+ # in a form as close to the original input as possible
163
164
  #
164
- # @option options [Boolean, nil] :symbolic (nil) output object names
165
- # in a form as close to the original input as possible
165
+ # @option options [Boolean, nil] :symbolic_full_name (nil) like
166
+ # `:symbolic` but omit non-ref input and show full refnames
166
167
  #
167
- # @option options [Boolean, nil] :symbolic_full_name (nil) like
168
- # `:symbolic` but omit non-ref input and show full refnames
168
+ # @option options [String] :output_object_format (nil) translate
169
+ # object identifiers to the specified format
169
170
  #
170
- # @option options [String] :output_object_format (nil) translate
171
- # object identifiers to the specified format
171
+ # Accepted values are `"sha1"`, `"sha256"`, and `"storage"`.
172
172
  #
173
- # Accepted values are `"sha1"`, `"sha256"`, and `"storage"`.
173
+ # @option options [Boolean, nil] :all (nil) show all refs found in
174
+ # `refs/`
174
175
  #
175
- # @option options [Boolean, nil] :all (nil) show all refs found in
176
- # `refs/`
176
+ # @option options [Boolean, String, nil] :branches (nil) show all
177
+ # branches
177
178
  #
178
- # @option options [Boolean, String, nil] :branches (nil) show all
179
- # branches
179
+ # When `true`, emits `--branches`. When a String, emits
180
+ # `--branches=<pattern>`.
180
181
  #
181
- # When `true`, emits `--branches`. When a String, emits
182
- # `--branches=<pattern>`.
182
+ # @option options [Boolean, String, nil] :tags (nil) show all tags
183
183
  #
184
- # @option options [Boolean, String, nil] :tags (nil) show all tags
184
+ # When `true`, emits `--tags`. When a String, emits
185
+ # `--tags=<pattern>`.
185
186
  #
186
- # When `true`, emits `--tags`. When a String, emits
187
- # `--tags=<pattern>`.
187
+ # @option options [Boolean, String, nil] :remotes (nil) show all
188
+ # remote-tracking branches
188
189
  #
189
- # @option options [Boolean, String, nil] :remotes (nil) show all
190
- # remote-tracking branches
190
+ # When `true`, emits `--remotes`. When a String, emits
191
+ # `--remotes=<pattern>`.
191
192
  #
192
- # When `true`, emits `--remotes`. When a String, emits
193
- # `--remotes=<pattern>`.
193
+ # @option options [String] :glob (nil) show all refs matching
194
+ # the shell glob pattern
194
195
  #
195
- # @option options [String] :glob (nil) show all refs matching
196
- # the shell glob pattern
196
+ # @option options [String, Array<String>] :exclude (nil) exclude
197
+ # refs matching the glob pattern from the next `--all`,
198
+ # `--branches`, `--tags`, `--remotes`, or `--glob`
197
199
  #
198
- # @option options [String, Array<String>] :exclude (nil) exclude
199
- # refs matching the glob pattern from the next `--all`,
200
- # `--branches`, `--tags`, `--remotes`, or `--glob`
200
+ # @option options [String] :disambiguate (nil) show every object
201
+ # whose name begins with the given prefix
201
202
  #
202
- # @option options [String] :disambiguate (nil) show every object
203
- # whose name begins with the given prefix
203
+ # @option options [String] :exclude_hidden (nil) do not include
204
+ # refs that would be hidden by the specified protocol
204
205
  #
205
- # @option options [String] :exclude_hidden (nil) do not include
206
- # refs that would be hidden by the specified protocol
206
+ # Accepted values are `"fetch"`, `"receive"`, and `"uploadpack"`.
207
+ # Affects the next `--all` or `--glob` and is cleared after
208
+ # processing them.
207
209
  #
208
- # Accepted values are `"fetch"`, `"receive"`, and `"uploadpack"`.
209
- # Affects the next `--all` or `--glob` and is cleared after
210
- # processing them.
210
+ # @option options [Boolean, nil] :local_env_vars (nil) list the
211
+ # `GIT_*` environment variables local to the repository
211
212
  #
212
- # @option options [Boolean, nil] :local_env_vars (nil) list the
213
- # `GIT_*` environment variables local to the repository
213
+ # @option options [String, Array<String>] :path_format (nil) control
214
+ # whether paths output by subsequent path-related options are
215
+ # absolute or relative
214
216
  #
215
- # @option options [String, Array<String>] :path_format (nil) control
216
- # whether paths output by subsequent path-related options are
217
- # absolute or relative
217
+ # Accepted values are `"absolute"` and `"relative"`. May be
218
+ # given multiple times; each instance affects the arguments
219
+ # that follow it on the command line.
218
220
  #
219
- # Accepted values are `"absolute"` and `"relative"`. May be
220
- # given multiple times; each instance affects the arguments
221
- # that follow it on the command line.
221
+ # @option options [Boolean, nil] :git_dir (nil) show `$GIT_DIR` if
222
+ # defined, otherwise show the path to the `.git` directory
222
223
  #
223
- # @option options [Boolean, nil] :git_dir (nil) show `$GIT_DIR` if
224
- # defined, otherwise show the path to the `.git` directory
224
+ # @option options [Boolean, nil] :absolute_git_dir (nil) like
225
+ # `:git_dir` but always output the canonicalized absolute path
225
226
  #
226
- # @option options [Boolean, nil] :absolute_git_dir (nil) like
227
- # `:git_dir` but always output the canonicalized absolute path
227
+ # @option options [Boolean, nil] :git_common_dir (nil) show
228
+ # `$GIT_COMMON_DIR` if defined, else `$GIT_DIR`
228
229
  #
229
- # @option options [Boolean, nil] :git_common_dir (nil) show
230
- # `$GIT_COMMON_DIR` if defined, else `$GIT_DIR`
230
+ # @option options [Boolean, nil] :is_inside_git_dir (nil) print
231
+ # `"true"` when the current working directory is below the
232
+ # repository directory, `"false"` otherwise
231
233
  #
232
- # @option options [Boolean, nil] :is_inside_git_dir (nil) print
233
- # `"true"` when the current working directory is below the
234
- # repository directory, `"false"` otherwise
234
+ # @option options [Boolean, nil] :is_inside_work_tree (nil) print
235
+ # `"true"` when inside the work tree, `"false"` otherwise
235
236
  #
236
- # @option options [Boolean, nil] :is_inside_work_tree (nil) print
237
- # `"true"` when inside the work tree, `"false"` otherwise
237
+ # @option options [Boolean, nil] :is_bare_repository (nil) print
238
+ # `"true"` when the repository is bare, `"false"` otherwise
238
239
  #
239
- # @option options [Boolean, nil] :is_bare_repository (nil) print
240
- # `"true"` when the repository is bare, `"false"` otherwise
240
+ # @option options [Boolean, nil] :is_shallow_repository (nil) print
241
+ # `"true"` when the repository is shallow, `"false"` otherwise
241
242
  #
242
- # @option options [Boolean, nil] :is_shallow_repository (nil) print
243
- # `"true"` when the repository is shallow, `"false"` otherwise
243
+ # @option options [String] :resolve_git_dir (nil) check if the
244
+ # given path is a valid repository or a gitfile that points at
245
+ # one and print the location
244
246
  #
245
- # @option options [String] :resolve_git_dir (nil) check if the
246
- # given path is a valid repository or a gitfile that points at
247
- # one and print the location
247
+ # @option options [String] :git_path (nil) resolve
248
+ # `"$GIT_DIR/<path>"` taking relocation variables into account
248
249
  #
249
- # @option options [String] :git_path (nil) resolve
250
- # `"$GIT_DIR/<path>"` taking relocation variables into account
250
+ # @option options [Boolean, nil] :show_cdup (nil) show the path of
251
+ # the top-level directory relative to the current directory
251
252
  #
252
- # @option options [Boolean, nil] :show_cdup (nil) show the path of
253
- # the top-level directory relative to the current directory
253
+ # @option options [Boolean, nil] :show_prefix (nil) show the path of
254
+ # the current directory relative to the top-level directory
254
255
  #
255
- # @option options [Boolean, nil] :show_prefix (nil) show the path of
256
- # the current directory relative to the top-level directory
256
+ # @option options [Boolean, nil] :show_toplevel (nil) show the
257
+ # absolute path of the top-level directory of the working tree
257
258
  #
258
- # @option options [Boolean, nil] :show_toplevel (nil) show the
259
- # absolute path of the top-level directory of the working tree
259
+ # @option options [Boolean, nil] :show_superproject_working_tree (nil)
260
+ # show the absolute path of the root of the superproject's
261
+ # working tree if the current repository is a submodule
260
262
  #
261
- # @option options [Boolean, nil] :show_superproject_working_tree (nil)
262
- # show the absolute path of the root of the superproject's
263
- # working tree if the current repository is a submodule
263
+ # @option options [Boolean, nil] :shared_index_path (nil) show the
264
+ # path to the shared index file in split index mode
264
265
  #
265
- # @option options [Boolean, nil] :shared_index_path (nil) show the
266
- # path to the shared index file in split index mode
266
+ # @option options [Boolean, String, nil] :show_object_format (nil)
267
+ # show the object format (hash algorithm) used for the
268
+ # repository
267
269
  #
268
- # @option options [Boolean, String, nil] :show_object_format (nil)
269
- # show the object format (hash algorithm) used for the
270
- # repository
270
+ # When `true`, emits `--show-object-format` (defaults to
271
+ # `"storage"`). When a String (`"storage"`, `"input"`, or
272
+ # `"output"`), emits `--show-object-format=<mode>`.
271
273
  #
272
- # When `true`, emits `--show-object-format` (defaults to
273
- # `"storage"`). When a String (`"storage"`, `"input"`, or
274
- # `"output"`), emits `--show-object-format=<mode>`.
274
+ # @option options [Boolean, nil] :show_ref_format (nil) show the
275
+ # reference storage format used for the repository
275
276
  #
276
- # @option options [Boolean, nil] :show_ref_format (nil) show the
277
- # reference storage format used for the repository
277
+ # @option options [String] :since (nil) parse the date string
278
+ # and output the corresponding `--max-age=` parameter
278
279
  #
279
- # @option options [String] :since (nil) parse the date string
280
- # and output the corresponding `--max-age=` parameter
280
+ # Alias: :after
281
281
  #
282
- # Alias: :after
282
+ # @option options [String] :until (nil) parse the date string
283
+ # and output the corresponding `--min-age=` parameter
283
284
  #
284
- # @option options [String] :until (nil) parse the date string
285
- # and output the corresponding `--min-age=` parameter
285
+ # Alias: :before
286
286
  #
287
- # Alias: :before
287
+ # @option options [String, nil] :chdir (nil) change to this directory
288
+ # before running git; not passed to the git CLI
288
289
  #
289
- # @return [Git::CommandLineResult] the result of calling
290
- # `git rev-parse`
290
+ # @return [Git::CommandLine::Result] the result of calling
291
+ # `git rev-parse`
291
292
  #
292
- # @raise [ArgumentError] if unsupported options are provided
293
+ # @raise [ArgumentError] if unsupported options are provided
293
294
  #
294
- # @raise [Git::FailedError] if git exits with a non-zero status
295
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
296
+ #
297
+ # @api public
298
+ #
299
+ def call(*, **)
300
+ super
301
+ end
295
302
  end
296
303
  end
297
304
  end
@@ -28,14 +28,14 @@ module Git
28
28
  literal '--abort'
29
29
  end
30
30
 
31
- # @!method call(*, **)
31
+ # @!method call()
32
32
  #
33
33
  # @overload call()
34
34
  #
35
35
  # Cancel the in-progress revert and restore the branch to its
36
36
  # pre-revert state
37
37
  #
38
- # @return [Git::CommandLineResult] the result of calling
38
+ # @return [Git::CommandLine::Result] the result of calling
39
39
  # `git revert --abort`
40
40
  #
41
41
  # @raise [Git::FailedError] if git exits with a non-zero exit status
@@ -29,7 +29,12 @@ module Git
29
29
  flag_option %i[edit e], negatable: true
30
30
  end
31
31
 
32
- # @!method call(*, **)
32
+ # @!method call(**options)
33
+ #
34
+ # @param options [Hash] command options
35
+ #
36
+ # @option options [Boolean, nil] :edit (nil) command option key; see
37
+ # overload docs for the full option list
33
38
  #
34
39
  # @overload call(**options)
35
40
  #
@@ -45,7 +50,7 @@ module Git
45
50
  # @option options [Boolean, nil] :no_edit (nil) suppress the editor for
46
51
  # the commit message (`--no-edit`)
47
52
  #
48
- # @return [Git::CommandLineResult] the result of calling
53
+ # @return [Git::CommandLine::Result] the result of calling
49
54
  # `git revert --continue`
50
55
  #
51
56
  # @raise [ArgumentError] if unsupported options are provided
@@ -29,7 +29,7 @@ module Git
29
29
  literal '--quit'
30
30
  end
31
31
 
32
- # @!method call(*, **)
32
+ # @!method call()
33
33
  #
34
34
  # @overload call()
35
35
  #
@@ -37,7 +37,7 @@ module Git
37
37
  # working tree as-is. If no revert is in progress, this is a
38
38
  # no-op and still succeeds.
39
39
  #
40
- # @return [Git::CommandLineResult] the result of calling
40
+ # @return [Git::CommandLine::Result] the result of calling
41
41
  # `git revert --quit`
42
42
  #
43
43
  # @raise [Git::FailedError] if git exits with a non-zero exit status
@@ -28,13 +28,13 @@ module Git
28
28
  literal '--skip'
29
29
  end
30
30
 
31
- # @!method call(*, **)
31
+ # @!method call()
32
32
  #
33
33
  # @overload call()
34
34
  #
35
35
  # Skip the current commit and continue with the remaining sequence
36
36
  #
37
- # @return [Git::CommandLineResult] the result of calling
37
+ # @return [Git::CommandLine::Result] the result of calling
38
38
  # `git revert --skip`
39
39
  #
40
40
  # @raise [Git::FailedError] if git exits with a non-zero exit status
@@ -70,7 +70,12 @@ module Git
70
70
  operand :commit, repeatable: true, required: true
71
71
  end
72
72
 
73
- # @!method call(*, **)
73
+ # @!method call(*, **options)
74
+ #
75
+ # @param options [Hash] command options
76
+ #
77
+ # @option options [Boolean, nil] :edit (nil) command option key; see
78
+ # overload docs for the full option list
74
79
  #
75
80
  # @overload call(*commit, **options)
76
81
  #
@@ -142,7 +147,7 @@ module Git
142
147
  # @option options [Boolean, nil] :reference (nil) use compact reference
143
148
  # format in the revert commit message instead of the full object name
144
149
  #
145
- # @return [Git::CommandLineResult] the result of calling `git revert`
150
+ # @return [Git::CommandLine::Result] the result of calling `git revert`
146
151
  #
147
152
  # @raise [ArgumentError] if unsupported options are provided
148
153
  #
@@ -19,10 +19,10 @@ module Git
19
19
  # - {Revert::Abort} — abort the in-progress revert (`--abort`)
20
20
  # - {Revert::Quit} — forget the in-progress revert (`--quit`)
21
21
  #
22
- # @api private
23
- #
24
22
  # @see https://git-scm.com/docs/git-revert git-revert documentation
25
23
  #
24
+ # @api private
25
+ #
26
26
  module Revert
27
27
  end
28
28
  end
@@ -52,63 +52,62 @@ module Git
52
52
  operand :pathspec, repeatable: true
53
53
  end
54
54
 
55
- # @!method call(*, **)
55
+ # @overload call(*pathspec, **options)
56
56
  #
57
- # @overload call(*pathspec, **options)
57
+ # Execute the git rm command
58
58
  #
59
- # Execute the git rm command
59
+ # @param pathspec [Array<String>] files or directories to be removed from the
60
+ # repository (relative to the worktree root)
60
61
  #
61
- # @param pathspec [Array<String>] files or directories to be removed from the
62
- # repository (relative to the worktree root)
62
+ # At least one positional pathspec or the `:pathspec_from_file` option must
63
+ # be provided; git will fail at runtime if neither is given.
63
64
  #
64
- # At least one positional pathspec or the `:pathspec_from_file` option must
65
- # be provided; git will fail at runtime if neither is given.
65
+ # @param options [Hash] command options
66
66
  #
67
- # @param options [Hash] command options
67
+ # @option options [Boolean, nil] :force (nil) override the up-to-date check and
68
+ # remove files with local modifications
68
69
  #
69
- # @option options [Boolean, nil] :force (nil) override the up-to-date check and
70
- # remove files with local modifications
70
+ # Alias: :f
71
71
  #
72
- # Alias: :f
72
+ # @option options [Boolean, nil] :dry_run (nil) do not actually remove any files;
73
+ # instead, just show if they exist in the index and would otherwise be removed
74
+ # by the command
73
75
  #
74
- # @option options [Boolean, nil] :dry_run (nil) do not actually remove any files;
75
- # instead, just show if they exist in the index and would otherwise be removed
76
- # by the command
76
+ # Alias: :n
77
77
  #
78
- # Alias: :n
78
+ # @option options [Boolean, nil] :r (nil) allow recursive removal when a leading
79
+ # directory name is given
79
80
  #
80
- # @option options [Boolean, nil] :r (nil) allow recursive removal when a leading
81
- # directory name is given
81
+ # @option options [Boolean, nil] :cached (nil) only remove from the index, keeping
82
+ # the working tree files
82
83
  #
83
- # @option options [Boolean, nil] :cached (nil) only remove from the index, keeping
84
- # the working tree files
84
+ # @option options [Boolean, nil] :ignore_unmatch (nil) exit with a zero status
85
+ # even if no files matched
85
86
  #
86
- # @option options [Boolean, nil] :ignore_unmatch (nil) exit with a zero status
87
- # even if no files matched
87
+ # @option options [Boolean, nil] :sparse (nil) allow updating index entries outside
88
+ # of the sparse-checkout cone
88
89
  #
89
- # @option options [Boolean, nil] :sparse (nil) allow updating index entries outside
90
- # of the sparse-checkout cone
90
+ # @option options [Boolean, nil] :quiet (nil) suppress the one-line-per-file output
91
91
  #
92
- # @option options [Boolean, nil] :quiet (nil) suppress the one-line-per-file output
92
+ # Alias: :q
93
93
  #
94
- # Alias: :q
94
+ # @option options [String] :pathspec_from_file (nil) read pathspec from the given
95
+ # file, one pathspec element per line; pass `-` to read from standard input
95
96
  #
96
- # @option options [String] :pathspec_from_file (nil) read pathspec from the
97
- # given file, one pathspec element per line; pass `-` to read from standard
98
- # input
97
+ # @option options [Boolean, nil] :pathspec_file_nul (nil) when used with
98
+ # `:pathspec_from_file`, separate pathspec elements with NUL instead of newlines
99
99
  #
100
- # @option options [Boolean, nil] :pathspec_file_nul (nil) when used with
101
- # `:pathspec_from_file`, separate pathspec elements with NUL instead of
102
- # newlines
100
+ # @return [Git::CommandLine::Result] the result of calling `git rm`
103
101
  #
104
- # @return [Git::CommandLineResult] the result of calling `git rm`
102
+ # @raise [ArgumentError] if unsupported options are provided
105
103
  #
106
- # @raise [ArgumentError] if unsupported options are provided
104
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
107
105
  #
108
- # @raise [Git::FailedError] if git exits with a non-zero exit status
109
- #
110
- # @api public
106
+ # @api public
111
107
  #
108
+ def call(*, **)
109
+ super
110
+ end
112
111
  end
113
112
  end
114
113
  end
@@ -611,7 +611,7 @@ module Git
611
611
  # @option options [IO, #write] :out (nil) stream output to this IO object
612
612
  # instead of capturing it; `result.stdout` will be `''`
613
613
  #
614
- # @return [Git::CommandLineResult] the result of calling `git show`
614
+ # @return [Git::CommandLine::Result] the result of calling `git show`
615
615
  #
616
616
  # If `out:` is given, output is streamed directly to the provided IO
617
617
  # object and `result.stdout` is `''`.
@@ -1,7 +1,6 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'git/commands/base'
4
- require 'git/commands/show_ref'
5
4
 
6
5
  module Git
7
6
  module Commands
@@ -44,7 +43,7 @@ module Git
44
43
 
45
44
  # Mode selector: pass `true` (default) to test all refs, or a pattern
46
45
  # string to restrict testing to refs whose names start with the pattern.
47
- # @see https://git-scm.com/docs/git-show-ref#Documentation/git-show-ref.txt---exclude-existingltpatterngt
46
+ # See https://git-scm.com/docs/git-show-ref#Documentation/git-show-ref.txt---exclude-existingltpatterngt
48
47
  flag_or_value_option :exclude_existing, inline: true
49
48
 
50
49
  execution_option :timeout
@@ -74,7 +73,7 @@ module Git
74
73
  # @option options [Numeric] :timeout (nil) abort the command after this many
75
74
  # seconds
76
75
  #
77
- # @return [Git::CommandLineResult] the result of calling
76
+ # @return [Git::CommandLine::Result] the result of calling
78
77
  # `git show-ref --exclude-existing`
79
78
  #
80
79
  # @raise [Git::FailedError] if git exits with a non-zero exit status
@@ -99,7 +98,7 @@ module Git
99
98
  #
100
99
  # @param reader [IO] readable IO connected to git's stdin
101
100
  #
102
- # @return [Git::CommandLineResult] the result of calling
101
+ # @return [Git::CommandLine::Result] the result of calling
103
102
  # `git show-ref --exclude-existing`
104
103
  #
105
104
  # @raise [Git::FailedError] if git exits with a non-zero exit status