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
@@ -57,105 +57,121 @@ module Git
57
57
  operand :pattern, repeatable: true
58
58
  end
59
59
 
60
- # @!method call(*, **)
60
+ # @overload call(*pattern, **options)
61
61
  #
62
- # @overload call(*pattern, **options)
62
+ # Execute the `git branch --list` command
63
63
  #
64
- # Execute the `git branch --list` command
64
+ # @param pattern [Array<String>] shell wildcard patterns to filter branches
65
65
  #
66
- # @param pattern [Array<String>] shell wildcard patterns to filter branches
66
+ # If multiple patterns are given, a branch is shown if it matches any
67
+ # of the patterns
67
68
  #
68
- # If multiple patterns are given, a branch is shown if it matches any of the patterns.
69
+ # @param options [Hash] command options
69
70
  #
70
- # @param options [Hash] command options
71
+ # @option options [Boolean, String, nil] :color (nil) color branches output
71
72
  #
72
- # @option options [Boolean, String, nil] :color (nil) color branches output
73
+ # Pass `true` for `--color` or a string (`'always'`, `'never'`,
74
+ # `'auto'`) for `--color=<when>`
73
75
  #
74
- # Pass `true` for `--color` or a string (`'always'`, `'never'`, `'auto'`) for `--color=<when>`.
76
+ # @option options [Boolean, nil] :no_color (nil) suppress colored output
77
+ # (`--no-color`)
75
78
  #
76
- # @option options [Boolean, nil] :no_color (nil) suppress colored output (`--no-color`)
79
+ # @option options [Boolean, Integer, nil] :verbose (nil) show sha1 and
80
+ # commit subject for each branch
77
81
  #
78
- # @option options [Boolean, Integer, nil] :verbose (nil) show sha1 and commit
79
- # subject for each branch
82
+ # Pass `true` for `--verbose` (show sha1 and subject); pass `2` for
83
+ # `--verbose --verbose` (also show the linked worktree path and
84
+ # upstream branch name)
80
85
  #
81
- # Pass `true` for `--verbose` (show sha1 and subject); pass `2` for
82
- # `--verbose --verbose` (also show the linked worktree path and upstream
83
- # branch name).
86
+ # Alias: :v
84
87
  #
85
- # Alias: :v
88
+ # @option options [Boolean, Integer, nil] :abbrev (nil) minimum sha1
89
+ # display length when used with verbose mode
86
90
  #
87
- # @option options [Boolean, Integer, nil] :abbrev (nil) minimum sha1 display
88
- # length when used with verbose mode
91
+ # Pass an integer for `--abbrev=<n>` or `true` for `--abbrev`
92
+ # (default length)
89
93
  #
90
- # Pass an integer for `--abbrev=<n>` or `true` for `--abbrev` (default length).
94
+ # @option options [Boolean, nil] :no_abbrev (nil) show full sha1s
95
+ # (`--no-abbrev`)
91
96
  #
92
- # @option options [Boolean, nil] :no_abbrev (nil) show full sha1s (`--no-abbrev`)
97
+ # @option options [Boolean, String, nil] :column (nil) display branch
98
+ # listing in columns
93
99
  #
94
- # @option options [Boolean, String, nil] :column (nil) display branch listing in
95
- # columns
100
+ # Pass `true` for `--column` or a string of options for
101
+ # `--column=<options>`
96
102
  #
97
- # Pass `true` for `--column` or a string of options for `--column=<options>`.
98
- # Only applicable in non-verbose mode.
103
+ # Only applicable in non-verbose mode
99
104
  #
100
- # @option options [Boolean, nil] :no_column (nil) disable column output (`--no-column`)
105
+ # @option options [Boolean, nil] :no_column (nil) disable column output
106
+ # (`--no-column`)
101
107
  #
102
- # @option options [String, Array<String>] :sort (nil) sort branches by the
103
- # specified key(s)
108
+ # @option options [String, Array<String>] :sort (nil) sort branches by
109
+ # the specified key(s)
104
110
  #
