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
@@ -43,29 +43,36 @@ module Git
43
43
  operand :remote_or_group, repeatable: true
44
44
  end
45
45
 
46
- # @!method call(*, **)
46
+ # @overload call(*remote_or_group, **options)
47
47
  #
48
- # @overload call(*remote_or_group, **options)
48
+ # Execute the `git remote update` command
49
49
  #
50
- # Execute the `git remote update` command
50
+ # @param remote_or_group [Array<String>] zero or more remote names or
51
+ # remote group names
51
52
  #
52
- # @param remote_or_group [Array<String>] zero or more remote names or remote group names
53
+ # @param options [Hash] command options
53
54
  #
54
- # @param options [Hash] command options
55
+ # @option options [Boolean, nil] :verbose (nil) show remote URLs alongside
56
+ # remote names
55
57
  #
56
- # @option options [Boolean, nil] :verbose (nil) show remote URLs alongside remote names
58
+ # Alias: :v
57
59
  #
58
- # Alias: :v
60
+ # @option options [Boolean, nil] :prune (nil) prune stale tracking refs
61
+ # while updating remotes
59
62
  #
60
- # @option options [Boolean, nil] :prune (nil) prune stale tracking refs while updating remotes
63
+ # Alias: :p
61
64
  #
62
- # Alias: :p
65
+ # @return [Git::CommandLine::Result] the result of calling `git remote update`
63
66
  #
64
- # @return [Git::CommandLineResult] the result of calling `git remote update`
67
+ # @raise [ArgumentError] if unsupported options are provided
65
68
  #
66
- # @raise [ArgumentError] if unsupported options are provided
69
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
67
70
  #
68
- # @raise [Git::FailedError] if git exits with a non-zero exit status
71
+ # @api public
72
+ #
73
+ def call(*, **)
74
+ super
75
+ end
69
76
  end
70
77
  end
71
78
  end
@@ -33,9 +33,9 @@ module Git
33
33
  # - {Remote::Prune} - prune stale tracking refs for remotes
34
34
  # - {Remote::Update} - update one or more remotes or groups
35
35
  #
36
- # @api private
37
- #
38
36
  # @see https://git-scm.com/docs/git-remote git-remote documentation
37
+ #
38
+ # @api private
39
39
  module Remote
40
40
  end
41
41
  end
@@ -84,194 +84,198 @@ module Git
84
84
  flag_option :path_walk
85
85
  end
86
86
 
87
- # @!method call(*, **)
87
+ # @overload call(**options)
88
88
  #
89
- # @overload call(**options)
89
+ # Execute the `git repack` command
90
90
  #
91
- # Execute the `git repack` command
91
+ # @param options [Hash] command options
92
92
  #
93
- # @param options [Hash] command options
94
- #
95
- # @option options [Boolean, nil] :a (nil) pack all objects into a single pack
93
+ # @option options [Boolean, nil] :a (nil) pack all objects into a single pack
96
94
  #
97
95
  # When `true`, passes `-a`. Especially useful when packing a repository
98
96
  # used for private development. Use with `:d` to clean up objects.
99
97
  #
100
- # @option options [Boolean, nil] :A (nil) pack all objects, loosening unreachable
101
- # objects when combined with `:d`
98
+ # @option options [Boolean, nil] :A (nil) pack all objects, loosening unreachable
99
+ # objects when combined with `:d`
102
100
  #
103
101
  # When `true`, passes `-A`. Like `:a`, but any unreachable objects in a
104
102
  # previous pack become loose unpacked objects instead of being removed. The
105
103
  # loose unreachable objects are pruned by the next `git gc` invocation.
106
104
  #
107
- # @option options [Boolean, nil] :d (nil) delete redundant packs after repacking
105
+ # @option options [Boolean, nil] :d (nil) delete redundant packs after repacking
108
106
  #
109
107
  # When `true`, passes `-d`. After packing, removes any existing packs that
110
108
  # are made redundant by the newly created pack. Also runs `git prune-packed`.
111
109
  #
112
- # @option options [Boolean, nil] :cruft (nil) pack unreachable objects into a
113
- # separate cruft pack when combined with `:d`
110
+ # @option options [Boolean, nil] :cruft (nil) pack unreachable objects into a
111
+ # separate cruft pack when combined with `:d`
114
112
  #
115
113
  # When `true`, passes `--cruft`. Like `:a`, but any unreachable objects are
