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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (270) hide show
  1. checksums.yaml +4 -4
  2. data/.dockerignore +27 -0
  3. data/.github/copilot-instructions.md +3 -8
  4. data/.github/hooks/bin-setup-on-worktree.json +11 -0
  5. data/.github/hooks/run-bin-setup-once.sh +14 -0
  6. data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
  7. data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
  8. data/.github/skills/command-implementation/REFERENCE.md +34 -33
  9. data/.github/skills/command-implementation/SKILL.md +5 -4
  10. data/.github/skills/command-test-conventions/SKILL.md +13 -9
  11. data/.github/skills/command-yard-documentation/SKILL.md +14 -6
  12. data/.github/skills/development-workflow/SKILL.md +20 -14
  13. data/.github/skills/facade-implementation/REFERENCE.md +19 -22
  14. data/.github/skills/facade-implementation/SKILL.md +0 -5
  15. data/.github/skills/facade-test-conventions/SKILL.md +4 -7
  16. data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
  17. data/.github/skills/make-skill-template/SKILL.md +53 -3
  18. data/.github/skills/pr-readiness-review/SKILL.md +22 -2
  19. data/.github/skills/project-context/SKILL.md +16 -23
  20. data/.github/skills/pull-request-review/SKILL.md +2 -2
  21. data/.github/skills/rebase/SKILL.md +148 -0
  22. data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
  23. data/.github/skills/resolve-feedback/SKILL.md +288 -0
  24. data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
  25. data/.github/skills/reviewing-skills/SKILL.md +28 -3
  26. data/.github/skills/test-debugging/SKILL.md +20 -19
  27. data/.github/skills/yard-documentation/SKILL.md +671 -483
  28. data/.github/skills/yard-documentation/element-rules.md +162 -0
  29. data/.github/skills-deprecated/README.md +21 -0
  30. data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
  31. data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
  32. data/.github/workflows/continuous_integration.yml +3 -2
  33. data/.rubocop.yml +7 -39
  34. data/.yard-lint.yml +75 -0
  35. data/CONTRIBUTING.md +186 -174
  36. data/Gemfile +17 -0
  37. data/README.md +86 -23
  38. data/Rakefile +3 -21
  39. data/UPGRADING.md +219 -70
  40. data/docker/test/Dockerfile +32 -0
  41. data/docker/test/docker-compose.yml +0 -0
  42. data/git.gemspec +3 -4
  43. data/lib/git/author.rb +20 -1
  44. data/lib/git/branch.rb +26 -6
  45. data/lib/git/branch_delete_failure.rb +3 -0
  46. data/lib/git/branch_delete_result.rb +6 -3
  47. data/lib/git/branch_info.rb +6 -6
  48. data/lib/git/command_line/base.rb +6 -13
  49. data/lib/git/command_line/capturing.rb +67 -10
  50. data/lib/git/command_line/result.rb +0 -8
  51. data/lib/git/command_line/streaming.rb +45 -5
  52. data/lib/git/command_line.rb +4 -3
  53. data/lib/git/commands/add.rb +61 -53
  54. data/lib/git/commands/am/abort.rb +2 -2
  55. data/lib/git/commands/am/apply.rb +109 -98
  56. data/lib/git/commands/am/continue.rb +2 -2
  57. data/lib/git/commands/am/quit.rb +2 -2
  58. data/lib/git/commands/am/retry.rb +4 -2
  59. data/lib/git/commands/am/show_current_patch.rb +1 -1
  60. data/lib/git/commands/am/skip.rb +2 -2
  61. data/lib/git/commands/am.rb +2 -2
  62. data/lib/git/commands/apply.rb +7 -2
  63. data/lib/git/commands/archive/list_formats.rb +3 -3
  64. data/lib/git/commands/archive.rb +7 -2
  65. data/lib/git/commands/arguments.rb +1370 -359
  66. data/lib/git/commands/base.rb +111 -13
  67. data/lib/git/commands/branch/copy.rb +29 -21
  68. data/lib/git/commands/branch/create.rb +72 -68
  69. data/lib/git/commands/branch/delete.rb +25 -17
  70. data/lib/git/commands/branch/list.rb +76 -60
  71. data/lib/git/commands/branch/move.rb +29 -21
  72. data/lib/git/commands/branch/set_upstream.rb +8 -8
  73. data/lib/git/commands/branch/show_current.rb +3 -3
  74. data/lib/git/commands/branch/unset_upstream.rb +4 -8
  75. data/lib/git/commands/branch.rb +2 -2
  76. data/lib/git/commands/cat_file/batch.rb +36 -20
  77. data/lib/git/commands/cat_file/filtered.rb +12 -12
  78. data/lib/git/commands/cat_file/raw.rb +13 -13
  79. data/lib/git/commands/cat_file.rb +4 -4
  80. data/lib/git/commands/checkout/branch.rb +7 -5
  81. data/lib/git/commands/checkout/files.rb +5 -4
  82. data/lib/git/commands/checkout.rb +4 -4
  83. data/lib/git/commands/checkout_index.rb +5 -4
  84. data/lib/git/commands/clean.rb +6 -4
  85. data/lib/git/commands/clone.rb +5 -4
  86. data/lib/git/commands/commit.rb +5 -4
  87. data/lib/git/commands/commit_tree.rb +5 -4
  88. data/lib/git/commands/config_option_syntax/add.rb +7 -4
  89. data/lib/git/commands/config_option_syntax/get.rb +9 -5
  90. data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
  91. data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
  92. data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
  93. data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
  94. data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
  95. data/lib/git/commands/config_option_syntax/list.rb +8 -4
  96. data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
  97. data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
  98. data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
  99. data/lib/git/commands/config_option_syntax/set.rb +7 -2
  100. data/lib/git/commands/config_option_syntax/unset.rb +7 -4
  101. data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
  102. data/lib/git/commands/describe.rb +5 -4
  103. data/lib/git/commands/diff.rb +13 -12
  104. data/lib/git/commands/diff_files.rb +7 -6
  105. data/lib/git/commands/diff_index.rb +10 -7
  106. data/lib/git/commands/fetch.rb +6 -4
  107. data/lib/git/commands/fsck.rb +6 -4
  108. data/lib/git/commands/gc.rb +6 -4
  109. data/lib/git/commands/grep.rb +6 -5
  110. data/lib/git/commands/init.rb +6 -4
  111. data/lib/git/commands/log.rb +287 -285
  112. data/lib/git/commands/ls_files.rb +69 -65
  113. data/lib/git/commands/ls_remote.rb +62 -56
  114. data/lib/git/commands/ls_tree.rb +50 -46
  115. data/lib/git/commands/maintenance/register.rb +25 -23
  116. data/lib/git/commands/maintenance/run.rb +7 -2
  117. data/lib/git/commands/maintenance/start.rb +7 -2
  118. data/lib/git/commands/maintenance/stop.rb +7 -2
  119. data/lib/git/commands/maintenance/unregister.rb +7 -2
  120. data/lib/git/commands/merge/abort.rb +2 -2
  121. data/lib/git/commands/merge/continue.rb +2 -2
  122. data/lib/git/commands/merge/quit.rb +2 -2
  123. data/lib/git/commands/merge/start.rb +7 -2
  124. data/lib/git/commands/merge.rb +2 -2
  125. data/lib/git/commands/merge_base.rb +7 -2
  126. data/lib/git/commands/mv.rb +7 -2
  127. data/lib/git/commands/name_rev.rb +7 -2
  128. data/lib/git/commands/pull.rb +7 -2
  129. data/lib/git/commands/push.rb +7 -2
  130. data/lib/git/commands/read_tree.rb +7 -2
  131. data/lib/git/commands/remote/add.rb +7 -2
  132. data/lib/git/commands/remote/get_url.rb +4 -2
  133. data/lib/git/commands/remote/list.rb +4 -2
  134. data/lib/git/commands/remote/prune.rb +4 -2
  135. data/lib/git/commands/remote/remove.rb +4 -2
  136. data/lib/git/commands/remote/rename.rb +4 -2
  137. data/lib/git/commands/remote/set_branches.rb +9 -2
  138. data/lib/git/commands/remote/set_head.rb +12 -5
  139. data/lib/git/commands/remote/set_url.rb +9 -2
  140. data/lib/git/commands/remote/set_url_add.rb +11 -2
  141. data/lib/git/commands/remote/set_url_delete.rb +9 -2
  142. data/lib/git/commands/remote/show.rb +18 -12
  143. data/lib/git/commands/remote/update.rb +19 -12
  144. data/lib/git/commands/remote.rb +2 -2
  145. data/lib/git/commands/repack.rb +67 -63
  146. data/lib/git/commands/reset.rb +51 -44
  147. data/lib/git/commands/rev_parse.rb +135 -128
  148. data/lib/git/commands/revert/abort.rb +2 -2
  149. data/lib/git/commands/revert/continue.rb +7 -2
  150. data/lib/git/commands/revert/quit.rb +2 -2
  151. data/lib/git/commands/revert/skip.rb +2 -2
  152. data/lib/git/commands/revert/start.rb +7 -2
  153. data/lib/git/commands/revert.rb +2 -2
  154. data/lib/git/commands/rm.rb +35 -36
  155. data/lib/git/commands/show.rb +1 -1
  156. data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
  157. data/lib/git/commands/show_ref/exists.rb +15 -13
  158. data/lib/git/commands/show_ref/list.rb +39 -35
  159. data/lib/git/commands/show_ref/verify.rb +29 -27
  160. data/lib/git/commands/show_ref.rb +4 -4
  161. data/lib/git/commands/stash/apply.rb +31 -25
  162. data/lib/git/commands/stash/branch.rb +10 -8
  163. data/lib/git/commands/stash/clear.rb +7 -5
  164. data/lib/git/commands/stash/create.rb +10 -8
  165. data/lib/git/commands/stash/drop.rb +15 -9
  166. data/lib/git/commands/stash/list.rb +9 -5
  167. data/lib/git/commands/stash/pop.rb +21 -12
  168. data/lib/git/commands/stash/push.rb +20 -11
  169. data/lib/git/commands/stash/show.rb +21 -12
  170. data/lib/git/commands/stash/store.rb +19 -10
  171. data/lib/git/commands/stash.rb +2 -2
  172. data/lib/git/commands/status.rb +7 -2
  173. data/lib/git/commands/symbolic_ref/delete.rb +18 -14
  174. data/lib/git/commands/symbolic_ref/read.rb +24 -20
  175. data/lib/git/commands/symbolic_ref/update.rb +20 -17
  176. data/lib/git/commands/symbolic_ref.rb +4 -4
  177. data/lib/git/commands/tag/create.rb +45 -42
  178. data/lib/git/commands/tag/delete.rb +5 -3
  179. data/lib/git/commands/tag/list.rb +47 -44
  180. data/lib/git/commands/tag/verify.rb +12 -12
  181. data/lib/git/commands/tag.rb +2 -2
  182. data/lib/git/commands/update_ref/batch.rb +6 -1
  183. data/lib/git/commands/update_ref/delete.rb +19 -21
  184. data/lib/git/commands/update_ref/update.rb +22 -25
  185. data/lib/git/commands/update_ref.rb +4 -4
  186. data/lib/git/commands/version.rb +14 -11
  187. data/lib/git/commands/worktree/add.rb +50 -51
  188. data/lib/git/commands/worktree/list.rb +17 -17
  189. data/lib/git/commands/worktree/lock.rb +12 -12
  190. data/lib/git/commands/worktree/move.rb +16 -16
  191. data/lib/git/commands/worktree/prune.rb +2 -2
  192. data/lib/git/commands/worktree/remove.rb +2 -2
  193. data/lib/git/commands/worktree/repair.rb +2 -2
  194. data/lib/git/commands/worktree/unlock.rb +2 -2
  195. data/lib/git/commands/write_tree.rb +2 -2
  196. data/lib/git/commands.rb +4 -3
  197. data/lib/git/config.rb +47 -1
  198. data/lib/git/configuring.rb +89 -15
  199. data/lib/git/detached_head_info.rb +4 -1
  200. data/lib/git/diff.rb +2 -5
  201. data/lib/git/diff_file_numstat_info.rb +3 -1
  202. data/lib/git/diff_file_patch_info.rb +3 -1
  203. data/lib/git/diff_file_raw_info.rb +3 -1
  204. data/lib/git/diff_info.rb +8 -15
  205. data/lib/git/diff_path_status.rb +16 -3
  206. data/lib/git/diff_result.rb +3 -1
  207. data/lib/git/diff_stats.rb +15 -0
  208. data/lib/git/dirstat_info.rb +24 -8
  209. data/lib/git/encoding_utils.rb +32 -1
  210. data/lib/git/errors.rb +19 -9
  211. data/lib/git/escaped_path.rb +55 -3
  212. data/lib/git/execution_context/repository.rb +15 -0
  213. data/lib/git/execution_context.rb +76 -74
  214. data/lib/git/file_ref.rb +6 -3
  215. data/lib/git/fsck_object.rb +8 -0
  216. data/lib/git/fsck_result.rb +26 -15
  217. data/lib/git/log.rb +152 -5
  218. data/lib/git/object.rb +284 -8
  219. data/lib/git/parsers/branch.rb +18 -0
  220. data/lib/git/parsers/cat_file.rb +2 -2
  221. data/lib/git/parsers/diff.rb +213 -5
  222. data/lib/git/parsers/fsck.rb +11 -0
  223. data/lib/git/parsers/ls_remote.rb +1 -1
  224. data/lib/git/parsers/stash.rb +51 -0
  225. data/lib/git/parsers/tag.rb +38 -0
  226. data/lib/git/remote.rb +34 -2
  227. data/lib/git/repository/branching.rb +23 -21
  228. data/lib/git/repository/committing.rb +46 -6
  229. data/lib/git/repository/context_helpers.rb +45 -16
  230. data/lib/git/repository/diffing.rb +32 -23
  231. data/lib/git/repository/factories.rb +153 -28
  232. data/lib/git/repository/inspecting.rb +1 -1
  233. data/lib/git/repository/logging.rb +169 -30
  234. data/lib/git/repository/maintenance.rb +1 -1
  235. data/lib/git/repository/merging.rb +3 -3
  236. data/lib/git/repository/object_operations.rb +108 -14
  237. data/lib/git/repository/remote_operations.rb +150 -171
  238. data/lib/git/repository/shared_private.rb +7 -5
  239. data/lib/git/repository/staging.rb +36 -12
  240. data/lib/git/repository/stashing.rb +16 -16
  241. data/lib/git/repository/status_operations.rb +1 -1
  242. data/lib/git/repository/worktree_operations.rb +1 -1
  243. data/lib/git/repository.rb +287 -6
  244. data/lib/git/stash.rb +16 -21
  245. data/lib/git/stash_info.rb +4 -4
  246. data/lib/git/stashes.rb +20 -26
  247. data/lib/git/status.rb +25 -13
  248. data/lib/git/tag_delete_failure.rb +3 -0
  249. data/lib/git/tag_delete_result.rb +6 -3
  250. data/lib/git/tag_info.rb +1 -0
  251. data/lib/git/url.rb +12 -5
  252. data/lib/git/version.rb +6 -4
  253. data/lib/git/version_constraint.rb +4 -0
  254. data/lib/git.rb +400 -314
  255. data/redesign/3_architecture_implementation.md +81 -30
  256. data/redesign/Phase 4 - Step A.md +6 -0
  257. data/redesign/Phase 4 - Step B.md +921 -0
  258. data/redesign/Phase 4 - Step C.md +833 -0
  259. data/redesign/c1a-public-api-scope.tsv +256 -0
  260. data/redesign/phase-4-step-b-test-audit.tsv +485 -0
  261. data/tasks/yard.rake +24 -17
  262. metadata +24 -58
  263. data/commitlint.test +0 -4
  264. data/lib/git/args_builder.rb +0 -103
  265. data/lib/git/command_line_result.rb +0 -8
  266. data/lib/git/deprecation.rb +0 -9
  267. data/lib/git/repository/configuring.rb +0 -351
  268. data/tasks/test.rake +0 -25
  269. /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
  270. /data/.github/{skills → skills-deprecated}/review-backward-compatibility/SKILL.md +0 -0