105
- # Give an array to add multiple --sort options. Prefix each key with '-' for
106
- # descending order. For example, sort: ['refname', '-committerdate'].
111
+ # Give an array to add multiple --sort options
112
+ # Prefix each key with '-' for descending order
113
+ # For example, sort: ['refname', '-committerdate']
107
114
  #
108
- # @option options [Boolean, String, nil] :merged (nil) list only branches merged
109
- # into the specified commit
115
+ # @option options [Boolean, String, nil] :merged (nil) list only branches
116
+ # merged into the specified commit
110
117
  #
111
- # Pass `true` to default to HEAD or a commit ref string to filter by
112
- # that commit.
118
+ # Pass `true` to default to HEAD or a commit ref string to filter by
119
+ # that commit
113
120
  #
114
- # @option options [Boolean, String, nil] :no_merged (nil) list only branches not
115
- # merged into the specified commit
121
+ # @option options [Boolean, String, nil] :no_merged (nil) list only
122
+ # branches not merged into the specified commit
116
123
  #
117
- # Pass `true` to default to HEAD or a commit ref string to filter by
118
- # that commit.
124
+ # Pass `true` to default to HEAD or a commit ref string to filter by
125
+ # that commit
119
126
  #
120
- # @option options [Boolean, String, nil] :contains (nil) list only branches that
121
- # contain the specified commit
127
+ # @option options [Boolean, String, nil] :contains (nil) list only
128
+ # branches that contain the specified commit
122
129
  #
123
- # Pass `true` to default to HEAD or a commit ref string to filter by
124
- # that commit.
130
+ # Pass `true` to default to HEAD or a commit ref string to filter by
131
+ # that commit
125
132
  #
126
- # @option options [Boolean, String, nil] :no_contains (nil) list only branches
127
- # that don't contain the specified commit
133
+ # @option options [Boolean, String, nil] :no_contains (nil) list only
134
+ # branches that don't contain the specified commit
128
135
  #
129
- # Pass `true` to default to HEAD or a commit ref string to filter by
130
- # that commit.
136
+ # Pass `true` to default to HEAD or a commit ref string to filter by
137
+ # that commit
131
138
  #
132
- # @option options [String] :points_at (nil) list only branches that point
133
- # at the specified object
139
+ # @option options [String] :points_at (nil) list only branches that
140
+ # point at the specified object
134
141
  #
135
- # @option options [String] :format (nil) output format string for each branch
142
+ # @option options [String] :format (nil) output format string for each
143
+ # branch
136
144
  #
137
- # @option options [Boolean, nil] :remotes (nil) list only remote-tracking
138
- # branches
145
+ # @option options [Boolean, nil] :remotes (nil) list only remote-tracking
146
+ # branches
139
147
  #
140
- # Alias: :r
148
+ # Alias: :r
141
149
  #
142
- # @option options [Boolean, nil] :all (nil) list both local and remote branches
150
+ # @option options [Boolean, nil] :all (nil) list both local and remote
151
+ # branches
143
152
  #
144
- # Alias: :a
153
+ # Alias: :a
145
154
  #
146
- # @option options [Boolean, nil] :ignore_case (nil) sort and filter branches
147
- # case insensitively
155
+ # @option options [Boolean, nil] :ignore_case (nil) sort and filter
156
+ # branches case insensitively
148
157
  #
149
- # Alias: :i
158
+ # Alias: :i
150
159
  #
151
- # @option options [Boolean, nil] :omit_empty (nil) do not print a newline after
152
- # formatted refs where the format expands to the empty string
160
+ # @option options [Boolean, nil] :omit_empty (nil) do not print a
161
+ # newline after formatted refs where the format expands to the empty
162
+ # string
153
163
  #
154
- # @return [Git::CommandLineResult] the result of calling `git branch --list`
164
+ # @return [Git::CommandLine::Result] the result of calling `git branch --list`
155
165
  #
156
- # @raise [ArgumentError] if unsupported options are provided
166
+ # @raise [ArgumentError] if unsupported options are provided
157
167
  #
158
- # @raise [Git::FailedError] if git exits with a non-zero exit status
168
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
169
+ #
170
+ # @api public
171
+ #
172
+ def call(*, **)
173
+ super
174
+ end
159
175
  end