116
114
  # packed into a separate cruft pack instead of being removed. Incompatible
117
115
  # with `:keep_unreachable`.
118
116
  #
119
- # @option options [String] :cruft_expiration (nil) expire cruft objects older
120
- # than the given date immediately
117
+ # @option options [String] :cruft_expiration (nil) expire cruft objects older
118
+ # than the given date immediately
121
119
  #
122
120
  # Passed as `--cruft-expiration=<approxidate>`. Only useful with
123
121
  # `--cruft -d`.
124
122
  #
125
- # @option options [Integer, String] :max_cruft_size (nil) override
126
- # `--max-pack-size` for cruft packs
123
+ # @option options [Integer, String] :max_cruft_size (nil) override
124
+ # `--max-pack-size` for cruft packs
127
125
  #
128
126
  # Passed as `--max-cruft-size=<n>`. Accepts size suffixes (`k`, `m`, `g`).
129
127
  # Inherits the value of `:max_pack_size` by default.
130
128
  #
131
- # @option options [Integer, String] :combine_cruft_below_size (nil) only
132
- # repack cruft packs strictly smaller than this size
129
+ # @option options [Integer, String] :combine_cruft_below_size (nil) only
130
+ # repack cruft packs strictly smaller than this size
133
131
  #
134
132
  # Passed as `--combine-cruft-below-size=<n>`. Accepts size suffixes
135
133
  # (`k`, `m`, `g`). Useful to avoid repacking large cruft packs.
136
134
  #
137
- # @option options [String] :expire_to (nil) write pruned cruft objects to
138
- # a directory
135
+ # @option options [String] :expire_to (nil) write pruned cruft objects to
136
+ # a directory
139
137
  #
140
138
  # Passed as `--expire-to=<dir>`. Only useful with `--cruft -d`.
141
139
  #
142
- # @option options [Boolean, nil] :l (nil) pass `--local` to `git pack-objects`
140
+ # @option options [Boolean, nil] :l (nil) pass `--local` to `git pack-objects`
143
141
  #
144
142
  # When `true`, passes `-l`. Ignores objects that come from an alternates
145
143
  # object store.
146
144
  #
147
- # @option options [Boolean, nil] :f (nil) pass `--no-reuse-delta` to
148
- # `git pack-objects`
145
+ # @option options [Boolean, nil] :f (nil) pass `--no-reuse-delta` to
146
+ # `git pack-objects`
149
147
  #
150
148
  # When `true`, passes `-f`. Forces reconstruction of all pack deltas.
151
149
  #
152
- # @option options [Boolean, nil] :F (nil) pass `--no-reuse-object` to
153
- # `git pack-objects`
150
+ # @option options [Boolean, nil] :F (nil) pass `--no-reuse-object` to
151
+ # `git pack-objects`
154
152
  #
155
153
  # When `true`, passes `-F`. Forces reconstruction of all object data, not
156
154
  # just deltas.
157
155
  #
158
- # @option options [Boolean, nil] :quiet (nil) suppress progress reporting
156
+ # @option options [Boolean, nil] :quiet (nil) suppress progress reporting
159
157
  #
160
158
  # When `true`, passes `--quiet`.
161
159
  #
162
160
  # Alias: `:q`
163
161
  #
164
- # @option options [Boolean, nil] :n (nil) do not update server information
162
+ # @option options [Boolean, nil] :n (nil) do not update server information
165
163
  #
166
164
  # When `true`, passes `-n`. Skips running `git update-server-info`, which
167
165
  # updates local catalog files needed to publish the repository
168
166
  # over HTTP or FTP.
169
167
  #
170
- # @option options [Integer, String] :window (nil) number of previous objects
171
- # used to generate delta compressions
168
+ # @option options [Integer, String] :window (nil) number of previous objects
169
+ # used to generate delta compressions
172
170
  #
173
171
  # Passed as `--window=<n>` to `git pack-objects`.
174
172
  #
175
- # @option options [Integer, String] :depth (nil) maximum delta depth
173
+ # @option options [Integer, String] :depth (nil) maximum delta depth
176
174
  #
177
175
  # Passed as `--depth=<n>` to `git pack-objects`.
178
176
  #
179
- # @option options [Integer, String] :threads (nil) number of threads for
180
- # delta search
177
+ # @option options [Integer, String] :threads (nil) number of threads for
178
+ # delta search
181
179
  #
