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
|
@@ -62,80 +62,83 @@ module Git
|
|
|
62
62
|
operand :pattern, repeatable: true
|
|
63
63
|
end
|
|
64
64
|
|
|
65
|
-
# @!method call(
|
|
65
|
+
# @!method call(*pattern, **options)
|
|
66
66
|
#
|
|
67
|
-
# Execute the git tag --list command
|
|
67
|
+
# Execute the `git tag --list` command
|
|
68
68
|
#
|
|
69
|
-
# @
|
|
69
|
+
# @param pattern [Array<String>] shell wildcard patterns to filter tags
|
|
70
70
|
#
|
|
71
|
-
#
|
|
71
|
+
# Multiple patterns can be provided; a tag is shown if it matches any pattern.
|
|
72
72
|
#
|
|
73
|
-
#
|
|
73
|
+
# @param options [Hash] command options
|
|
74
74
|
#
|
|
75
|
-
#
|
|
75
|
+
# @option options [Boolean, Integer, nil] :n (nil) number of annotation lines to print
|
|
76
76
|
#
|
|
77
|
-
#
|
|
77
|
+
# Pass `true` to print the first annotation line, or an integer to print that
|
|
78
|
+
# many lines. If the tag is not annotated, the commit message is displayed instead.
|
|
78
79
|
#
|
|
79
|
-
#
|
|
80
|
-
#
|
|
80
|
+
# @option options [String, Array<String>] :sort (nil) sort tags by the specified
|
|
81
|
+
# key(s)
|
|
81
82
|
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
83
|
+
# Prefix `-` to sort in descending order. Common keys: 'refname',
|
|
84
|
+
# '-refname', 'creatordate', '-creatordate', and 'version:refname'.
|
|
84
85
|
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
87
|
-
# version sorting).
|
|
86
|
+
# @option options [Boolean, String, nil] :color (nil) colorize output per colors
|
|
87
|
+
# specified in `--format`
|
|
88
88
|
#
|
|
89
|
-
#
|
|
90
|
-
# specified in `--format`
|
|
89
|
+
# Pass `true` for `--color`, or one of `'always'`, `'never'`, `'auto'`.
|
|
91
90
|
#
|
|
92
|
-
#
|
|
91
|
+
# @option options [Boolean, nil] :ignore_case (nil) sort and filter tags without
|
|
92
|
+
# case sensitivity
|
|
93
93
|
#
|
|
94
|
-
#
|
|
95
|
-
# case insensitive
|
|
94
|
+
# Alias: :i
|
|
96
95
|
#
|
|
97
|
-
#
|
|
96
|
+
# @option options [Boolean, nil] :omit_empty (nil) skip trailing newlines for
|
|
97
|
+
# refs whose formatted output is empty
|
|
98
98
|
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
99
|
+
# @option options [Boolean, String, nil] :column (nil) display tag listing in
|
|
100
|
+
# columns
|
|
101
101
|
#
|
|
102
|
-
#
|
|
102
|
+
# Pass `true` for `--column` or a comma-separated options string for
|
|
103
|
+
# `--column=<options>`.
|
|
103
104
|
#
|
|
104
|
-
#
|
|
105
|
-
#
|
|
105
|
+
# @option options [Boolean, nil] :no_column (nil) disable column output
|
|
106
|
+
# (`--no-column`)
|
|
106
107
|
#
|
|
107
|
-
#
|
|
108
|
+
# @option options [Boolean, String, nil] :contains (nil) list only tags that
|
|
109
|
+
# contain the specified commit
|
|
108
110
|
#
|
|
109
|
-
#
|
|
110
|
-
# specified commit
|
|
111
|
+
# Pass `true` to use HEAD, or a commit reference string.
|
|
111
112
|
#
|
|
112
|
-
#
|
|
113
|
+
# @option options [Boolean, String, nil] :no_contains (nil) list only tags that do
|
|
114
|
+
# not contain the specified commit
|
|
113
115
|
#
|
|
114
|
-
#
|
|
115
|
-
# the specified commit
|
|
116
|
+
# Pass `true` to use HEAD, or a commit reference string.
|
|
116
117
|
#
|
|
117
|
-
#
|
|
118
|
+
# @option options [Boolean, String, nil] :merged (nil) list only tags whose commits
|
|
119
|
+
# are reachable from the specified commit
|
|
118
120
|
#
|
|
119
|
-
#
|
|
120
|
-
# reachable from the specified commit
|
|
121
|
+
# Pass `true` to use HEAD, or a commit reference string.
|
|
121
122
|
#
|
|
122
|
-
#
|
|
123
|
+
# @option options [Boolean, String, nil] :no_merged (nil) list only tags whose
|
|
124
|
+
# commits are not reachable from the specified commit
|
|
123
125
|
#
|
|
124
|
-
#
|
|
125
|
-
# not reachable from the specified commit
|
|
126
|
+
# Pass `true` to use HEAD, or a commit reference string.
|
|
126
127
|
#
|
|
127
|
-
#
|
|
128
|
+
# @option options [Boolean, String, nil] :points_at (nil) list only tags that point
|
|
129
|
+
# at the specified object
|
|
128
130
|
#
|
|
129
|
-
#
|
|
130
|
-
# specified object
|
|
131
|
+
# Pass `true` to use HEAD, or an object reference string.
|
|
131
132
|
#
|
|
132
|
-
#
|
|
133
|
+
# @option options [String] :format (nil) output format string for each tag
|
|
133
134
|
#
|
|
134
|
-
#
|
|
135
|
+
# @return [Git::CommandLine::Result] the result of calling `git tag --list`
|
|
135
136
|
#
|
|
136
|
-
#
|
|
137
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
137
138
|
#
|
|
138
|
-
#
|
|
139
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
140
|
+
#
|
|
141
|
+
# @api public
|
|
139
142
|
#
|
|
140
143
|
end
|
|
141
144
|
end
|
|
@@ -42,28 +42,28 @@ module Git
|
|
|
42
42
|
operand :tagname, repeatable: true, required: true
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
# @!method call(
|
|
45
|
+
# @!method call(*tagname, **options)
|
|
46
46
|
#
|
|
47
|
-
# Execute the git tag --verify command to verify tag signatures
|
|
47
|
+
# Execute the `git tag --verify` command to verify tag signatures
|
|
48
48
|
#
|
|
49
|
-
# @
|
|
49
|
+
# @param tagname [Array<String>] one or more tag names to verify
|
|
50
50
|
#
|
|
51
|
-
#
|
|
51
|
+
# @param options [Hash] command options
|
|
52
52
|
#
|
|
53
|
-
#
|
|
53
|
+
# @option options [String] :format (nil) a format string interpolating
|
|
54
|
+
# `%(fieldname)` from the tag ref being shown and the object it points at
|
|
54
55
|
#
|
|
55
|
-
#
|
|
56
|
-
# `%(fieldname)` from the tag ref being shown and the object it points at
|
|
56
|
+
# The format is the same as that of git-for-each-ref(1)
|
|
57
57
|
#
|
|
58
|
-
#
|
|
58
|
+
# @return [Git::CommandLine::Result] the result of calling `git tag --verify`
|
|
59
59
|
#
|
|
60
|
-
#
|
|
60
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
61
61
|
#
|
|
62
|
-
#
|
|
62
|
+
# @raise [ArgumentError] if no tagname operands are provided
|
|
63
63
|
#
|
|
64
|
-
#
|
|
64
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
65
65
|
#
|
|
66
|
-
#
|
|
66
|
+
# @api public
|
|
67
67
|
#
|
|
68
68
|
end
|
|
69
69
|
end
|
data/lib/git/commands/tag.rb
CHANGED
|
@@ -16,10 +16,10 @@ module Git
|
|
|
16
16
|
# - {Tag::List} — list tags with optional filtering (`--list`)
|
|
17
17
|
# - {Tag::Verify} — verify GPG signatures of tags (`--verify`)
|
|
18
18
|
#
|
|
19
|
-
# @api private
|
|
20
|
-
#
|
|
21
19
|
# @see https://git-scm.com/docs/git-tag git-tag documentation
|
|
22
20
|
#
|
|
21
|
+
# @api private
|
|
22
|
+
#
|
|
23
23
|
module Tag
|
|
24
24
|
end
|
|
25
25
|
end
|
|
@@ -108,7 +108,7 @@ module Git
|
|
|
108
108
|
#
|
|
109
109
|
# @option options [Numeric] :timeout (nil) abort the command after this many seconds
|
|
110
110
|
#
|
|
111
|
-
# @return [Git::
|
|
111
|
+
# @return [Git::CommandLine::Result] the result of calling
|
|
112
112
|
# `git update-ref --stdin`
|
|
113
113
|
#
|
|
114
114
|
# @raise [ArgumentError] if unsupported options are provided
|
|
@@ -130,6 +130,11 @@ module Git
|
|
|
130
130
|
|
|
131
131
|
private
|
|
132
132
|
|
|
133
|
+
# Build stdin payload for `git update-ref --stdin`
|
|
134
|
+
#
|
|
135
|
+
# @param bound [Git::Commands::Arguments::Bound] bound command arguments
|
|
136
|
+
#
|
|
137
|
+
# @return [String] instruction stream with delimiter applied per `z:`
|
|
133
138
|
def build_stdin(bound)
|
|
134
139
|
delimiter = bound.z? ? "\0" : "\n"
|
|
135
140
|
Array(bound.instructions).map { |i| "#{i}#{delimiter}" }.join
|
|
@@ -52,40 +52,38 @@ module Git
|
|
|
52
52
|
operand :oldvalue
|
|
53
53
|
end
|
|
54
54
|
|
|
55
|
-
# @!method call(
|
|
55
|
+
# @!method call(ref, oldvalue = nil, **options)
|
|
56
56
|
#
|
|
57
|
-
#
|
|
57
|
+
# Execute the `git update-ref -d` command
|
|
58
58
|
#
|
|
59
|
-
#
|
|
59
|
+
# @param ref [String] the ref to delete
|
|
60
|
+
# (e.g. `refs/heads/old-branch`)
|
|
60
61
|
#
|
|
61
|
-
#
|
|
62
|
-
# (e.g. `refs/heads/old-branch`)
|
|
62
|
+
# @param oldvalue [String, nil] (nil) expected current value of the ref
|
|
63
63
|
#
|
|
64
|
-
#
|
|
65
|
-
#
|
|
64
|
+
# When provided, the delete is rejected unless the ref currently points to this
|
|
65
|
+
# object.
|
|
66
66
|
#
|
|
67
|
-
#
|
|
68
|
-
# currently points to this object.
|
|
67
|
+
# @param options [Hash] command options
|
|
69
68
|
#
|
|
70
|
-
#
|
|
69
|
+
# @option options [String] :m (nil) a reflog message for the deletion
|
|
71
70
|
#
|
|
72
|
-
#
|
|
73
|
-
#
|
|
71
|
+
# @option options [Boolean, nil] :no_deref (nil) overwrite the ref itself rather
|
|
72
|
+
# than following symbolic refs
|
|
74
73
|
#
|
|
75
|
-
#
|
|
76
|
-
#
|
|
74
|
+
# @option options [Numeric] :timeout (nil) abort the command after this many
|
|
75
|
+
# seconds
|
|
77
76
|
#
|
|
78
|
-
#
|
|
79
|
-
# seconds
|
|
77
|
+
# @return [Git::CommandLine::Result] the result of calling `git update-ref -d`
|
|
80
78
|
#
|
|
81
|
-
#
|
|
82
|
-
# `git update-ref -d`
|
|
79
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
83
80
|
#
|
|
84
|
-
#
|
|
81
|
+
# @raise [ArgumentError] if the ref operand is missing
|
|
85
82
|
#
|
|
86
|
-
#
|
|
83
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
84
|
+
#
|
|
85
|
+
# @api public
|
|
87
86
|
#
|
|
88
|
-
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
89
87
|
end
|
|
90
88
|
end
|
|
91
89
|
end
|
|
@@ -60,46 +60,43 @@ module Git
|
|
|
60
60
|
operand :oldvalue
|
|
61
61
|
end
|
|
62
62
|
|
|
63
|
-
# @!method call(
|
|
63
|
+
# @!method call(ref, newvalue, oldvalue = nil, **options)
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# Execute the `git update-ref` command
|
|
66
66
|
#
|
|
67
|
-
#
|
|
67
|
+
# @param ref [String] the ref to update (e.g. `refs/heads/main`)
|
|
68
68
|
#
|
|
69
|
-
#
|
|
69
|
+
# @param newvalue [String] the new object name to store
|
|
70
70
|
#
|
|
71
|
-
#
|
|
71
|
+
# @param oldvalue [String, nil] (nil) expected current value of the ref
|
|
72
72
|
#
|
|
73
|
-
#
|
|
74
|
-
#
|
|
73
|
+
# When provided, the update is rejected unless the ref currently points to this
|
|
74
|
+
# object. Use 40 `"0"` characters or an empty string to assert the ref does
|
|
75
|
+
# not yet exist.
|
|
75
76
|
#
|
|
76
|
-
#
|
|
77
|
-
# currently points to this object. Use 40 `"0"` characters
|
|
78
|
-
# or an empty string to assert the ref does not yet exist.
|
|
77
|
+
# @param options [Hash] command options
|
|
79
78
|
#
|
|
80
|
-
#
|
|
79
|
+
# @option options [String] :m (nil) a reflog message for the update
|
|
81
80
|
#
|
|
82
|
-
#
|
|
83
|
-
#
|
|
81
|
+
# @option options [Boolean, nil] :no_deref (nil) overwrite the ref itself rather
|
|
82
|
+
# than following symbolic refs
|
|
84
83
|
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
84
|
+
# @option options [Boolean, nil] :create_reflog (nil) create a reflog even if one
|
|
85
|
+
# would not ordinarily be created
|
|
87
86
|
#
|
|
88
|
-
#
|
|
89
|
-
#
|
|
87
|
+
# @option options [Numeric] :timeout (nil) abort the command after this many
|
|
88
|
+
# seconds
|
|
90
89
|
#
|
|
91
|
-
#
|
|
92
|
-
# seconds
|
|
90
|
+
# @return [Git::CommandLine::Result] the result of calling `git update-ref`
|
|
93
91
|
#
|
|
94
|
-
#
|
|
95
|
-
# `git update-ref`
|
|
92
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
96
93
|
#
|
|
97
|
-
#
|
|
94
|
+
# @raise [ArgumentError] if the ref or newvalue operand is missing
|
|
98
95
|
#
|
|
99
|
-
#
|
|
100
|
-
#
|
|
96
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
97
|
+
#
|
|
98
|
+
# @api public
|
|
101
99
|
#
|
|
102
|
-
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
103
100
|
end
|
|
104
101
|
end
|
|
105
102
|
end
|
|
@@ -17,10 +17,6 @@ module Git
|
|
|
17
17
|
# - {UpdateRef::Batch} — read update/create/delete/verify instructions
|
|
18
18
|
# from stdin (`--stdin`); all modifications are applied atomically
|
|
19
19
|
#
|
|
20
|
-
# @api private
|
|
21
|
-
#
|
|
22
|
-
# @see https://git-scm.com/docs/git-update-ref git-update-ref documentation
|
|
23
|
-
#
|
|
24
20
|
# @example Update a branch ref to a new commit SHA
|
|
25
21
|
# cmd = Git::Commands::UpdateRef::Update.new(lib)
|
|
26
22
|
# cmd.call('refs/heads/main', 'abc1234')
|
|
@@ -36,6 +32,10 @@ module Git
|
|
|
36
32
|
# 'delete refs/heads/old'
|
|
37
33
|
# )
|
|
38
34
|
#
|
|
35
|
+
# @see https://git-scm.com/docs/git-update-ref git-update-ref documentation
|
|
36
|
+
#
|
|
37
|
+
# @api private
|
|
38
|
+
#
|
|
39
39
|
module UpdateRef
|
|
40
40
|
end
|
|
41
41
|
end
|
data/lib/git/commands/version.rb
CHANGED
|
@@ -33,25 +33,28 @@ module Git
|
|
|
33
33
|
flag_option :build_options
|
|
34
34
|
end
|
|
35
35
|
|
|
36
|
-
#
|
|
36
|
+
# @overload call(**options)
|
|
37
37
|
#
|
|
38
|
-
#
|
|
38
|
+
# Execute the `git version` command
|
|
39
39
|
#
|
|
40
|
-
#
|
|
40
|
+
# @param options [Hash] command options
|
|
41
41
|
#
|
|
42
|
-
#
|
|
42
|
+
# @option options [Numeric, nil] :timeout (nil) the number of seconds to wait
|
|
43
|
+
# for the command to complete; if nil, uses the global timeout from
|
|
44
|
+
# {Git::Config}; if 0, no timeout is enforced
|
|
43
45
|
#
|
|
44
|
-
#
|
|
46
|
+
# @option options [Boolean, nil] :build_options (nil) include build options in
|
|
47
|
+
# the output
|
|
45
48
|
#
|
|
46
|
-
#
|
|
47
|
-
# for the command to complete; if nil, uses the global timeout from
|
|
48
|
-
# {Git::Config}; if 0, no timeout is enforced
|
|
49
|
+
# @return [Git::CommandLine::Result] the result of calling `git version`
|
|
49
50
|
#
|
|
50
|
-
#
|
|
51
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
51
52
|
#
|
|
52
|
-
#
|
|
53
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
53
54
|
#
|
|
54
|
-
#
|
|
55
|
+
# @api public
|
|
56
|
+
#
|
|
57
|
+
def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
|
|
55
58
|
end
|
|
56
59
|
end
|
|
57
60
|
end
|
|
@@ -49,91 +49,90 @@ module Git
|
|
|
49
49
|
operand :commit_ish
|
|
50
50
|
end
|
|
51
51
|
|
|
52
|
-
#
|
|
52
|
+
# @overload call(path, commit_ish = nil, **options)
|
|
53
53
|
#
|
|
54
|
-
#
|
|
54
|
+
# Create a new linked worktree and check out `commit_ish` into it
|
|
55
55
|
#
|
|
56
|
-
#
|
|
56
|
+
# @param path [String] filesystem path for the new worktree
|
|
57
57
|
#
|
|
58
|
-
#
|
|
58
|
+
# @param commit_ish [String, nil] (nil) branch, tag, or commit to check out
|
|
59
59
|
#
|
|
60
|
-
#
|
|
60
|
+
# When omitted, git creates a new branch named after the final path
|
|
61
|
+
# component and checks it out
|
|
61
62
|
#
|
|
62
|
-
#
|
|
63
|
-
# component and checks it out.
|
|
63
|
+
# @param options [Hash] command options
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# @option options [Boolean, Integer, nil] :force (nil) override safety guards
|
|
66
66
|
#
|
|
67
|
-
#
|
|
67
|
+
# Pass `true` or `1` to emit `--force` once. Pass `2` to emit
|
|
68
|
+
# `--force --force`, which also allows adding worktrees for locked branches.
|
|
68
69
|
#
|
|
69
|
-
#
|
|
70
|
-
# `--force --force`, which also allows adding worktrees for locked branches.
|
|
70
|
+
# Alias: :f
|
|
71
71
|
#
|
|
72
|
-
#
|
|
72
|
+
# @option options [String] :b (nil) create a new branch with this name and
|
|
73
|
+
# check it out
|
|
73
74
|
#
|
|
74
|
-
#
|
|
75
|
-
#
|
|
75
|
+
# @option options [String] :B (nil) create or reset a branch with this name and
|
|
76
|
+
# check it out
|
|
76
77
|
#
|
|
77
|
-
#
|
|
78
|
-
# name and check it out
|
|
78
|
+
# @option options [Boolean, nil] :detach (nil) check out in detached-HEAD state
|
|
79
79
|
#
|
|
80
|
-
#
|
|
81
|
-
# detached-HEAD state
|
|
80
|
+
# Alias: :d
|
|
82
81
|
#
|
|
83
|
-
#
|
|
82
|
+
# @option options [Boolean, nil] :checkout (nil) control whether the working
|
|
83
|
+
# tree is checked out after creation (`--checkout`)
|
|
84
84
|
#
|
|
85
|
-
#
|
|
86
|
-
#
|
|
85
|
+
# @option options [Boolean, nil] :no_checkout (nil) suppress the initial
|
|
86
|
+
# checkout after worktree creation (`--no-checkout`)
|
|
87
87
|
#
|
|
88
|
-
#
|
|
89
|
-
#
|
|
88
|
+
# @option options [Boolean, nil] :guess_remote (nil) base new branch on a
|
|
89
|
+
# matching remote-tracking branch (`--guess-remote`)
|
|
90
90
|
#
|
|
91
|
-
#
|
|
92
|
-
# matching remote-tracking branch (`--guess-remote`)
|
|
91
|
+
# Applied when no `commit_ish` argument is provided.
|
|
93
92
|
#
|
|
94
|
-
#
|
|
93
|
+
# @option options [Boolean, nil] :no_guess_remote (nil) disable guess-remote
|
|
94
|
+
# behavior (`--no-guess-remote`)
|
|
95
95
|
#
|
|
96
|
-
#
|
|
97
|
-
#
|
|
96
|
+
# @option options [Boolean, nil] :relative_paths (nil) link worktrees using
|
|
97
|
+
# relative paths (`--relative-paths`)
|
|
98
98
|
#
|
|
99
|
-
#
|
|
100
|
-
# relative paths (`--relative-paths`)
|
|
99
|
+
# Overrides the `worktree.useRelativePaths` config option.
|
|
101
100
|
#
|
|
102
|
-
#
|
|
101
|
+
# @option options [Boolean, nil] :no_relative_paths (nil) use absolute paths for
|
|
102
|
+
# worktree links (`--no-relative-paths`)
|
|
103
103
|
#
|
|
104
|
-
#
|
|
105
|
-
# for worktree links (`--no-relative-paths`)
|
|
104
|
+
# Overrides the `worktree.useRelativePaths` config option.
|
|
106
105
|
#
|
|
107
|
-
#
|
|
106
|
+
# @option options [Boolean, nil] :track (nil) mark the upstream branch for
|
|
107
|
+
# tracking (`--track`)
|
|
108
108
|
#
|
|
109
|
-
#
|
|
110
|
-
#
|
|
109
|
+
# @option options [Boolean, nil] :no_track (nil) do not mark the upstream
|
|
110
|
+
# branch for tracking (`--no-track`)
|
|
111
111
|
#
|
|
112
|
-
#
|
|
113
|
-
#
|
|
112
|
+
# @option options [Boolean, nil] :lock (nil) lock the worktree immediately after
|
|
113
|
+
# creation
|
|
114
114
|
#
|
|
115
|
-
#
|
|
116
|
-
#
|
|
115
|
+
# @option options [Boolean, nil] :orphan (nil) create an empty worktree
|
|
116
|
+
# associated with a new unborn branch
|
|
117
117
|
#
|
|
118
|
-
#
|
|
119
|
-
# associated with a new unborn branch
|
|
118
|
+
# @option options [Boolean, nil] :quiet (nil) suppress informational messages
|
|
120
119
|
#
|
|
121
|
-
#
|
|
120
|
+
# Alias: :q
|
|
122
121
|
#
|
|
123
|
-
#
|
|
122
|
+
# @option options [String] :reason (nil) explanation for why the worktree is
|
|
123
|
+
# locked
|
|
124
124
|
#
|
|
125
|
-
#
|
|
126
|
-
# is locked
|
|
125
|
+
# Only meaningful when used with `:lock`.
|
|
127
126
|
#
|
|
128
|
-
#
|
|
127
|
+
# @return [Git::CommandLine::Result] the result of calling `git worktree add`
|
|
129
128
|
#
|
|
130
|
-
#
|
|
129
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
131
130
|
#
|
|
132
|
-
#
|
|
131
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
133
132
|
#
|
|
134
|
-
#
|
|
133
|
+
# @api public
|
|
135
134
|
#
|
|
136
|
-
#
|
|
135
|
+
def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
|
|
137
136
|
end
|
|
138
137
|
end
|
|
139
138
|
end
|
|
@@ -29,35 +29,35 @@ module Git
|
|
|
29
29
|
value_option :expire
|
|
30
30
|
end
|
|
31
31
|
|
|
32
|
-
#
|
|
32
|
+
# @overload call(**options)
|
|
33
33
|
#
|
|
34
|
-
#
|
|
34
|
+
# List all worktrees attached to the repository
|
|
35
35
|
#
|
|
36
|
-
#
|
|
36
|
+
# @param options [Hash] command options
|
|
37
37
|
#
|
|
38
|
-
#
|
|
38
|
+
# @option options [Boolean, nil] :porcelain (nil) produce machine-readable
|
|
39
|
+
# output
|
|
39
40
|
#
|
|
40
|
-
#
|
|
41
|
-
#
|
|
41
|
+
# @option options [Boolean, nil] :z (nil) terminate output lines with NUL
|
|
42
|
+
# bytes (use with `:porcelain`)
|
|
42
43
|
#
|
|
43
|
-
#
|
|
44
|
-
#
|
|
44
|
+
# @option options [Boolean, nil] :verbose (nil) output additional information
|
|
45
|
+
# about worktrees
|
|
45
46
|
#
|
|
46
|
-
#
|
|
47
|
-
# about worktrees
|
|
47
|
+
# Alias: :v
|
|
48
48
|
#
|
|
49
|
-
#
|
|
49
|
+
# @option options [String] :expire (nil) annotate missing worktrees as
|
|
50
|
+
# prunable if older than this time expression
|
|
50
51
|
#
|
|
51
|
-
#
|
|
52
|
-
# prunable if older than this time expression
|
|
52
|
+
# @return [Git::CommandLine::Result] the result of calling `git worktree list`
|
|
53
53
|
#
|
|
54
|
-
#
|
|
54
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
55
55
|
#
|
|
56
|
-
#
|
|
56
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
57
57
|
#
|
|
58
|
-
#
|
|
58
|
+
# @api public
|
|
59
59
|
#
|
|
60
|
-
#
|
|
60
|
+
def call(...) = super # rubocop:disable Lint/UselessMethodDefinition
|
|
61
61
|
end
|
|
62
62
|
end
|
|
63
63
|
end
|