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