160
176
  end
161
177
  end
@@ -47,47 +47,55 @@ module Git
47
47
  operand :new_branch, required: true
48
48
  end
49
49
 
50
- # @!method call(*, **)
50
+ # Executes the git branch --move command to rename a branch
51
51
  #
52
- # Execute the git branch --move command to rename a branch
52
+ # @overload call(new_branch, **options)
53
53
  #
54
- # @overload call(new_branch, **options)
54
+ # Rename the current branch to new_branch
55
55
  #
56
- # Rename the current branch to new_branch
56
+ # @param new_branch [String] the new name for the branch
57
57
  #
58
- # @param new_branch [String] the new name for the branch
58
+ # @param options [Hash] command options
59
59
  #
60
- # @param options [Hash] command options
60
+ # @option options [Boolean, nil] :force (nil) allow renaming even if new_branch already
61
+ # exists
61
62
  #
62
- # @option options [Boolean, nil] :force (nil) allow renaming even if new_branch already exists
63
+ # Alias: :f
63
64
  #
64
- # Alias: :f
65
+ # @return [Git::CommandLine::Result] the result of calling `git branch --move`
65
66
  #
66
- # @return [Git::CommandLineResult] the result of calling `git branch --move`
67
+ # @raise [ArgumentError] if unsupported options are provided
67
68
  #
68
- # @raise [ArgumentError] if unsupported options are provided
69
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
69
70
  #
70
- # @raise [Git::FailedError] if git exits with a non-zero exit status
71
+ # @api public
71
72
  #
72
- # @overload call(old_branch, new_branch, **options)
73
+ # @overload call(old_branch, new_branch, **options)
73
74
  #
74
- # Rename old_branch to new_branch
75
+ # Rename old_branch to new_branch
75
76
  #
76
- # @param old_branch [String] the current name of the branch
77
+ # @param old_branch [String] the current name of the branch
77
78
  #
78
- # @param new_branch [String] the new name for the branch
79
+ # @param new_branch [String] the new name for the branch
79
80
  #
80
- # @param options [Hash] command options
81
+ # @param options [Hash] command options
81
82
  #
82
- # @option options [Boolean, nil] :force (nil) allow renaming even if new_branch already exists
83
+ # @option options [Boolean, nil] :force (nil) allow renaming even if new_branch already
84
+ # exists
83
85
  #
84
- # Alias: :f
86
+ # Alias: :f
85
87
  #
86
- # @return [Git::CommandLineResult] the result of calling `git branch --move`
88
+ # @return [Git::CommandLine::Result] the result of calling `git branch --move`
87
89
  #
88
- # @raise [ArgumentError] if unsupported options are provided
90
+ # @raise [ArgumentError] if unsupported options are provided
89
91
  #
90
- # @raise [Git::FailedError] if git exits with a non-zero exit status
92
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
93
+ #
94
+ # @api public
95
+ #
96
+ def call(*, **)
97
+ super
98
+ end
91
99
  end
92
100
  end
93
101
  end
@@ -39,21 +39,20 @@ module Git
39
39
  operand :branch_name
40
40
  end
41
41
 
42
- # @!method call(*, **)
43
- #
44
- # Execute the git branch --set-upstream-to command
42
+ # @!method call(*)
45
43
  #
46
44
  # @overload call(**options)
47
45
  #
48
- # Sets upstream for the current branch
46
+ # Set upstream for the current branch
49
47
  #
50
48
  # @param options [Hash] command options
51
49
  #
52
- # @option options [String] :set_upstream_to (required) the upstream branch (e.g., 'origin/main')
50
+ # @option options [String] :set_upstream_to (required)
51
+ # upstream branch to set (e.g., `origin/main`)
53
52
  #
54
53
  # Alias: :u
55
54
  #
56
- # @return [Git::CommandLineResult] the result of calling `git branch --set-upstream-to`
55
+ # @return [Git::CommandLine::Result] the result of calling `git branch --set-upstream-to`
57
56
  #
58
57
  # @raise [ArgumentError] if set_upstream_to is not provided
59
58
  #