@@ -73,119 +73,123 @@ module Git
73
73
  execution_option :chdir
74
74
  end
75
75
 
76
- # @!method call(*, **)
77
76
  #
78
- # @overload call(*file, **options)
77
+ # @overload call(*file, **options)
79
78
  #
80
- # Execute the `git ls-files` command.
79
+ # Execute the `git ls-files` command.
81
80
  #
82
- # @param file [Array<String>] paths to limit file listing
81
+ # @param file [Array<String>] paths to limit file listing
83
82
  #
84
- # @param options [Hash] command options
83
+ # @param options [Hash] command options
85
84
  #
86
- # @option options [Boolean, nil] :z (nil) use NUL line termination and do not quote filenames
85
+ # @option options [Boolean, nil] :z (nil) use NUL line termination and do not quote filenames
87
86
  #
88
- # @option options [Boolean, nil] :t (nil) show status tags together with filenames
87
+ # @option options [Boolean, nil] :t (nil) show status tags together with filenames
89
88
  #
90
- # @option options [Boolean, nil] :v (nil) similar to `-t` but use lowercase letters for files
91
- # that are marked as assume unchanged
89
+ # @option options [Boolean, nil] :v (nil) similar to `-t` but use lowercase letters for files
90
+ # that are marked as assume unchanged
92
91
  #