182
180
  # Passed as `--threads=<n>` to `git pack-objects`.
183
181
  #
184
- # @option options [Integer, String] :window_memory (nil) maximum memory usage
185
- # for delta window
182
+ # @option options [Integer, String] :window_memory (nil) maximum memory usage
183
+ # for delta window
186
184
  #
187
185
  # Passed as `--window-memory=<n>` to `git pack-objects`. Accepts size
188
186
  # suffixes (`k`, `m`, `g`).
189
187
  #
190
- # @option options [Integer, String] :max_pack_size (nil) maximum size of each
191
- # output pack file
188
+ # @option options [Integer, String] :max_pack_size (nil) maximum size of each
189
+ # output pack file
192
190
  #
193
191
  # Passed as `--max-pack-size=<n>`. Accepts size suffixes (`k`, `m`, `g`).
194
192
  #
195
- # @option options [String] :filter (nil) remove objects matching the filter
196
- # specification from the resulting packfile
193
+ # @option options [String] :filter (nil) remove objects matching the filter
194
+ # specification from the resulting packfile
197
195
  #
198
196
  # Passed as `--filter=<filter-spec>`. Filtered objects are placed in a
199
197
  # separate packfile. Best used with `-a -d` and in a bare repository.
200
198
  #
201
- # @option options [String] :filter_to (nil) write the pack containing filtered
202
- # objects to a directory
199
+ # @option options [String] :filter_to (nil) write the pack containing filtered
200
+ # objects to a directory
203
201
  #
204
202
  # Passed as `--filter-to=<dir>`. Only useful with `:filter`.
205
203
  #
206
- # @option options [Boolean, nil] :write_bitmap_index (nil) write a reachability
207
- # bitmap index as part of the repack
204
+ # @option options [Boolean, nil] :write_bitmap_index (nil) write a reachability
205
+ # bitmap index as part of the repack
208
206
  #
209
207
  # When `true`, passes `--write-bitmap-index`. Only meaningful when used with
210
208
  # `:a`, `:A`, or `:write_midx`. Overrides `repack.writeBitmaps`.
211
209
  #
212
210
  # Alias: `:b`
213
211
  #
214
- # @option options [Boolean, nil] :pack_kept_objects (nil) include objects in
215
- # `.keep` files when repacking
212
+ # @option options [Boolean, nil] :pack_kept_objects (nil) include objects in
213
+ # `.keep` files when repacking
216
214
  #
217
215
  # When `true`, passes `--pack-kept-objects`. Generally only useful when
218
216
  # writing bitmaps with `:write_bitmap_index`.
219
217
  #
220
- # @option options [String, Array<String>] :keep_pack (nil) exclude named
221
- # pack(s) from repacking
218
+ # @option options [String, Array<String>] :keep_pack (nil) exclude named
219
+ # pack(s) from repacking
222
220
  #
223
221
  # Pass a pack file name (without leading directory, e.g. `'pack-abc123.pack'`)
224
222
  # or an array of pack file names. Each value is passed as a separate
225
223
  # `--keep-pack=<name>` argument.
226
224
  #
227
- # @option options [Boolean, nil] :write_midx (nil) write a multi-pack index
228
- # containing the non-redundant packs
225
+ # @option options [Boolean, nil] :write_midx (nil) write a multi-pack index
226
+ # containing the non-redundant packs
229
227
  #
230
228
  # When `true`, passes `--write-midx`.
231
229
  #
232
230
  # Alias: `:m`
233
231
  #
234
- # @option options [String] :unpack_unreachable (nil) do not loosen unreachable
235
- # objects older than the given date
232
+ # @option options [String] :unpack_unreachable (nil) do not loosen unreachable
233
+ # objects older than the given date
236
234
  #
237
235
  # Passed as `--unpack-unreachable=<when>`. Objects older than the given date
238
236
  # are not loosened, since they would be immediately pruned by a follow-up
239
237
  # `git prune`.
240
238
  #
241
- # @option options [Boolean, nil] :keep_unreachable (nil) keep unreachable objects
242
- # in the new packfile rather than removing them
239
+ # @option options [Boolean, nil] :keep_unreachable (nil) keep unreachable objects
240
+ # in the new packfile rather than removing them
243
241
  #
244
242
  # When `true`, passes `--keep-unreachable`. Appends unreachable objects from
245
243
  # existing packs to the end of the new packfile. For use with `-ad`.
246
244
  #
