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.
- checksums.yaml +4 -4
- data/.dockerignore +27 -0
- data/.github/copilot-instructions.md +3 -8
- data/.github/hooks/bin-setup-on-worktree.json +11 -0
- data/.github/hooks/run-bin-setup-once.sh +14 -0
- data/.github/skills/breaking-change-analysis/SKILL.md +6 -9
- data/.github/skills/ci-cd-troubleshooting/SKILL.md +2 -2
- data/.github/skills/command-implementation/REFERENCE.md +34 -33
- data/.github/skills/command-implementation/SKILL.md +5 -4
- data/.github/skills/command-test-conventions/SKILL.md +13 -9
- data/.github/skills/command-yard-documentation/SKILL.md +14 -6
- data/.github/skills/development-workflow/SKILL.md +20 -14
- data/.github/skills/facade-implementation/REFERENCE.md +19 -22
- data/.github/skills/facade-implementation/SKILL.md +0 -5
- data/.github/skills/facade-test-conventions/SKILL.md +4 -7
- data/.github/skills/facade-yard-documentation/SKILL.md +8 -2
- data/.github/skills/make-skill-template/SKILL.md +53 -3
- data/.github/skills/pr-readiness-review/SKILL.md +22 -2
- data/.github/skills/project-context/SKILL.md +16 -23
- data/.github/skills/pull-request-review/SKILL.md +2 -2
- data/.github/skills/rebase/SKILL.md +148 -0
- data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +1 -1
- data/.github/skills/resolve-feedback/SKILL.md +288 -0
- data/.github/skills/review-arguments-dsl/CHECKLIST.md +3 -3
- data/.github/skills/reviewing-skills/SKILL.md +28 -3
- data/.github/skills/test-debugging/SKILL.md +20 -19
- data/.github/skills/yard-documentation/SKILL.md +671 -483
- data/.github/skills/yard-documentation/element-rules.md +162 -0
- data/.github/skills-deprecated/README.md +21 -0
- data/.github/{skills → skills-deprecated}/extract-command-from-lib/SKILL.md +9 -9
- data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/SKILL.md +12 -12
- data/.github/workflows/continuous_integration.yml +3 -2
- data/.rubocop.yml +7 -39
- data/.yard-lint.yml +75 -0
- data/CONTRIBUTING.md +186 -174
- data/Gemfile +17 -0
- data/README.md +86 -23
- data/Rakefile +3 -21
- data/UPGRADING.md +219 -70
- data/docker/test/Dockerfile +32 -0
- data/docker/test/docker-compose.yml +0 -0
- data/git.gemspec +3 -4
- data/lib/git/author.rb +20 -1
- data/lib/git/branch.rb +26 -6
- data/lib/git/branch_delete_failure.rb +3 -0
- data/lib/git/branch_delete_result.rb +6 -3
- data/lib/git/branch_info.rb +6 -6
- data/lib/git/command_line/base.rb +6 -13
- data/lib/git/command_line/capturing.rb +67 -10
- data/lib/git/command_line/result.rb +0 -8
- data/lib/git/command_line/streaming.rb +45 -5
- data/lib/git/command_line.rb +4 -3
- data/lib/git/commands/add.rb +61 -53
- data/lib/git/commands/am/abort.rb +2 -2
- data/lib/git/commands/am/apply.rb +109 -98
- data/lib/git/commands/am/continue.rb +2 -2
- data/lib/git/commands/am/quit.rb +2 -2
- data/lib/git/commands/am/retry.rb +4 -2
- data/lib/git/commands/am/show_current_patch.rb +1 -1
- data/lib/git/commands/am/skip.rb +2 -2
- data/lib/git/commands/am.rb +2 -2
- data/lib/git/commands/apply.rb +7 -2
- data/lib/git/commands/archive/list_formats.rb +3 -3
- data/lib/git/commands/archive.rb +7 -2
- data/lib/git/commands/arguments.rb +1370 -359
- data/lib/git/commands/base.rb +111 -13
- data/lib/git/commands/branch/copy.rb +29 -21
- data/lib/git/commands/branch/create.rb +72 -68
- data/lib/git/commands/branch/delete.rb +25 -17
- data/lib/git/commands/branch/list.rb +76 -60
- data/lib/git/commands/branch/move.rb +29 -21
- data/lib/git/commands/branch/set_upstream.rb +8 -8
- data/lib/git/commands/branch/show_current.rb +3 -3
- data/lib/git/commands/branch/unset_upstream.rb +4 -8
- data/lib/git/commands/branch.rb +2 -2
- data/lib/git/commands/cat_file/batch.rb +36 -20
- data/lib/git/commands/cat_file/filtered.rb +12 -12
- data/lib/git/commands/cat_file/raw.rb +13 -13
- data/lib/git/commands/cat_file.rb +4 -4
- data/lib/git/commands/checkout/branch.rb +7 -5
- data/lib/git/commands/checkout/files.rb +5 -4
- data/lib/git/commands/checkout.rb +4 -4
- data/lib/git/commands/checkout_index.rb +5 -4
- data/lib/git/commands/clean.rb +6 -4
- data/lib/git/commands/clone.rb +5 -4
- data/lib/git/commands/commit.rb +5 -4
- data/lib/git/commands/commit_tree.rb +5 -4
- data/lib/git/commands/config_option_syntax/add.rb +7 -4
- data/lib/git/commands/config_option_syntax/get.rb +9 -5
- data/lib/git/commands/config_option_syntax/get_all.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_color.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_color_bool.rb +7 -4
- data/lib/git/commands/config_option_syntax/get_regexp.rb +8 -4
- data/lib/git/commands/config_option_syntax/get_urlmatch.rb +8 -4
- data/lib/git/commands/config_option_syntax/list.rb +8 -4
- data/lib/git/commands/config_option_syntax/remove_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/rename_section.rb +7 -2
- data/lib/git/commands/config_option_syntax/replace_all.rb +7 -2
- data/lib/git/commands/config_option_syntax/set.rb +7 -2
- data/lib/git/commands/config_option_syntax/unset.rb +7 -4
- data/lib/git/commands/config_option_syntax/unset_all.rb +7 -2
- data/lib/git/commands/describe.rb +5 -4
- data/lib/git/commands/diff.rb +13 -12
- data/lib/git/commands/diff_files.rb +7 -6
- data/lib/git/commands/diff_index.rb +10 -7
- data/lib/git/commands/fetch.rb +6 -4
- data/lib/git/commands/fsck.rb +6 -4
- data/lib/git/commands/gc.rb +6 -4
- data/lib/git/commands/grep.rb +6 -5
- data/lib/git/commands/init.rb +6 -4
- data/lib/git/commands/log.rb +287 -285
- data/lib/git/commands/ls_files.rb +69 -65
- data/lib/git/commands/ls_remote.rb +62 -56
- data/lib/git/commands/ls_tree.rb +50 -46
- data/lib/git/commands/maintenance/register.rb +25 -23
- data/lib/git/commands/maintenance/run.rb +7 -2
- data/lib/git/commands/maintenance/start.rb +7 -2
- data/lib/git/commands/maintenance/stop.rb +7 -2
- data/lib/git/commands/maintenance/unregister.rb +7 -2
- data/lib/git/commands/merge/abort.rb +2 -2
- data/lib/git/commands/merge/continue.rb +2 -2
- data/lib/git/commands/merge/quit.rb +2 -2
- data/lib/git/commands/merge/start.rb +7 -2
- data/lib/git/commands/merge.rb +2 -2
- data/lib/git/commands/merge_base.rb +7 -2
- data/lib/git/commands/mv.rb +7 -2
- data/lib/git/commands/name_rev.rb +7 -2
- data/lib/git/commands/pull.rb +7 -2
- data/lib/git/commands/push.rb +7 -2
- data/lib/git/commands/read_tree.rb +7 -2
- data/lib/git/commands/remote/add.rb +7 -2
- data/lib/git/commands/remote/get_url.rb +4 -2
- data/lib/git/commands/remote/list.rb +4 -2
- data/lib/git/commands/remote/prune.rb +4 -2
- data/lib/git/commands/remote/remove.rb +4 -2
- data/lib/git/commands/remote/rename.rb +4 -2
- data/lib/git/commands/remote/set_branches.rb +9 -2
- data/lib/git/commands/remote/set_head.rb +12 -5
- data/lib/git/commands/remote/set_url.rb +9 -2
- data/lib/git/commands/remote/set_url_add.rb +11 -2
- data/lib/git/commands/remote/set_url_delete.rb +9 -2
- data/lib/git/commands/remote/show.rb +18 -12
- data/lib/git/commands/remote/update.rb +19 -12
- data/lib/git/commands/remote.rb +2 -2
- data/lib/git/commands/repack.rb +67 -63
- data/lib/git/commands/reset.rb +51 -44
- data/lib/git/commands/rev_parse.rb +135 -128
- data/lib/git/commands/revert/abort.rb +2 -2
- data/lib/git/commands/revert/continue.rb +7 -2
- data/lib/git/commands/revert/quit.rb +2 -2
- data/lib/git/commands/revert/skip.rb +2 -2
- data/lib/git/commands/revert/start.rb +7 -2
- data/lib/git/commands/revert.rb +2 -2
- data/lib/git/commands/rm.rb +35 -36
- data/lib/git/commands/show.rb +1 -1
- data/lib/git/commands/show_ref/exclude_existing.rb +3 -4
- data/lib/git/commands/show_ref/exists.rb +15 -13
- data/lib/git/commands/show_ref/list.rb +39 -35
- data/lib/git/commands/show_ref/verify.rb +29 -27
- data/lib/git/commands/show_ref.rb +4 -4
- data/lib/git/commands/stash/apply.rb +31 -25
- data/lib/git/commands/stash/branch.rb +10 -8
- data/lib/git/commands/stash/clear.rb +7 -5
- data/lib/git/commands/stash/create.rb +10 -8
- data/lib/git/commands/stash/drop.rb +15 -9
- data/lib/git/commands/stash/list.rb +9 -5
- data/lib/git/commands/stash/pop.rb +21 -12
- data/lib/git/commands/stash/push.rb +20 -11
- data/lib/git/commands/stash/show.rb +21 -12
- data/lib/git/commands/stash/store.rb +19 -10
- data/lib/git/commands/stash.rb +2 -2
- data/lib/git/commands/status.rb +7 -2
- data/lib/git/commands/symbolic_ref/delete.rb +18 -14
- data/lib/git/commands/symbolic_ref/read.rb +24 -20
- data/lib/git/commands/symbolic_ref/update.rb +20 -17
- data/lib/git/commands/symbolic_ref.rb +4 -4
- data/lib/git/commands/tag/create.rb +45 -42
- data/lib/git/commands/tag/delete.rb +5 -3
- data/lib/git/commands/tag/list.rb +47 -44
- data/lib/git/commands/tag/verify.rb +12 -12
- data/lib/git/commands/tag.rb +2 -2
- data/lib/git/commands/update_ref/batch.rb +6 -1
- data/lib/git/commands/update_ref/delete.rb +19 -21
- data/lib/git/commands/update_ref/update.rb +22 -25
- data/lib/git/commands/update_ref.rb +4 -4
- data/lib/git/commands/version.rb +14 -11
- data/lib/git/commands/worktree/add.rb +50 -51
- data/lib/git/commands/worktree/list.rb +17 -17
- data/lib/git/commands/worktree/lock.rb +12 -12
- data/lib/git/commands/worktree/move.rb +16 -16
- data/lib/git/commands/worktree/prune.rb +2 -2
- data/lib/git/commands/worktree/remove.rb +2 -2
- data/lib/git/commands/worktree/repair.rb +2 -2
- data/lib/git/commands/worktree/unlock.rb +2 -2
- data/lib/git/commands/write_tree.rb +2 -2
- data/lib/git/commands.rb +4 -3
- data/lib/git/config.rb +47 -1
- data/lib/git/configuring.rb +89 -15
- data/lib/git/detached_head_info.rb +4 -1
- data/lib/git/diff.rb +2 -5
- data/lib/git/diff_file_numstat_info.rb +3 -1
- data/lib/git/diff_file_patch_info.rb +3 -1
- data/lib/git/diff_file_raw_info.rb +3 -1
- data/lib/git/diff_info.rb +8 -15
- data/lib/git/diff_path_status.rb +16 -3
- data/lib/git/diff_result.rb +3 -1
- data/lib/git/diff_stats.rb +15 -0
- data/lib/git/dirstat_info.rb +24 -8
- data/lib/git/encoding_utils.rb +32 -1
- data/lib/git/errors.rb +19 -9
- data/lib/git/escaped_path.rb +55 -3
- data/lib/git/execution_context/repository.rb +15 -0
- data/lib/git/execution_context.rb +76 -74
- data/lib/git/file_ref.rb +6 -3
- data/lib/git/fsck_object.rb +8 -0
- data/lib/git/fsck_result.rb +26 -15
- data/lib/git/log.rb +152 -5
- data/lib/git/object.rb +284 -8
- data/lib/git/parsers/branch.rb +18 -0
- data/lib/git/parsers/cat_file.rb +2 -2
- data/lib/git/parsers/diff.rb +213 -5
- data/lib/git/parsers/fsck.rb +11 -0
- data/lib/git/parsers/ls_remote.rb +1 -1
- data/lib/git/parsers/stash.rb +51 -0
- data/lib/git/parsers/tag.rb +38 -0
- data/lib/git/remote.rb +34 -2
- data/lib/git/repository/branching.rb +23 -21
- data/lib/git/repository/committing.rb +46 -6
- data/lib/git/repository/context_helpers.rb +45 -16
- data/lib/git/repository/diffing.rb +32 -23
- data/lib/git/repository/factories.rb +153 -28
- data/lib/git/repository/inspecting.rb +1 -1
- data/lib/git/repository/logging.rb +169 -30
- data/lib/git/repository/maintenance.rb +1 -1
- data/lib/git/repository/merging.rb +3 -3
- data/lib/git/repository/object_operations.rb +108 -14
- data/lib/git/repository/remote_operations.rb +150 -171
- data/lib/git/repository/shared_private.rb +7 -5
- data/lib/git/repository/staging.rb +36 -12
- data/lib/git/repository/stashing.rb +16 -16
- data/lib/git/repository/status_operations.rb +1 -1
- data/lib/git/repository/worktree_operations.rb +1 -1
- data/lib/git/repository.rb +287 -6
- data/lib/git/stash.rb +16 -21
- data/lib/git/stash_info.rb +4 -4
- data/lib/git/stashes.rb +20 -26
- data/lib/git/status.rb +25 -13
- data/lib/git/tag_delete_failure.rb +3 -0
- data/lib/git/tag_delete_result.rb +6 -3
- data/lib/git/tag_info.rb +1 -0
- data/lib/git/url.rb +12 -5
- data/lib/git/version.rb +6 -4
- data/lib/git/version_constraint.rb +4 -0
- data/lib/git.rb +400 -314
- data/redesign/3_architecture_implementation.md +81 -30
- data/redesign/Phase 4 - Step A.md +6 -0
- data/redesign/Phase 4 - Step B.md +921 -0
- data/redesign/Phase 4 - Step C.md +833 -0
- data/redesign/c1a-public-api-scope.tsv +256 -0
- data/redesign/phase-4-step-b-test-audit.tsv +485 -0
- data/tasks/yard.rake +24 -17
- metadata +24 -58
- data/commitlint.test +0 -4
- data/lib/git/args_builder.rb +0 -103
- data/lib/git/command_line_result.rb +0 -8
- data/lib/git/deprecation.rb +0 -9
- data/lib/git/repository/configuring.rb +0 -351
- data/tasks/test.rake +0 -25
- /data/.github/{skills → skills-deprecated}/extract-facade-from-base-lib/KEYWORD_ARG_REMEDIATION.md +0 -0
- /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
|
-
#
|
|
77
|
+
# @overload call(*file, **options)
|
|
79
78
|
#
|
|
80
|
-
#
|
|
79
|
+
# Execute the `git ls-files` command.
|
|
81
80
|
#
|
|
82
|
-
#
|
|
81
|
+
# @param file [Array<String>] paths to limit file listing
|
|
83
82
|
#
|
|
84
|
-
#
|
|
83
|
+
# @param options [Hash] command options
|
|
85
84
|
#
|
|
86
|
-
#
|
|
85
|
+
# @option options [Boolean, nil] :z (nil) use NUL line termination and do not quote filenames
|
|
87
86
|
#
|
|
88
|
-
#
|
|
87
|
+
# @option options [Boolean, nil] :t (nil) show status tags together with filenames
|
|
89
88
|
#
|
|
90
|
-
#
|
|
91
|
-
#
|
|
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
|
-
#
|
|
94
|
-
#
|
|
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
|
-
#
|
|
95
|
+
# @option options [Boolean, nil] :cached (nil) show all files cached in the index
|
|
97
96
|
#
|
|
98
|
-
#
|
|
97
|
+
# Alias: :c
|
|
99
98
|
#
|
|
100
|
-
#
|
|
99
|
+
# @option options [Boolean, nil] :deleted (nil) show files with an unstaged deletion
|
|
101
100
|
#
|
|
102
|
-
#
|
|
101
|
+
# Alias: :d
|
|
103
102
|
#
|
|
104
|
-
#
|
|
103
|
+
# @option options [Boolean, nil] :others (nil) show other (i.e. untracked) files in the output
|
|
105
104
|
#
|
|
106
|
-
#
|
|
105
|
+
# Alias: :o
|
|
107
106
|
#
|
|
108
|
-
#
|
|
107
|
+
# @option options [Boolean, nil] :ignored (nil) show only ignored files in the output
|
|
109
108
|
#
|
|
110
|
-
#
|
|
111
|
-
#
|
|
112
|
-
#
|
|
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
|
-
#
|
|
113
|
+
# Alias: :i
|
|
115
114
|
#
|
|
116
|
-
#
|
|
115
|
+
# @option options [Boolean, nil] :stage (nil) show object name, mode bits, and stage number
|
|
117
116
|
#
|
|
118
|
-
#
|
|
117
|
+
# Alias: :s
|
|
119
118
|
#
|
|
120
|
-
#
|
|
119
|
+
# @option options [Boolean, nil] :unmerged (nil) show information about unmerged files
|
|
121
120
|
#
|
|
122
|
-
#
|
|
121
|
+
# Alias: :u
|
|
123
122
|
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
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
|
-
#
|
|
126
|
+
# Alias: :k
|
|
128
127
|
#
|
|
129
|
-
#
|
|
128
|
+
# @option options [Boolean, nil] :modified (nil) show files with an unstaged modification
|
|
130
129
|
#
|
|
131
|
-
#
|
|
130
|
+
# Alias: :m
|
|
132
131
|
#
|
|
133
|
-
#
|
|
132
|
+
# @option options [Boolean, nil] :resolve_undo (nil) show files having resolve-undo information
|
|
134
133
|
#
|
|
135
|
-
#
|
|
136
|
-
#
|
|
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
|
-
#
|
|
137
|
+
# @option options [Boolean, nil] :no_empty_directory (nil) do not list empty directories
|
|
139
138
|
#
|
|
140
|
-
#
|
|
139
|
+
# @option options [Boolean, nil] :eol (nil) show EOL and encoding attributes of files
|
|
141
140
|
#
|
|
142
|
-
#
|
|
143
|
-
#
|
|
141
|
+
# @option options [Boolean, nil] :deduplicate (nil) suppress duplicate filenames when showing
|
|
142
|
+
# only filenames
|
|
144
143
|
#
|
|
145
|
-
#
|
|
144
|
+
# @option options [String] :exclude (nil) skip untracked files matching the given pattern
|
|
146
145
|
#
|
|
147
|
-
#
|
|
146
|
+
# Alias: :x
|
|
148
147
|
#
|
|
149
|
-
#
|
|
148
|
+
# @option options [String] :exclude_from (nil) read exclude patterns from the given file
|
|
150
149
|
#
|
|
151
|
-
#
|
|
150
|
+
# Alias: :X
|
|
152
151
|
#
|
|
153
|
-
#
|
|
154
|
-
#
|
|
152
|
+
# @option options [String] :exclude_per_directory (nil) read additional exclude patterns
|
|
153
|
+
# from the named file in each directory
|
|
155
154
|
#
|
|
156
|
-
#
|
|
155
|
+
# @option options [Boolean, nil] :exclude_standard (nil) add the standard git exclusions
|
|
157
156
|
#
|
|
158
|
-
#
|
|
157
|
+
# @option options [Boolean, nil] :error_unmatch (nil) treat unmatched files as an error
|
|
159
158
|
#
|
|
160
|
-
#
|
|
161
|
-
#
|
|
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
|
-
#
|
|
164
|
-
#
|
|
162
|
+
# @option options [Boolean, nil] :full_name (nil) force paths to be output relative to the
|
|
163
|
+
# project top-level directory
|
|
165
164
|
#
|
|
166
|
-
#
|
|
167
|
-
#
|
|
165
|
+
# @option options [Boolean, nil] :recurse_submodules (nil) recursively calls ls-files on each
|
|
166
|
+
# active submodule in the repository
|
|
168
167
|
#
|
|
169
|
-
#
|
|
170
|
-
#
|
|
171
|
-
#
|
|
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
|
-
#
|
|
174
|
-
#
|
|
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
|
-
#
|
|
177
|
-
#
|
|
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
|
-
#
|
|
180
|
-
#
|
|
178
|
+
# @option options [String] :format (nil) a string that interpolates %(fieldname) from
|
|
179
|
+
# the index entry for each file
|
|
181
180
|
#
|
|
182
|
-
#
|
|
181
|
+
# @option options [String] :chdir (nil) run the command from the specified directory
|
|
183
182
|
#
|
|
184
|
-
#
|
|
183
|
+
# @return [Git::CommandLine::Result] the result of calling `git ls-files`
|
|
185
184
|
#
|
|
186
|
-
#
|
|
185
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
187
186
|
#
|
|
188
|
-
#
|
|
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
|
-
#
|
|
75
|
+
# @overload call(repository = nil, *patterns, **options)
|
|
76
|
+
#
|
|
77
|
+
# Execute the `git ls-remote` command
|
|
77
78
|
#
|
|
78
|
-
#
|
|
79
|
+
# @param repository [String, nil] the remote name or URL to query
|
|
79
80
|
#
|
|
80
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
92
|
+
# @option options [Boolean, nil] :branches (nil) limit output to refs under `refs/heads/`
|
|
92
93
|
#
|
|
93
|
-
#
|
|
94
|
+
# Alias: :b
|
|
94
95
|
#
|
|
95
|
-
#
|
|
96
|
+
# @option options [Boolean, nil] :heads (nil) limit output to refs under `refs/heads/`
|
|
96
97
|
#
|
|
97
|
-
#
|
|
98
|
+
# Deprecated: use `:branches` instead. Kept for backward compatibility with
|
|
99
|
+
# older git versions where `--heads` is the only supported flag.
|
|
98
100
|
#
|
|
99
|
-
#
|
|
100
|
-
# older git versions where `--heads` is the only supported flag.
|
|
101
|
+
# Alias: :h
|
|
101
102
|
#
|
|
102
|
-
#
|
|
103
|
+
# @option options [Boolean, nil] :tags (nil) limit output to refs under `refs/tags/`
|
|
103
104
|
#
|
|
104
|
-
#
|
|
105
|
+
# Alias: :t
|
|
105
106
|
#
|
|
106
|
-
#
|
|
107
|
+
# @option options [Boolean, nil] :refs (nil) exclude peeled tags and pseudorefs
|
|
108
|
+
# like `HEAD` from the output
|
|
107
109
|
#
|
|
108
|
-
#
|
|
109
|
-
#
|
|
110
|
+
# @option options [String] :upload_pack (nil) full path to `git-upload-pack`
|
|
111
|
+
# on the remote host
|
|
110
112
|
#
|
|
111
|
-
#
|
|
112
|
-
#
|
|
113
|
+
# Useful when accessing repositories via SSH where the daemon does not
|
|
114
|
+
# use the PATH configured by the user.
|
|
113
115
|
#
|
|
114
|
-
#
|
|
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
|
-
#
|
|
118
|
+
# Alias: :q
|
|
118
119
|
#
|
|
119
|
-
#
|
|
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
|
-
#
|
|
122
|
-
#
|
|
123
|
+
# Without this option, the command exits `0` whenever it successfully
|
|
124
|
+
# communicates with the remote, even if no refs match.
|
|
123
125
|
#
|
|
124
|
-
#
|
|
125
|
-
#
|
|
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
|
-
#
|
|
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
|
-
#
|
|
132
|
+
# Prefix `-` for descending order. Supports `"version:refname"` or
|
|
133
|
+
# `"v:refname"`. See `git for-each-ref` for sort key documentation.
|
|
132
134
|
#
|
|
133
|
-
#
|
|
134
|
-
#
|
|
135
|
+
# @option options [Boolean, nil] :symref (nil) show the underlying ref pointed to by
|
|
136
|
+
# symbolic refs
|
|
135
137
|
#
|
|
136
|
-
#
|
|
137
|
-
#
|
|
138
|
+
# The `upload-pack` protocol currently surfaces only the `HEAD` symref,
|
|
139
|
+
# so that is typically the only symref shown.
|
|
138
140
|
#
|
|
139
|
-
#
|
|
140
|
-
#
|
|
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
|
-
#
|
|
143
|
-
#
|
|
144
|
+
# The string must not contain NUL or LF characters. Repeatable by
|
|
145
|
+
# passing an Array. Alias: :o
|
|
144
146
|
#
|
|
145
|
-
#
|
|
146
|
-
# passing an Array. Alias: :o
|
|
147
|
+
# @option options [Numeric] :timeout (nil) execution timeout in seconds
|
|
147
148
|
#
|
|
148
|
-
#
|
|
149
|
+
# @return [Git::CommandLine::Result] the result of calling `git ls-remote`
|
|
149
150
|
#
|
|
150
|
-
#
|
|
151
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
151
152
|
#
|
|
152
|
-
#
|
|
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
|
data/lib/git/commands/ls_tree.rb
CHANGED
|
@@ -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
|
-
#
|
|
61
|
+
# @overload call(tree_ish, *path, **options)
|
|
62
|
+
#
|
|
63
|
+
# Execute the git ls-tree command
|
|
63
64
|
#
|
|
64
|
-
#
|
|
65
|
+
# @param tree_ish [String] the tree object to list (SHA, branch name, tag, etc.)
|
|
65
66
|
#
|
|
66
|
-
#
|
|
67
|
+
# @param path [Array<String>] optional path(s) to restrict the listing
|
|
67
68
|
#
|
|
68
|
-
#
|
|
69
|
+
# When given, only entries matching these paths are shown.
|
|
69
70
|
#
|
|
70
|
-
#
|
|
71
|
+
# @param options [Hash] command options
|
|
71
72
|
#
|
|
72
|
-
#
|
|
73
|
+
# @option options [Boolean, nil] :d (nil) show only the named tree entry itself,
|
|
74
|
+
# not its children
|
|
73
75
|
#
|
|
74
|
-
#
|
|
75
|
-
# not its children
|
|
76
|
+
# @option options [Boolean, nil] :r (nil) recurse into sub-trees
|
|
76
77
|
#
|
|
77
|
-
#
|
|
78
|
+
# @option options [Boolean, nil] :t (nil) show tree entries even when going to
|
|
79
|
+
# recurse them
|
|
78
80
|
#
|
|
79
|
-
#
|
|
80
|
-
# recurse them
|
|
81
|
+
# Implies recursive listing (`:r`) in git.
|
|
81
82
|
#
|
|
82
|
-
#
|
|
83
|
+
# @option options [Boolean, nil] :long (nil) show object size of blob (file)
|
|
84
|
+
# objects
|
|
83
85
|
#
|
|
84
|
-
#
|
|
85
|
-
# objects
|
|
86
|
+
# Cannot be combined with `:name_only` or `:object_only`.
|
|
86
87
|
#
|
|
87
|
-
#
|
|
88
|
+
# Alias: :l
|
|
88
89
|
#
|
|
89
|
-
#
|
|
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
|
-
#
|
|
92
|
-
#
|
|
93
|
+
# @option options [Boolean, nil] :name_only (nil) list only filenames, one per
|
|
94
|
+
# line
|
|
93
95
|
#
|
|
94
|
-
#
|
|
95
|
-
# line
|
|
96
|
+
# Cannot be combined with `:object_only` or `:long`.
|
|
96
97
|
#
|
|
97
|
-
#
|
|
98
|
+
# Alias: :name_status
|
|
98
99
|
#
|
|
99
|
-
#
|
|
100
|
+
# @option options [Boolean, nil] :object_only (nil) list only the object names
|
|
101
|
+
# (SHAs), one per line
|
|
100
102
|
#
|
|
101
|
-
#
|
|
102
|
-
# (SHAs), one per line
|
|
103
|
+
# Cannot be combined with `:name_only` or `:long`.
|
|
103
104
|
#
|
|
104
|
-
#
|
|
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
|
-
#
|
|
107
|
-
#
|
|
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
|
-
#
|
|
110
|
-
# the current working directory; implies `:full_name`
|
|
111
|
+
# @option options [Boolean, String, nil] :abbrev (nil) use abbreviated object names
|
|
111
112
|
#
|
|
112
|
-
#
|
|
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
|
-
#
|
|
115
|
-
#
|
|
116
|
+
# @option options [String] :format (nil) a format string that interpolates
|
|
117
|
+
# `%(fieldname)` placeholders from tree entries
|
|
116
118
|
#
|
|
117
|
-
#
|
|
118
|
-
# `%(fieldname)` placeholders from tree entries
|
|
119
|
+
# Cannot be combined with `:long`, `:name_only`, or `:object_only`.
|
|
119
120
|
#
|
|
120
|
-
#
|
|
121
|
+
# @return [Git::CommandLine::Result] the result of calling `git ls-tree`
|
|
121
122
|
#
|
|
122
|
-
#
|
|
123
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
123
124
|
#
|
|
124
|
-
#
|
|
125
|
+
# @raise [ArgumentError] if the tree-ish operand is missing
|
|
125
126
|
#
|
|
126
|
-
#
|
|
127
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
127
128
|
#
|
|
128
|
-
#
|
|
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
|
-
#
|
|
36
|
+
# @overload call(**options)
|
|
38
37
|
#
|
|
39
|
-
#
|
|
38
|
+
# Initialize config values so scheduled maintenance will start running
|
|
40
39
|
#
|
|
41
|
-
#
|
|
42
|
-
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
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
|
-
#
|
|
47
|
-
#
|
|
48
|
-
#
|
|
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
|
-
#
|
|
49
|
+
# @param options [Hash] command options
|
|
51
50
|
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
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
|
-
#
|
|
54
|
+
# When a String, the path is passed as `--config-file <file>`.
|
|
56
55
|
#
|
|
57
|
-
#
|
|
58
|
-
#
|
|
56
|
+
# @option options [Boolean, nil] :no_config_file (nil) disable the config file
|
|
57
|
+
# (`--no-config-file`)
|
|
59
58
|
#
|
|
60
|
-
#
|
|
61
|
-
#
|
|
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
|
-
#
|
|
62
|
+
# @return [Git::CommandLine::Result] the result of calling `git maintenance register`
|
|
64
63
|
#
|
|
65
|
-
#
|
|
64
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
66
65
|
#
|
|
67
|
-
#
|
|
66
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
68
67
|
#
|
|
69
|
-
#
|
|
68
|
+
# @raise [Git::VersionError] if git version is below 2.30.0
|
|
70
69
|
#
|
|
71
|
-
#
|
|
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::
|
|
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::
|
|
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
|
#
|