93
- # @option options [Boolean, nil] :f (nil) similar to `-t` but use lowercase letters for files
94
- # that are marked as fsmonitor valid
92
+ # @option options [Boolean, nil] :f (nil) similar to `-t` but use lowercase letters for files
93
+ # that are marked as fsmonitor valid
95
94
  #
96
- # @option options [Boolean, nil] :cached (nil) show all files cached in the index
95
+ # @option options [Boolean, nil] :cached (nil) show all files cached in the index
97
96
  #
98
- # Alias: :c
97
+ # Alias: :c
99
98
  #
100
- # @option options [Boolean, nil] :deleted (nil) show files with an unstaged deletion
99
+ # @option options [Boolean, nil] :deleted (nil) show files with an unstaged deletion
101
100
  #
102
- # Alias: :d
101
+ # Alias: :d
103
102
  #
104
- # @option options [Boolean, nil] :others (nil) show other (i.e. untracked) files in the output
103
+ # @option options [Boolean, nil] :others (nil) show other (i.e. untracked) files in the output
105
104
  #
106
- # Alias: :o
105
+ # Alias: :o
107
106
  #
108
- # @option options [Boolean, nil] :ignored (nil) show only ignored files in the output
107
+ # @option options [Boolean, nil] :ignored (nil) show only ignored files in the output
109
108
  #
