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