247
245
  # Alias: `:k`
248
246
  #
249
- # @option options [Boolean, nil] :delta_islands (nil) pass `--delta-islands` to
250
- # `git pack-objects`
247
+ # @option options [Boolean, nil] :delta_islands (nil) pass `--delta-islands` to
248
+ # `git pack-objects`
251
249
  #
252
250
  # When `true`, passes `--delta-islands`.
253
251
  #
254
252
  # Alias: `:i`
255
253
  #
256
- # @option options [Integer, String] :geometric (nil) arrange pack structure so
257
- # each successive pack contains at least this many times the objects of the
258
- # next-largest pack
254
+ # @option options [Integer, String] :geometric (nil) arrange pack structure so
255
+ # each successive pack contains at least this many times the objects of the
256
+ # next-largest pack
259
257
  #
260
258
  # Passed as `--geometric=<factor>`.
261
259
  #
262
260
  # Alias: `:g`
263
261
  #
264
- # @option options [Integer, String] :name_hash_version (nil) pass
265
- # `--name-hash-version=<n>` to `git pack-objects`
262
+ # @option options [Integer, String] :name_hash_version (nil) pass
263
+ # `--name-hash-version=<n>` to `git pack-objects`
264
+ #
265
+ # @option options [Boolean, nil] :path_walk (nil) pass `--path-walk` to
266
+ # `git pack-objects`
266
267
  #
267
- # @option options [Boolean, nil] :path_walk (nil) pass `--path-walk` to
268
- # `git pack-objects`
268
+ # @return [Git::CommandLine::Result] the result of calling `git repack`
269
269
  #
270
- # @return [Git::CommandLineResult] the result of calling `git repack`
270
+ # @raise [ArgumentError] if unsupported options are provided
271
271
  #
272
- # @raise [ArgumentError] if unsupported options are provided
272
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
273
273
  #
274
- # @raise [Git::FailedError] if git exits with a non-zero exit status
274
+ # @api public
275
+ #
276
+ def call(*, **)
277
+ super
278
+ end
275
279
  end
276
280
  end
277
281
  end
@@ -72,76 +72,83 @@ module Git
72
72
  value_option :pathspec, as_operand: true, repeatable: true
73
73
  end
74
74
 
75
- # @!method call(*, **)
75
+ # @overload call(commit = nil, **options)
76
76
  #
77
- # Execute the git reset command.
77
+ # Execute the `git reset` command
78
78
  #
79
- # @overload call(commit = nil, **options)
79
+ # @param commit [String, nil] (nil) commit or tree-ish to reset to;
80
+ # defaults to HEAD when not given
80
81
  #
81
- # @param commit [String, nil] (nil) commit or tree-ish to reset to;
82
- # defaults to HEAD when not given
82
+ # @param options [Hash] command options
83
83
  #
84
- # @param options [Hash] command options
84
+ # @option options [Boolean, nil] :soft (nil) leave working tree and index unchanged;
85
+ # reset HEAD to the specified commit
85
86
  #
86
- # @option options [Boolean, nil] :soft (nil) leave working tree and index unchanged;
87
- # reset HEAD to the specified commit
87
+ # @option options [Boolean, nil] :mixed (nil) reset the index but not the working tree;
88
+ # default mode when no mode flag is given
88
89
  #
89
- # @option options [Boolean, nil] :mixed (nil) reset the index but not the working tree;
90
- # default mode when no mode flag is given
90
+ # @option options [Boolean, nil] :N (nil) mark removed paths as intent-to-add;
91
+ # only meaningful alongside `:mixed`
91
92
  #
92
- # @option options [Boolean, nil] :N (nil) mark removed paths as intent-to-add;
93
- # only meaningful alongside `:mixed`
93
+ # @option options [Boolean, nil] :hard (nil) reset the index and working tree to the
94
+ # specified commit; discards all tracked changes since that commit
94
95
  #
95
- # @option options [Boolean, nil] :hard (nil) reset the index and working tree to the
96
- # specified commit; discards all tracked changes since that commit
96
+ # @option options [Boolean, nil] :merge (nil) reset the index and update files that
97
+ # differ between the commit and HEAD, while preserving uncommitted changes
97
98
  #
98
- # @option options [Boolean, nil] :merge (nil) reset the index and update files that
99
- # differ between the commit and HEAD, while preserving uncommitted changes
99
+ # @option options [Boolean, nil] :keep (nil) reset index entries and update files that
100
+ # differ between the commit and HEAD; aborts if any such file has local changes
100
101
  #