110
- # Must be used with either `:cached` or `:others`. When used with `:cached`, shows only
111
- # cached files matching an exclude pattern. When used with `:others`, shows only
112
- # untracked files matched by an exclude pattern.
109
+ # Must be used with either `:cached` or `:others`. When used with `:cached`, shows only
110
+ # cached files matching an exclude pattern. When used with `:others`, shows only
111
+ # untracked files matched by an exclude pattern.
113
112
  #
114
- # Alias: :i
113
+ # Alias: :i
115
114
  #
116
- # @option options [Boolean, nil] :stage (nil) show object name, mode bits, and stage number
115
+ # @option options [Boolean, nil] :stage (nil) show object name, mode bits, and stage number
117
116
  #
118
- # Alias: :s
117
+ # Alias: :s
119
118
  #
120
- # @option options [Boolean, nil] :unmerged (nil) show information about unmerged files
119
+ # @option options [Boolean, nil] :unmerged (nil) show information about unmerged files
121
120
  #
122
- # Alias: :u
121
+ # Alias: :u
123
122
  #
124
- # @option options [Boolean, nil] :killed (nil) show untracked files that need to be removed
125
- # due to file/directory conflicts for tracked files
123
+ # @option options [Boolean, nil] :killed (nil) show untracked files that need to be removed
124
+ # due to file/directory conflicts for tracked files
126
125
  #
127
- # Alias: :k
126
+ # Alias: :k
128
127
  #
129
- # @option options [Boolean, nil] :modified (nil) show files with an unstaged modification
128
+ # @option options [Boolean, nil] :modified (nil) show files with an unstaged modification
130
129
  #
131
- # Alias: :m
130
+ # Alias: :m
132
131
  #
133
- # @option options [Boolean, nil] :resolve_undo (nil) show files having resolve-undo information
132
+ # @option options [Boolean, nil] :resolve_undo (nil) show files having resolve-undo information
134
133
  #
135
- # @option options [Boolean, nil] :directory (nil) show just the directory name (with trailing
136
- # slash) when a whole directory is classified as "other"
134
+ # @option options [Boolean, nil] :directory (nil) show just the directory name (with trailing
135
+ # slash) when a whole directory is classified as "other"
137
136
  #
138
- # @option options [Boolean, nil] :no_empty_directory (nil) do not list empty directories
137
+ # @option options [Boolean, nil] :no_empty_directory (nil) do not list empty directories
139
138
  #
140
- # @option options [Boolean, nil] :eol (nil) show EOL and encoding attributes of files
139
+ # @option options [Boolean, nil] :eol (nil) show EOL and encoding attributes of files
141
140
  #
142
- # @option options [Boolean, nil] :deduplicate (nil) suppress duplicate filenames when showing
143
- # only filenames
141
+ # @option options [Boolean, nil] :deduplicate (nil) suppress duplicate filenames when showing
142
+ # only filenames
144
143
  #
145
- # @option options [String] :exclude (nil) skip untracked files matching the given pattern
144
+ # @option options [String] :exclude (nil) skip untracked files matching the given pattern
146
145
  #
147
- # Alias: :x
146
+ # Alias: :x
148
147
  #
149
- # @option options [String] :exclude_from (nil) read exclude patterns from the given file
148
+ # @option options [String] :exclude_from (nil) read exclude patterns from the given file
150
149
  #
151
- # Alias: :X
150
+ # Alias: :X
152
151
  #
153
- # @option options [String] :exclude_per_directory (nil) read additional exclude patterns
154
- # from the named file in each directory
152
+ # @option options [String] :exclude_per_directory (nil) read additional exclude patterns
153
+ # from the named file in each directory
155
154
  #
156
- # @option options [Boolean, nil] :exclude_standard (nil) add the standard git exclusions
155
+ # @option options [Boolean, nil] :exclude_standard (nil) add the standard git exclusions
157
156
  #