@@ -69,11 +68,12 @@ module Git
69
68
  #
70
69
  # @param options [Hash] command options
71
70
  #
72
- # @option options [String] :set_upstream_to (required) the upstream branch (e.g., 'origin/main')
71
+ # @option options [String] :set_upstream_to (required)
72
+ # upstream branch to set (e.g., `origin/main`)
73
73
  #
74
74
  # Alias: :u
75
75
  #
76
- # @return [Git::CommandLineResult] the result of calling `git branch --set-upstream-to`
76
+ # @return [Git::CommandLine::Result] the result of calling `git branch --set-upstream-to`
77
77
  #
78
78
  # @raise [ArgumentError] if set_upstream_to is not provided
79
79
  #
@@ -34,13 +34,13 @@ module Git
34
34
  literal '--show-current'
35
35
  end
36
36
 
37
- # @!method call(*, **)
37
+ # @!method call(*)
38
38
  #
39
39
  # @overload call()
40
40
  #
41
- # Execute the git branch --show-current command.
41
+ # Execute the `git branch --show-current` command
42
42
  #
43
- # @return [Git::CommandLineResult] the result of calling `git branch --show-current`
43
+ # @return [Git::CommandLine::Result] the result of calling `git branch --show-current`
44
44
  #
45
45
  # @raise [Git::FailedError] if git exits with a non-zero exit status
46
46
  end
@@ -35,20 +35,16 @@ module Git
35
35
  operand :branch_name
36
36
  end
37
37
 
38
- # @!method call(*, **)
38
+ # @!method call(*)
39
39
  #
40
- # @overload call(branch_name = nil, **options)
40
+ # @overload call(branch_name = nil)
41
41
  #
42
- # Execute the `git branch --unset-upstream` command.
42
+ # Execute the `git branch --unset-upstream` command
43
43
  #
44
44
  # @param branch_name [String, nil] the branch to remove upstream tracking for
45
45
  # (defaults to current branch if omitted)
46
46
  #
47
- # @param options [Hash] command options
48
- #
49
- # @return [Git::CommandLineResult] the result of calling `git branch --unset-upstream`
50
- #
51
- # @raise [ArgumentError] if unsupported options are provided
47
+ # @return [Git::CommandLine::Result] the result of calling `git branch --unset-upstream`
52
48
  #
53
49
  # @raise [Git::FailedError] if git exits with a non-zero exit status
54
50
  end
@@ -24,10 +24,10 @@ module Git
24
24
  # - {Branch::SetUpstream} — set upstream tracking (`--set-upstream-to`)
25
25
  # - {Branch::UnsetUpstream} — remove upstream tracking (`--unset-upstream`)
26
26
  #
27
- # @api private
28
- #
29
27
  # @see https://git-scm.com/docs/git-branch git-branch documentation
30
28
  #
29
+ # @api private
30
+ #
31
31
  module Branch
32
32
  end
33
33
  end
@@ -32,12 +32,12 @@ module Git
32
32
  # For single-object queries, use {CatFile::Raw}.
33
33
  # For filter-processed content, use {CatFile::Filtered}.
34
34
  #
35
+ # @note `arguments` block audited against https://git-scm.com/docs/git-cat-file/2.53.0
36
+ #
35
37
  # @see Git::Commands::CatFile
36
38
  #
37
39
  # @see https://git-scm.com/docs/git-cat-file git-cat-file documentation
38
40
  #
39
- # @note `arguments` block audited against https://git-scm.com/docs/git-cat-file/2.53.0
40
- #
41
41
  # @api private
42
42
  #
43
43
  class Batch < Base
@@ -47,56 +47,56 @@ module Git
47
47
  # Full content mode: header + raw bytes + newline separator per object;
48
48
  # accepts a format string to customise the per-object output header
49
49
  # (e.g. `"%(objectname) %(objecttype) %(objectsize)"`)
50
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch
50
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch
51
51
  flag_or_value_option :batch, inline: true
52
52
 
53
53
  # Metadata-only mode: one `<sha> <type> <size>` line per object;
54
54
  # accepts a format string to customise the per-object output line