101
- # @option options [Boolean, nil] :keep (nil) reset index entries and update files that
102
- # differ between the commit and HEAD; aborts if any such file has local changes
102
+ # @option options [Boolean, nil] :quiet (nil) suppress all output; report errors only
103
+ # (`--quiet`)
103
104
  #
104
- # @option options [Boolean, nil] :quiet (nil) suppress all output; report errors only
105
- # (`--quiet`)
105
+ # Alias: :q
106
106
  #
107
- # Alias: :q
107
+ # @option options [Boolean, nil] :no_quiet (nil) do not suppress output (`--no-quiet`)
108
108
  #
109
- # @option options [Boolean, nil] :no_quiet (nil) do not suppress output (`--no-quiet`)
109
+ # @option options [Boolean, nil] :refresh (nil) refresh the index after a mixed reset;
110
+ # enabled by default when omitted (`--refresh`)
110
111
  #
111
- # @option options [Boolean, nil] :refresh (nil) refresh the index after a mixed reset;
112
- # enabled by default when omitted (`--refresh`)
112
+ # @option options [Boolean, nil] :no_refresh (nil) do not refresh the index after a mixed
113
+ # reset (`--no-refresh`)
113
114
  #
114
- # @option options [Boolean, nil] :no_refresh (nil) do not refresh the index after a mixed
115
- # reset (`--no-refresh`)
115
+ # @option options [Integer, String] :unified (nil) number of context lines around each
116
+ # diff hunk
116
117
  #
117
- # @option options [Integer, String] :unified (nil) number of context lines around each diff hunk
118
+ # Alias: :U
118
119
  #
119
- # Alias: :U
120
+ # @option options [Integer, String] :inter_hunk_context (nil) number of context lines to
121
+ # show between diff hunks
120
122
  #
121
- # @option options [Integer, String] :inter_hunk_context (nil) number of context lines to show
122
- # between diff hunks
123
+ # @option options [String] :pathspec_from_file (nil) read pathspec from the given file;
124
+ # pass `"-"` to read from standard input
123
125
  #
124
- # @option options [String] :pathspec_from_file (nil) read pathspec from the given file;
125
- # pass `"-"` to read from standard input
126
+ # @option options [Boolean, nil] :pathspec_file_nul (nil) delimit pathspec elements with
127
+ # NUL when reading from `:pathspec_from_file`; only meaningful alongside
128
+ # `:pathspec_from_file`
126
129
  #
127
- # @option options [Boolean, nil] :pathspec_file_nul (nil) delimit pathspec elements with NUL
128
- # when reading from `:pathspec_from_file`; only meaningful alongside `:pathspec_from_file`
130
+ # @option options [Boolean, nil] :recurse_submodules (nil) also reset the working tree of
131
+ # all active submodules to the commit recorded in the superproject
132
+ # (`--recurse-submodules`)
129
133
  #
130
- # @option options [Boolean, nil] :recurse_submodules (nil) also reset the working tree of
131
- # all active submodules to the commit recorded in the superproject
132
- # (`--recurse-submodules`)
134
+ # @option options [Boolean, nil] :no_recurse_submodules (nil) do not reset submodule
135
+ # working trees (`--no-recurse-submodules`)
133
136
  #
134
- # @option options [Boolean, nil] :no_recurse_submodules (nil) do not reset submodule
135
- # working trees (`--no-recurse-submodules`)
137
+ # @option options [String, Array<String>] :pathspec (nil) path(s) to
138
+ # reset in the index; when given, only the index entries for the
139
+ # matching paths are updated
136
140
  #
137
- # @option options [Array<String>] :pathspec (nil) path(s) to reset in the index;
138
- # when given, only the index entries for the matching paths are updated
141
+ # @return [Git::CommandLine::Result] the result of calling `git reset`
139
142
  #
140
- # @return [Git::CommandLineResult] the result of calling `git reset`
143
+ # @raise [ArgumentError] if unsupported options are provided
141
144
  #
142
- # @raise [ArgumentError] if unsupported options are provided
145
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
143
146
  #
144
- # @raise [Git::FailedError] if git exits with a non-zero exit status
147
+ # @api public
148
+ #
149
+ def call(*, **)
150
+ super
151
+ end
145
152
  end
146
153
  end
147
154
  end