158
- # @option options [Boolean, nil] :error_unmatch (nil) treat unmatched files as an error
157
+ # @option options [Boolean, nil] :error_unmatch (nil) treat unmatched files as an error
159
158
  #
160
- # @option options [String] :with_tree (nil) pretend paths removed since the named
161
- # tree-ish are still present when using `--error-unmatch`
159
+ # @option options [String] :with_tree (nil) pretend paths removed since the named
160
+ # tree-ish are still present when using `--error-unmatch`
162
161
  #
163
- # @option options [Boolean, nil] :full_name (nil) force paths to be output relative to the
164
- # project top-level directory
162
+ # @option options [Boolean, nil] :full_name (nil) force paths to be output relative to the
163
+ # project top-level directory
165
164
  #
166
- # @option options [Boolean, nil] :recurse_submodules (nil) recursively calls ls-files on each
167
- # active submodule in the repository
165
+ # @option options [Boolean, nil] :recurse_submodules (nil) recursively calls ls-files on each
166
+ # active submodule in the repository
168
167
  #
169
- # @option options [Boolean, Integer, String, nil] :abbrev (nil) show only a partial prefix of the
170
- # object name; pass `true` for the default number of hex digits, or an Integer or String
171
- # for a specific prefix length (e.g., `abbrev: 10` or `abbrev: "10"`)
168
+ # @option options [Boolean, Integer, String, nil] :abbrev (nil) show only a partial prefix of the
169
+ # object name; pass `true` for the default number of hex digits, or an Integer or String
170
+ # for a specific prefix length (e.g., `abbrev: 10` or `abbrev: "10"`)
172
171
  #
173
- # @option options [Boolean, nil] :debug (nil) after each filename, output raw index information
174
- # (ctime data, mtime data, dev, ino, uid, gid, size, flags, flagsx)
172
+ # @option options [Boolean, nil] :debug (nil) after each filename, output raw index information
173
+ # (ctime data, mtime data, dev, ino, uid, gid, size, flags, flagsx)
175
174
  #
176
- # @option options [Boolean, nil] :sparse (nil) if the index is sparse, show the sparse directory
177
- # entries rather than expanding to the contained files
175
+ # @option options [Boolean, nil] :sparse (nil) if the index is sparse, show the sparse directory
176
+ # entries rather than expanding to the contained files
178
177
  #
179
- # @option options [String] :format (nil) a string that interpolates %(fieldname) from
180
- # the index entry for each file
178
+ # @option options [String] :format (nil) a string that interpolates %(fieldname) from
179
+ # the index entry for each file
181
180
  #
182
- # @option options [String] :chdir (nil) run the command from the specified directory
181
+ # @option options [String] :chdir (nil) run the command from the specified directory
183
182
  #
184
- # @return [Git::CommandLineResult] the result of calling `git ls-files`
183
+ # @return [Git::CommandLine::Result] the result of calling `git ls-files`
185
184
  #
186
- # @raise [ArgumentError] if unsupported options are provided
185
+ # @raise [ArgumentError] if unsupported options are provided
187
186
  #
188
- # @raise [Git::FailedError] if git exits with a non-zero exit status
187
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
188
+ #
189
+ # @api public
190
+ def call(*, **)
191
+ super
192
+ end
189
193
  end
190
194
  end
191
195
  end
@@ -10,14 +10,6 @@ module Git
10
10
  # associated commit IDs. Can be used to detect changes in a remote
11
11
  # repository without cloning or fetching.
12
12
  #
13
- # @note `arguments` block audited against https://git-scm.com/docs/git-ls-remote/2.53.0
14
- #
15
- # @see https://git-scm.com/docs/git-ls-remote git-ls-remote documentation
16
- #
17
- # @see Git::Commands
18
- #
19
- # @api private
20
- #
21
13
  # @example List all refs in a remote
22
14
  # ls_remote = Git::Commands::LsRemote.new(execution_context)
23
15
  # ls_remote.call('origin')
@@ -38,6 +30,14 @@ module Git
38
30
  # ls_remote = Git::Commands::LsRemote.new(execution_context)
39
31
  # ls_remote.call('origin', 'HEAD', symref: true)
40
32
  #
33
+ # @note `arguments` block audited against https://git-scm.com/docs/git-ls-remote/2.53.0
34
+ #
35
+ # @see https://git-scm.com/docs/git-ls-remote git-ls-remote documentation
36
+ #
37
+ # @see Git::Commands
38
+ #
39
+ # @api private
40
+ #
41
41
  class LsRemote < Git::Commands::Base
42
42
  arguments do
43
43
  literal 'ls-remote'
@@ -71,85 +71,91 @@ module Git
71
71
  # Exit status 2 means no matching refs were found (used with --exit-code)
72
72
  allow_exit_status 0..2
73
73
 
74
- # @!method call(*, **)
75
74
  #
76
- # @overload call(repository = nil, *patterns, **options)
75
+ # @overload call(repository = nil, *patterns, **options)
76
+ #
77
+ # Execute the `git ls-remote` command
77
78
  #
78
- # Execute the `git ls-remote` command
79
+ # @param repository [String, nil] the remote name or URL to query
79
80
  #
80
- # @param repository [String, nil] The remote name or URL to query
81
+ # When nil, git uses the remote inferred from the current branch's
82
+ # tracking configuration, or "origin" if no tracking remote is set.
81
83
  #
82
- # When nil, git uses the remote inferred from the current branch's
83
- # tracking configuration, or "origin" if no tracking remote is set.
84
+ # @param patterns [Array<String>] one or more ref patterns to filter results
84
85
  #
85
- # @param patterns [Array<String>] One or more ref patterns to filter results
86
+ # When omitted, all references (after filtering via `--branches`, `--tags`,
87
+ # `--refs`) are shown. When specified, only refs matching one or more
88
+ # patterns are displayed.
86
89
  #