55
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-check
55
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-check
56
56
  flag_or_value_option :batch_check, inline: true
57
57
 
58
58
  # Command-dispatch mode: stdin carries `contents`/`info`/`flush` verbs;
59
59
  # accepts a format string to customise the output of `info` and `contents` commands
60
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-command
60
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-command
61
61
  flag_or_value_option :batch_command, inline: true
62
62
 
63
63
  # Enumerate all objects in the repository without reading stdin.
64
64
  # Incompatible with `batch_command:`.
65
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-all-objects
65
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---batch-all-objects
66
66
  flag_option :batch_all_objects
67
67
 
68
68
  # Use normal stdio buffering; enables explicit `flush` semantics when used
69
69
  # with `batch_command:` and improves throughput with `batch_check:`
70
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---buffer
70
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---buffer
71
71
  flag_option :buffer
72
72
 
73
73
  # Follow symlinks inside the repository when traversing tree objects
74
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---follow-symlinks
74
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---follow-symlinks
75
75
  flag_option :follow_symlinks
76
76
 
77
77
  # Allow `--batch-all-objects` to output objects in an arbitrary, potentially
78
78
  # faster order
79
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---unordered
79
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---unordered
80
80
  flag_option :unordered
81
81
 
82
82
  # Apply textconv filters to blob content (combine with `batch_command:`)
83
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---textconv
83
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---textconv
84
84
  flag_option :textconv
85
85
 
86
86
  # Apply the full working-tree filter pipeline (combine with `batch_command:`)
87
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filters
87
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filters
88
88
  flag_option :filters
89
89
 
90
90
  # Map committer/author identities through mailmap for all batch modes
91
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---use-mailmap
91
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---use-mailmap
92
92
  flag_option :use_mailmap, negatable: true
93
93
 
94
94
  # Omit objects matching the filter spec from the output (batched modes only)
95
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filterltfilter-specgt
95
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filterltfilter-specgt
96
96
  value_option :filter, inline: true
97
97
 
98
98
  # Use NUL-delimited input/output instead of newline-delimited
99
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt--Z
99
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt--Z
100
100
  flag_option :Z
101
101
 
102
102
  # Stream stdout to this IO object instead of buffering in memory.
@@ -154,7 +154,7 @@ module Git
154
154
  # @option options [#write, nil] :out (nil) stream stdout to this IO object
155
155
  # instead of buffering in memory; when given, `result.stdout` will be `''`
156
156
  #
157
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
157
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
158
158
  #
159
159
  # Stdout contains the batch output stream (or `''` when `out:` is given)
160
160
  #
@@ -196,7 +196,7 @@ module Git
196
196
  # @option options [#write, nil] :out (nil) stream stdout to this IO object
197
197
  # instead of buffering in memory; when given, `result.stdout` will be `''`
198
198
  #
199
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
199
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
200
200
  #
201
201
  # Stdout contains one metadata line per object (or `''` when `out:` is given)
202
202
  #
@@ -236,7 +236,7 @@ module Git
236
236
  # @option options [#write, nil] :out (nil) stream stdout to this IO object
237
237
  # instead of buffering in memory; when given, `result.stdout` will be `''`
238
238
  #
239
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
239
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
240
240
  #
241
241
  # Stdout contains the interleaved command output (or `''` when `out:` is given)
242
242
  #
@@ -270,7 +270,7 @@ module Git
270
270
  # @option options [#write, nil] :out (nil) stream stdout to this IO object
271
271
  # instead of buffering in memory; when given, `result.stdout` will be `''`
272
272
  #
273
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
273
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
274
274
  #
275
275
  # Stdout contains the full batch output (or `''` when `out:` is given)
276
276
  #
@@ -307,7 +307,7 @@ module Git
307
307
  #
308
308
  # @option options [Numeric, nil] :timeout (nil) abort the command after this many seconds
309
309
  #
310
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
310
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
311
311
  #
312
312
  # Stdout contains one metadata line per object (or `''` when `out:` is given)
313
313
  #
@@ -332,7 +332,7 @@ module Git
332
332
  #
333
333
  # @param reader [IO] read end of the stdin pipe
334
334
  #