87
- # When omitted, all references (after filtering via `--branches`, `--tags`,
88
- # `--refs`) are shown. When specified, only refs matching one or more
89
- # patterns are displayed.
90
+ # @param options [Hash] command options
90
91
  #
91
- # @param options [Hash] command options
92
+ # @option options [Boolean, nil] :branches (nil) limit output to refs under `refs/heads/`
92
93
  #
93
- # @option options [Boolean, nil] :branches (nil) limit output to refs under `refs/heads/`
94
+ # Alias: :b
94
95
  #
95
- # Alias: :b
96
+ # @option options [Boolean, nil] :heads (nil) limit output to refs under `refs/heads/`
96
97
  #
97
- # @option options [Boolean, nil] :heads (nil) limit output to refs under `refs/heads/`
98
+ # Deprecated: use `:branches` instead. Kept for backward compatibility with
99
+ # older git versions where `--heads` is the only supported flag.
98
100
  #
99
- # Deprecated: use `:branches` instead. Kept for backward compatibility with
100
- # older git versions where `--heads` is the only supported flag.
101
+ # Alias: :h
101
102
  #
102
- # Alias: :h
103
+ # @option options [Boolean, nil] :tags (nil) limit output to refs under `refs/tags/`
103
104
  #
104
- # @option options [Boolean, nil] :tags (nil) limit output to refs under `refs/tags/`
105
+ # Alias: :t
105
106
  #
106
- # Alias: :t
107
+ # @option options [Boolean, nil] :refs (nil) exclude peeled tags and pseudorefs
108
+ # like `HEAD` from the output
107
109
  #
108
- # @option options [Boolean, nil] :refs (nil) exclude peeled tags and pseudorefs
109
- # like `HEAD` from the output
110
+ # @option options [String] :upload_pack (nil) full path to `git-upload-pack`
111
+ # on the remote host
110
112
  #
111
- # @option options [String] :upload_pack (nil) full path to `git-upload-pack`
112
- # on the remote host
113
+ # Useful when accessing repositories via SSH where the daemon does not
114
+ # use the PATH configured by the user.
113
115
  #
114
- # Useful when accessing repositories via SSH where the daemon does not
115
- # use the PATH configured by the user.
116
+ # @option options [Boolean, nil] :quiet (nil) do not print the remote URL to stderr
116
117
  #
117
- # @option options [Boolean, nil] :quiet (nil) do not print the remote URL to stderr
118
+ # Alias: :q
118
119
  #
119
- # Alias: :q
120
+ # @option options [Boolean, nil] :exit_code (nil) exit with status `2` when no
121
+ # matching refs are found in the remote repository
120
122
  #
121
- # @option options [Boolean, nil] :exit_code (nil) exit with status `2` when no
122
- # matching refs are found in the remote repository
123
+ # Without this option, the command exits `0` whenever it successfully
124
+ # communicates with the remote, even if no refs match.
123
125
  #
124
- # Without this option, the command exits `0` whenever it successfully
125
- # communicates with the remote, even if no refs match.
126
+ # @option options [Boolean, nil] :get_url (nil) expand and print the remote URL
127
+ # (respecting `url.<base>.insteadOf` config) and exit without contacting
128
+ # the remote
126
129
  #
127
- # @option options [Boolean, nil] :get_url (nil) expand and print the remote URL
128
- # (respecting `url.<base>.insteadOf` config) and exit without contacting
129
- # the remote
130
+ # @option options [String] :sort (nil) sort output by the given key
130
131
  #
131
- # @option options [String] :sort (nil) sort output by the given key
132
+ # Prefix `-` for descending order. Supports `"version:refname"` or
133
+ # `"v:refname"`. See `git for-each-ref` for sort key documentation.
132
134
  #
133
- # Prefix `-` for descending order. Supports `"version:refname"` or
134
- # `"v:refname"`. See `git for-each-ref` for sort key documentation.
135
+ # @option options [Boolean, nil] :symref (nil) show the underlying ref pointed to by
136
+ # symbolic refs
135
137
  #
136
- # @option options [Boolean, nil] :symref (nil) show the underlying ref pointed to by
137
- # symbolic refs
138
+ # The `upload-pack` protocol currently surfaces only the `HEAD` symref,
139
+ # so that is typically the only symref shown.
138
140
  #
139
- # The `upload-pack` protocol currently surfaces only the `HEAD` symref,
140
- # so that is typically the only symref shown.
141
+ # @option options [String, Array<String>] :server_option (nil) transmit a
142
+ # string to the server when communicating using protocol version 2
141
143
  #
142
- # @option options [String, Array<String>] :server_option (nil) transmit a
143
- # string to the server when communicating using protocol version 2
144
+ # The string must not contain NUL or LF characters. Repeatable by
145
+ # passing an Array. Alias: :o
144
146
  #
145
- # The string must not contain NUL or LF characters. Repeatable by
146
- # passing an Array. Alias: :o
147
+ # @option options [Numeric] :timeout (nil) execution timeout in seconds
147
148
  #
148
- # @option options [Numeric] :timeout (nil) execution timeout in seconds
149
+ # @return [Git::CommandLine::Result] the result of calling `git ls-remote`
149
150
  #
150
- # @return [Git::CommandLineResult] the result of calling `git ls-remote`
151
+ # @raise [ArgumentError] if unsupported options are provided
151
152
  #
152
- # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 2)
153
+ # @raise [Git::FailedError] if git exits outside the allowed range (exit code > 2)
154
+ #
155
+ # @api public
156
+ def call(*, **)
157
+ super
158
+ end
153
159
  end
154
160
  end
155
161
  end
@@ -10,12 +10,6 @@ module Git
10
10
  # name, and file name of each item. Supports recursive listing, output
11
11
  # format control, and path filtering.
12
12
  #
13
- # @note `arguments` block audited against https://git-scm.com/docs/git-ls-tree/2.53.0
14
- #
15
- # @see https://git-scm.com/docs/git-ls-tree git-ls-tree
16
- #
17
- # @api private
18
- #
19
13
  # @example List the top-level tree of HEAD
20
14
  # ls_tree = Git::Commands::LsTree.new(execution_context)
21
15
  # ls_tree.call('HEAD')
@@ -32,6 +26,12 @@ module Git
32
26
  # ls_tree = Git::Commands::LsTree.new(execution_context)
33
27
  # ls_tree.call('HEAD', 'lib/')
34
28
  #
29
+ # @note `arguments` block audited against https://git-scm.com/docs/git-ls-tree/2.53.0
30
+ #
31
+ # @see https://git-scm.com/docs/git-ls-tree git-ls-tree
32
+ #
33
+ # @api private
34
+ #
35
35
  class LsTree < Git::Commands::Base
36
36
  arguments do
37
37
  literal 'ls-tree'
@@ -57,75 +57,79 @@ module Git
57
57
  operand :path, repeatable: true
58
58
  end
59
59
 
60
- # @!method call(*, **)
61
60
  #
62
- # @overload call(tree_ish, *path, **options)
61
+ # @overload call(tree_ish, *path, **options)
62
+ #
63
+ # Execute the git ls-tree command
63
64
  #
64
- # Execute the git ls-tree command
65
+ # @param tree_ish [String] the tree object to list (SHA, branch name, tag, etc.)
65
66
  #
66
- # @param tree_ish [String] the tree object to list (SHA, branch name, tag, etc.)
67
+ # @param path [Array<String>] optional path(s) to restrict the listing
67
68
  #
68
- # @param path [Array<String>] optional path(s) to restrict the listing
69
+ # When given, only entries matching these paths are shown.
69
70
  #
70
- # When given, only entries matching these paths are shown.
71
+ # @param options [Hash] command options
71
72
  #
72
- # @param options [Hash] command options
73
+ # @option options [Boolean, nil] :d (nil) show only the named tree entry itself,
74
+ # not its children
73
75
  #
74
- # @option options [Boolean, nil] :d (nil) show only the named tree entry itself,
75
- # not its children
76
+ # @option options [Boolean, nil] :r (nil) recurse into sub-trees
76
77
  #
77
- # @option options [Boolean, nil] :r (nil) recurse into sub-trees
78
+ # @option options [Boolean, nil] :t (nil) show tree entries even when going to
79
+ # recurse them
78
80
  #
79
- # @option options [Boolean, nil] :t (nil) show tree entries even when going to
80
- # recurse them
81
+ # Implies recursive listing (`:r`) in git.
81
82
  #
82
- # Implies recursive listing (`:r`) in git.
83
+ # @option options [Boolean, nil] :long (nil) show object size of blob (file)
84
+ # objects
83
85
  #
84
- # @option options [Boolean, nil] :long (nil) show object size of blob (file)
85
- # objects
86
+ # Cannot be combined with `:name_only` or `:object_only`.
86
87
  #
87
- # Cannot be combined with `:name_only` or `:object_only`.
88
+ # Alias: :l
88
89
  #
89
- # Alias: :l
90
+ # @option options [Boolean, nil] :z (nil) use NUL (`\0`) as line terminator
91
+ # instead of newline, and do not quote filenames
90
92
  #
91
- # @option options [Boolean, nil] :z (nil) use NUL (`\0`) as line terminator
92
- # instead of newline, and do not quote filenames
93
+ # @option options [Boolean, nil] :name_only (nil) list only filenames, one per
94
+ # line
93
95
  #
94
- # @option options [Boolean, nil] :name_only (nil) list only filenames, one per
95
- # line
96
+ # Cannot be combined with `:object_only` or `:long`.
96
97
  #
97
- # Cannot be combined with `:object_only` or `:long`.
98
+ # Alias: :name_status
98
99
  #
99
- # Alias: :name_status
100
+ # @option options [Boolean, nil] :object_only (nil) list only the object names
101
+ # (SHAs), one per line
100
102
  #
101
- # @option options [Boolean, nil] :object_only (nil) list only the object names
102
- # (SHAs), one per line
103
+ # Cannot be combined with `:name_only` or `:long`.
103
104
  #
104
- # Cannot be combined with `:name_only` or `:long`.
105
+ # @option options [Boolean, nil] :full_name (nil) show full path names instead
106
+ # of paths relative to the current working directory
105
107
  #
106
- # @option options [Boolean, nil] :full_name (nil) show full path names instead
107
- # of paths relative to the current working directory
108
+ # @option options [Boolean, nil] :full_tree (nil) do not limit the listing to
109
+ # the current working directory; implies `:full_name`
108
110
  #
109
- # @option options [Boolean, nil] :full_tree (nil) do not limit the listing to
110
- # the current working directory; implies `:full_name`
111
+ # @option options [Boolean, String, nil] :abbrev (nil) use abbreviated object names
111
112
  #
112
- # @option options [Boolean, String, nil] :abbrev (nil) use abbreviated object names
113
+ # When `true`, uses git's default abbreviated name length. When a string
114
+ # (e.g. `'8'`), uses exactly that many hex digits.
113
115
  #
114
- # When `true`, uses git's default abbreviated name length. When a string
115
- # (e.g. `'8'`), uses exactly that many hex digits.
116
+ # @option options [String] :format (nil) a format string that interpolates
117
+ # `%(fieldname)` placeholders from tree entries
116
118
  #
117
- # @option options [String] :format (nil) a format string that interpolates
118
- # `%(fieldname)` placeholders from tree entries
119
+ # Cannot be combined with `:long`, `:name_only`, or `:object_only`.
119
120
  #