335
- # @return [Git::CommandLineResult]
335
+ # @return [Git::CommandLine::Result]
336
336
  #
337
337
  def run_batch(bound, reader)
338
338
  result = if bound.execution_options.key?(:out)
@@ -344,6 +344,14 @@ module Git
344
344
  result
345
345
  end
346
346
 
347
+ # Run the bound command using the streaming execution path
348
+ #
349
+ # @param bound [Git::Commands::Arguments::Bound] bound argument list
350
+ #
351
+ # @param reader [IO] read end of the stdin pipe
352
+ #
353
+ # @return [Git::CommandLine::Result] the command result
354
+ #
347
355
  def run_batch_streaming(bound, reader)
348
356
  @execution_context.command_streaming(
349
357
  *bound,
@@ -353,6 +361,14 @@ module Git
353
361
  )
354
362
  end
355
363
 
364
+ # Run the bound command using the capturing execution path
365
+ #
366
+ # @param bound [Git::Commands::Arguments::Bound] bound argument list
367
+ #
368
+ # @param reader [IO] read end of the stdin pipe
369
+ #
370
+ # @return [Git::CommandLine::Result] the command result
371
+ #
356
372
  def run_batch_capturing(bound, reader)
357
373
  @execution_context.command_capturing(
358
374
  *bound,
@@ -37,16 +37,16 @@ module Git
37
37
  literal 'cat-file'
38
38
 
39
39
  # Apply only the textconv filter (binary-to-text conversion)
40
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---textconv
40
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---textconv
41
41
  flag_option :textconv
42
42
 
43
43
  # Apply the full working-tree filter pipeline (smudge, EOL, textconv)
44
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filters
44
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---filters
45
45
  flag_option :filters
46
46
 
47
47
  # Specify the path separately when the rev is passed as a bare revision.
48
48
  # When used, the `rev` operand must be a plain revision (not `<rev>:<path>`).
49
- # @see https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---pathltpathgt
49
+ # See https://git-scm.com/docs/git-cat-file#Documentation/git-cat-file.txt---pathltpathgt
50
50
  value_option :path, inline: true
51
51
 
52
52
  end_of_options
@@ -56,9 +56,7 @@ module Git
56
56
  operand :rev, required: true
57
57
  end
58
58
 
59
- # @!method call(*, **)
60
- #
61
- # Execute `git cat-file --textconv` or `git cat-file --filters`.
59
+ # @!method call(*)
62
60
  #
63
61
  # @overload call(rev, textconv: true, **options)
64
62
  # Apply the textconv filter to a single object
@@ -70,15 +68,16 @@ module Git
70
68
  #
71
69
  # @param options [Hash] command options
72
70
  #
73
- # @option options [String] :path (nil) Path to the blob when `rev` is a bare revision
71
+ # @option options [String] :path (nil)
72
+ # path to the blob when `rev` is a bare revision
74
73
  #
75
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
74
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
76
75
  #
77
76
  # Stdout contains the textconv-processed content
78
77
  #
79
78
  # @raise [ArgumentError] if unsupported options are provided
80
79
  #
81
- # @raise [Git::FailedError] if the object does not exist or the path is missing
80
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
82
81
  #
83
82
  # @overload call(rev, filters: true, **options)
84
83
  # Apply the full working-tree filter pipeline to a single object
@@ -90,15 +89,16 @@ module Git
90
89
  #
91
90
  # @param options [Hash] command options
92
91
  #
93
- # @option options [String] :path (nil) Path to the blob when `rev` is a bare revision
92
+ # @option options [String] :path (nil)
93
+ # path to the blob when `rev` is a bare revision
94
94
  #
95
- # @return [Git::CommandLineResult] the result of calling `git cat-file`
95
+ # @return [Git::CommandLine::Result] the result of calling `git cat-file`
96
96
  #
97
97
  # Stdout contains the filter-processed content
98
98
  #
99
99
  # @raise [ArgumentError] if unsupported options are provided
100
100
  #
101
- # @raise [Git::FailedError] if the object does not exist or the path is missing
101
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
102
102
  end
103
103
  end
104
104
  end