120
- # Cannot be combined with `:long`, `:name_only`, or `:object_only`.
121
+ # @return [Git::CommandLine::Result] the result of calling `git ls-tree`
121
122
  #
122
- # @return [Git::CommandLineResult] the result of calling `git ls-tree`
123
+ # @raise [ArgumentError] if unsupported options are provided
123
124
  #
124
- # @raise [ArgumentError] if unsupported options are provided
125
+ # @raise [ArgumentError] if the tree-ish operand is missing
125
126
  #
126
- # @raise [ArgumentError] if the tree-ish operand is missing
127
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
127
128
  #
128
- # @raise [Git::FailedError] if git exits with a non-zero exit status
129
+ # @api public
130
+ def call(*, **)
131
+ super
132
+ end
129
133
  end
130
134
  end
131
135
  end
@@ -32,43 +32,45 @@ module Git
32
32
  execution_option :env
33
33
  end
34
34
 
35
- # @!method call(*, **)
36
35
  #
37
- # @overload call(**options)
36
+ # @overload call(**options)
38
37
  #
39
- # Initialize config values so scheduled maintenance will start running
38
+ # Initialize config values so scheduled maintenance will start running
40
39
  #
41
- # This adds the repository to the `maintenance.repo` config variable
42
- # in the current user's global config (or the specified config file)
43
- # and enables recommended configuration values for
44
- # `maintenance.<task>.schedule`.
40
+ # This adds the repository to the `maintenance.repo` config variable
41
+ # in the current user's global config (or the specified config file)
42
+ # and enables recommended configuration values for
43
+ # `maintenance.<task>.schedule`.
45
44
  #
46
- # Also sets `maintenance.strategy` to 'incremental' if not previously set,
47
- # and disables foreground maintenance by setting `maintenance.auto = false`
48
- # in the current repository.
45
+ # Also sets `maintenance.strategy` to 'incremental' if not previously set,
46
+ # and disables foreground maintenance by setting `maintenance.auto = false`
47
+ # in the current repository.
49
48
  #
50
- # @param options [Hash] command options
49
+ # @param options [Hash] command options
51
50
  #
52
- # @option options [Boolean, String, nil] :config_file (nil) use a specified
53
- # config file instead of the global config (`--config-file`)
51
+ # @option options [Boolean, String, nil] :config_file (nil) use a specified
52
+ # config file instead of the global config (`--config-file`)
54
53
  #
55
- # When a String, the path is passed as `--config-file <file>`.
54
+ # When a String, the path is passed as `--config-file <file>`.
56
55
  #
57
- # @option options [Boolean, nil] :no_config_file (nil) disable the config file
58
- # (`--no-config-file`)
56
+ # @option options [Boolean, nil] :no_config_file (nil) disable the config file
57
+ # (`--no-config-file`)
59
58
  #
60
- # @option options [Hash] :env (nil) environment variables to set for the git
61
- # process; merged with the default environment; not passed to the git CLI
59
+ # @option options [Hash] :env (nil) environment variables to set for the git
60
+ # process; merged with the default environment; not passed to the git CLI
62
61
  #
63
- # @return [Git::CommandLineResult] the result of calling `git maintenance register`
62
+ # @return [Git::CommandLine::Result] the result of calling `git maintenance register`
64
63
  #
65
- # @raise [ArgumentError] if unsupported options are provided
64
+ # @raise [ArgumentError] if unsupported options are provided
66
65
  #
67
- # @raise [Git::FailedError] if git exits with a non-zero exit status
66
+ # @raise [Git::FailedError] if git exits with a non-zero exit status
68
67
  #
69
- # @raise [Git::VersionError] if git version is below 2.30.0
68
+ # @raise [Git::VersionError] if git version is below 2.30.0
70
69
  #
71
- # @api public
70
+ # @api public
71
+ def call(*, **)
72
+ super
73
+ end
72
74
  end
73
75
  end
74
76
  end
@@ -43,7 +43,12 @@ module Git
43
43
  execution_option :env
44
44
  end
45
45
 
46
- # @!method call(*, **)
46
+ # @!method call(*, **options)
47
+ #
48
+ # @param options [Hash] command options
49
+ #
50
+ # @option options [Boolean, nil] :auto (nil) command option key; see overload docs
51
+ # for the full option list
47
52
  #
48
53
  # @overload call(**options)
49
54
  #
@@ -89,7 +94,7 @@ module Git
89
94
  # @option options [Hash] :env (nil) environment variables to set for the git
90
95
  # process; merged with the default environment; not passed to the git CLI
91
96
  #
92
- # @return [Git::CommandLineResult] the result of calling `git maintenance run`
97
+ # @return [Git::CommandLine::Result] the result of calling `git maintenance run`
93
98
  #
94
99
  # @raise [ArgumentError] if unsupported options are provided
95
100
  #
@@ -32,7 +32,12 @@ module Git
32
32
  execution_option :env
33
33
  end
34
34
 
35
- # @!method call(*, **)
35
+ # @!method call(*, **options)
36
+ #
37
+ # @param options [Hash] command options
38
+ #
39
+ # @option options [String] :scheduler (nil) command option key; see overload docs
40
+ # for the full option list
36
41
  #
37
42
  # @overload call(**options)
38
43
  #
@@ -53,7 +58,7 @@ module Git
53
58
  # @option options [Hash] :env (nil) environment variables to set for the git
54
59
  # process; merged with the default environment; not passed to the git CLI
55
60
  #
56
- # @return [Git::CommandLineResult] the result of calling `git maintenance start`
61
+ # @return [Git::CommandLine::Result] the result of calling `git maintenance start`
57
62
  #
58
63
  # @raise [ArgumentError] if unsupported options are provided
59
64
  #