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
|
@@ -10,14 +10,6 @@ module Git
|
|
|
10
10
|
# Like {Apply}, but removes the stash from the stash list after
|
|
11
11
|
# applying, unless there are conflicts.
|
|
12
12
|
#
|
|
13
|
-
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
14
|
-
#
|
|
15
|
-
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
16
|
-
#
|
|
17
|
-
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
18
|
-
#
|
|
19
|
-
# @api private
|
|
20
|
-
#
|
|
21
13
|
# @example Pop the latest stash
|
|
22
14
|
# Git::Commands::Stash::Pop.new(execution_context).call
|
|
23
15
|
#
|
|
@@ -30,6 +22,14 @@ module Git
|
|
|
30
22
|
# @example Pop quietly
|
|
31
23
|
# Git::Commands::Stash::Pop.new(execution_context).call(quiet: true)
|
|
32
24
|
#
|
|
25
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
26
|
+
#
|
|
27
|
+
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
28
|
+
#
|
|
29
|
+
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
30
|
+
#
|
|
31
|
+
# @api private
|
|
32
|
+
#
|
|
33
33
|
class Pop < Git::Commands::Base
|
|
34
34
|
arguments do
|
|
35
35
|
literal 'stash'
|
|
@@ -39,9 +39,12 @@ module Git
|
|
|
39
39
|
operand :stash
|
|
40
40
|
end
|
|
41
41
|
|
|
42
|
-
# @!method call(*, **)
|
|
42
|
+
# @!method call(*, **options)
|
|
43
|
+
#
|
|
44
|
+
# @param options [Hash] command options
|
|
43
45
|
#
|
|
44
|
-
#
|
|
46
|
+
# @option options [Boolean, nil] :index (nil) command option key; see overload docs
|
|
47
|
+
# for the full option list
|
|
45
48
|
#
|
|
46
49
|
# @overload call(**options)
|
|
47
50
|
#
|
|
@@ -55,6 +58,8 @@ module Git
|
|
|
55
58
|
#
|
|
56
59
|
# Alias: :q
|
|
57
60
|
#
|
|
61
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash pop`
|
|
62
|
+
#
|
|
58
63
|
# @overload call(stash, **options)
|
|
59
64
|
#
|
|
60
65
|
# Pop a specific stash
|
|
@@ -69,9 +74,13 @@ module Git
|
|
|
69
74
|
#
|
|
70
75
|
# Alias: :q
|
|
71
76
|
#
|
|
72
|
-
#
|
|
77
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash pop`
|
|
78
|
+
#
|
|
79
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
80
|
+
#
|
|
81
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
73
82
|
#
|
|
74
|
-
# @
|
|
83
|
+
# @api public
|
|
75
84
|
end
|
|
76
85
|
end
|
|
77
86
|
end
|
|
@@ -11,14 +11,6 @@ module Git
|
|
|
11
11
|
# to HEAD (in the working tree and index). The command takes
|
|
12
12
|
# various options to customize what gets stashed.
|
|
13
13
|
#
|
|
14
|
-
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
15
|
-
#
|
|
16
|
-
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
17
|
-
#
|
|
18
|
-
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
19
|
-
#
|
|
20
|
-
# @api private
|
|
21
|
-
#
|
|
22
14
|
# @example Save all changes with a message
|
|
23
15
|
# Git::Commands::Stash::Push.new(execution_context).call(message: 'WIP: feature work')
|
|
24
16
|
#
|
|
@@ -31,6 +23,14 @@ module Git
|
|
|
31
23
|
# @example Include untracked files
|
|
32
24
|
# Git::Commands::Stash::Push.new(execution_context).call(include_untracked: true)
|
|
33
25
|
#
|
|
26
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
27
|
+
#
|
|
28
|
+
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
29
|
+
#
|
|
30
|
+
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
31
|
+
#
|
|
32
|
+
# @api private
|
|
33
|
+
#
|
|
34
34
|
class Push < Git::Commands::Base
|
|
35
35
|
arguments do
|
|
36
36
|
literal 'stash'
|
|
@@ -48,7 +48,12 @@ module Git
|
|
|
48
48
|
operand :pathspec, repeatable: true
|
|
49
49
|
end
|
|
50
50
|
|
|
51
|
-
# @!method call(*, **)
|
|
51
|
+
# @!method call(*, **options)
|
|
52
|
+
#
|
|
53
|
+
# @param options [Hash] command options
|
|
54
|
+
#
|
|
55
|
+
# @option options [Boolean, nil] :patch (nil) command option key; see overload docs
|
|
56
|
+
# for the full option list
|
|
52
57
|
#
|
|
53
58
|
# @overload call(*pathspec, **options)
|
|
54
59
|
#
|
|
@@ -93,9 +98,13 @@ module Git
|
|
|
93
98
|
#
|
|
94
99
|
# @option options [Boolean, nil] :pathspec_file_nul (nil) pathspecs in the file are NUL-separated
|
|
95
100
|
#
|
|
96
|
-
# @return [Git::
|
|
101
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash push`
|
|
102
|
+
#
|
|
103
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
104
|
+
#
|
|
105
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
97
106
|
#
|
|
98
|
-
#
|
|
107
|
+
# @api public
|
|
99
108
|
#
|
|
100
109
|
end
|
|
101
110
|
end
|
|
@@ -11,14 +11,6 @@ module Git
|
|
|
11
11
|
# stashed contents and the commit back when the stash entry was first
|
|
12
12
|
# created.
|
|
13
13
|
#
|
|
14
|
-
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
15
|
-
#
|
|
16
|
-
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
17
|
-
#
|
|
18
|
-
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
19
|
-
#
|
|
20
|
-
# @api private
|
|
21
|
-
#
|
|
22
14
|
# @example Show numstat for the latest stash
|
|
23
15
|
# Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true)
|
|
24
16
|
#
|
|
@@ -29,6 +21,14 @@ module Git
|
|
|
29
21
|
# Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: true)
|
|
30
22
|
# Git::Commands::Stash::Show.new(ctx).call(numstat: true, shortstat: true, dirstat: 'lines,cumulative')
|
|
31
23
|
#
|
|
24
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
25
|
+
#
|
|
26
|
+
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
27
|
+
#
|
|
28
|
+
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
29
|
+
#
|
|
30
|
+
# @api private
|
|
31
|
+
#
|
|
32
32
|
class Show < Git::Commands::Base
|
|
33
33
|
arguments do
|
|
34
34
|
literal 'stash'
|
|
@@ -50,9 +50,12 @@ module Git
|
|
|
50
50
|
operand :stash
|
|
51
51
|
end
|
|
52
52
|
|
|
53
|
-
# @!method call(*, **)
|
|
53
|
+
# @!method call(*, **options)
|
|
54
|
+
#
|
|
55
|
+
# @param options [Hash] command options
|
|
54
56
|
#
|
|
55
|
-
#
|
|
57
|
+
# @option options [Boolean, nil] :patch (nil) command option key; see overload docs
|
|
58
|
+
# for the full option list
|
|
56
59
|
#
|
|
57
60
|
# @overload call(**options)
|
|
58
61
|
#
|
|
@@ -96,6 +99,8 @@ module Git
|
|
|
96
99
|
#
|
|
97
100
|
# Pass `true` for default, or a string like `'lines,cumulative'` for options.
|
|
98
101
|
#
|
|
102
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash show`
|
|
103
|
+
#
|
|
99
104
|
# @overload call(stash, **options)
|
|
100
105
|
#
|
|
101
106
|
# Show diff for a specific stash
|
|
@@ -140,9 +145,13 @@ module Git
|
|
|
140
145
|
#
|
|
141
146
|
# Pass `true` for default, or a string like `'lines,cumulative'` for options.
|
|
142
147
|
#
|
|
143
|
-
#
|
|
148
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash show`
|
|
149
|
+
#
|
|
150
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
151
|
+
#
|
|
152
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
144
153
|
#
|
|
145
|
-
# @
|
|
154
|
+
# @api public
|
|
146
155
|
end
|
|
147
156
|
end
|
|
148
157
|
end
|
|
@@ -13,6 +13,12 @@ module Git
|
|
|
13
13
|
# This command is typically used after {Create} to actually record
|
|
14
14
|
# the stash in the reflog.
|
|
15
15
|
#
|
|
16
|
+
# @example Store a stash commit
|
|
17
|
+
# Git::Commands::Stash::Store.new(execution_context).call('abc123def456')
|
|
18
|
+
#
|
|
19
|
+
# @example Store with a custom message
|
|
20
|
+
# Git::Commands::Stash::Store.new(execution_context).call('abc123def456', message: 'WIP: feature')
|
|
21
|
+
#
|
|
16
22
|
# @note `arguments` block audited against https://git-scm.com/docs/git-stash/2.53.0
|
|
17
23
|
#
|
|
18
24
|
# @see Git::Commands::Stash Git::Commands::Stash for usage examples
|
|
@@ -21,12 +27,6 @@ module Git
|
|
|
21
27
|
#
|
|
22
28
|
# @api private
|
|
23
29
|
#
|
|
24
|
-
# @example Store a stash commit
|
|
25
|
-
# Git::Commands::Stash::Store.new(execution_context).call('abc123def456')
|
|
26
|
-
#
|
|
27
|
-
# @example Store with a custom message
|
|
28
|
-
# Git::Commands::Stash::Store.new(execution_context).call('abc123def456', message: 'WIP: feature')
|
|
29
|
-
#
|
|
30
30
|
class Store < Git::Commands::Base
|
|
31
31
|
arguments do
|
|
32
32
|
literal 'stash'
|
|
@@ -36,12 +36,17 @@ module Git
|
|
|
36
36
|
operand :commit, required: true
|
|
37
37
|
end
|
|
38
38
|
|
|
39
|
-
# @!method call(*, **)
|
|
39
|
+
# @!method call(*, **options)
|
|
40
40
|
#
|
|
41
|
-
#
|
|
41
|
+
# @param options [Hash] command options
|
|
42
|
+
#
|
|
43
|
+
# @option options [String] :message (nil) command option key; see overload docs for
|
|
44
|
+
# the full option list
|
|
42
45
|
#
|
|
43
46
|
# @overload call(commit, **options)
|
|
44
47
|
#
|
|
48
|
+
# Store a commit in the stash reflog
|
|
49
|
+
#
|
|
45
50
|
# @param commit [String] the commit SHA to store in the stash (required)
|
|
46
51
|
#
|
|
47
52
|
# @param options [Hash] command options
|
|
@@ -54,9 +59,13 @@ module Git
|
|
|
54
59
|
#
|
|
55
60
|
# Alias: :q
|
|
56
61
|
#
|
|
57
|
-
# @return [Git::
|
|
62
|
+
# @return [Git::CommandLine::Result] the result of calling `git stash store`
|
|
63
|
+
#
|
|
64
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
65
|
+
#
|
|
66
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
58
67
|
#
|
|
59
|
-
#
|
|
68
|
+
# @api public
|
|
60
69
|
end
|
|
61
70
|
end
|
|
62
71
|
end
|
data/lib/git/commands/stash.rb
CHANGED
|
@@ -28,10 +28,10 @@ module Git
|
|
|
28
28
|
# - {Stash::Create} — create a stash object without storing it
|
|
29
29
|
# - {Stash::Store} — store a stash object created with `create`
|
|
30
30
|
#
|
|
31
|
-
# @api private
|
|
32
|
-
#
|
|
33
31
|
# @see https://git-scm.com/docs/git-stash git-stash documentation
|
|
34
32
|
#
|
|
33
|
+
# @api private
|
|
34
|
+
#
|
|
35
35
|
module Stash
|
|
36
36
|
end
|
|
37
37
|
end
|
data/lib/git/commands/status.rb
CHANGED
|
@@ -77,7 +77,12 @@ module Git
|
|
|
77
77
|
operand :pathspec, repeatable: true
|
|
78
78
|
end
|
|
79
79
|
|
|
80
|
-
# @!method call(*, **)
|
|
80
|
+
# @!method call(*, **options)
|
|
81
|
+
#
|
|
82
|
+
# @param options [Hash] command options
|
|
83
|
+
#
|
|
84
|
+
# @option options [Boolean, nil] :short (nil) command option key; see overload docs
|
|
85
|
+
# for the full option list
|
|
81
86
|
#
|
|
82
87
|
# @overload call(*pathspecs, **options)
|
|
83
88
|
#
|
|
@@ -157,7 +162,7 @@ module Git
|
|
|
157
162
|
# When `true`, enables rename detection without a threshold. When a string
|
|
158
163
|
# (e.g. `'50'`), adds `--find-renames=<n>`.
|
|
159
164
|
#
|
|
160
|
-
# @return [Git::
|
|
165
|
+
# @return [Git::CommandLine::Result] the result of calling `git status`
|
|
161
166
|
#
|
|
162
167
|
# @raise [ArgumentError] if unsupported options are provided
|
|
163
168
|
#
|
|
@@ -38,30 +38,34 @@ module Git
|
|
|
38
38
|
operand :name, required: true
|
|
39
39
|
end
|
|
40
40
|
|
|
41
|
-
#
|
|
41
|
+
# Executes the git symbolic-ref --delete command
|
|
42
42
|
#
|
|
43
|
-
#
|
|
43
|
+
# @overload call(name, **options)
|
|
44
44
|
#
|
|
45
|
-
#
|
|
45
|
+
# @param name [String] the symbolic ref name to delete
|
|
46
|
+
# (e.g. `HEAD`)
|
|
46
47
|
#
|
|
47
|
-
#
|
|
48
|
-
# (e.g. `HEAD`)
|
|
48
|
+
# @param options [Hash] command options
|
|
49
49
|
#
|
|
50
|
-
#
|
|
50
|
+
# @option options [Boolean, nil] :quiet (nil) suppress error message
|
|
51
|
+
# when the name is not a symbolic ref
|
|
51
52
|
#
|
|
52
|
-
#
|
|
53
|
-
# when the name is not a symbolic ref
|
|
53
|
+
# Alias: :q
|
|
54
54
|
#
|
|
55
|
-
#
|
|
55
|
+
# @return [Git::CommandLine::Result] the result of calling
|
|
56
|
+
# `git symbolic-ref --delete`
|
|
56
57
|
#
|
|
57
|
-
#
|
|
58
|
-
# `git symbolic-ref --delete`
|
|
58
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
59
59
|
#
|
|
60
|
-
#
|
|
60
|
+
# @raise [ArgumentError] if the name operand is missing
|
|
61
61
|
#
|
|
62
|
-
#
|
|
62
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
63
63
|
#
|
|
64
|
-
#
|
|
64
|
+
# @api public
|
|
65
|
+
#
|
|
66
|
+
def call(*, **)
|
|
67
|
+
super
|
|
68
|
+
end
|
|
65
69
|
end
|
|
66
70
|
end
|
|
67
71
|
end
|
|
@@ -56,39 +56,43 @@ module Git
|
|
|
56
56
|
# (e.g. detached HEAD) — this is not an error
|
|
57
57
|
allow_exit_status 0..1
|
|
58
58
|
|
|
59
|
-
#
|
|
59
|
+
# Executes the git symbolic-ref command to read a symbolic ref
|
|
60
60
|
#
|
|
61
|
-
#
|
|
61
|
+
# @overload call(name, **options)
|
|
62
62
|
#
|
|
63
|
-
#
|
|
63
|
+
# @param name [String] the symbolic ref name to read
|
|
64
|
+
# (e.g. `HEAD`)
|
|
64
65
|
#
|
|
65
|
-
#
|
|
66
|
-
# (e.g. `HEAD`)
|
|
66
|
+
# @param options [Hash] command options
|
|
67
67
|
#
|
|
68
|
-
#
|
|
68
|
+
# @option options [Boolean, nil] :quiet (nil) suppress error message
|
|
69
|
+
# when the name is not a symbolic ref
|
|
69
70
|
#
|
|
70
|
-
#
|
|
71
|
-
# when the name is not a symbolic ref
|
|
71
|
+
# Alias: :q
|
|
72
72
|
#
|
|
73
|
-
#
|
|
73
|
+
# @option options [Boolean, nil] :short (nil) shorten the ref output
|
|
74
|
+
# (e.g. `refs/heads/main` → `main`)
|
|
74
75
|
#
|
|
75
|
-
#
|
|
76
|
-
#
|
|
76
|
+
# @option options [Boolean, nil] :recurse (nil) follow chain of symbolic refs
|
|
77
|
+
# until result no longer points at a symbolic ref (`--recurse`)
|
|
77
78
|
#
|
|
78
|
-
#
|
|
79
|
-
#
|
|
79
|
+
# @option options [Boolean, nil] :no_recurse (nil) stop after a single level
|
|
80
|
+
# of dereferencing (`--no-recurse`)
|
|
80
81
|
#
|
|
81
|
-
#
|
|
82
|
-
#
|
|
82
|
+
# @return [Git::CommandLine::Result] the result of calling
|
|
83
|
+
# `git symbolic-ref`
|
|
83
84
|
#
|
|
84
|
-
#
|
|
85
|
-
# `git symbolic-ref`
|
|
85
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
86
86
|
#
|
|
87
|
-
#
|
|
87
|
+
# @raise [ArgumentError] if the name operand is missing
|
|
88
88
|
#
|
|
89
|
-
#
|
|
89
|
+
# @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
|
|
90
90
|
#
|
|
91
|
-
#
|
|
91
|
+
# @api public
|
|
92
|
+
#
|
|
93
|
+
def call(*, **)
|
|
94
|
+
super
|
|
95
|
+
end
|
|
92
96
|
end
|
|
93
97
|
end
|
|
94
98
|
end
|
|
@@ -42,34 +42,37 @@ module Git
|
|
|
42
42
|
operand :ref, required: true
|
|
43
43
|
end
|
|
44
44
|
|
|
45
|
-
#
|
|
45
|
+
# Executes the git symbolic-ref command to create or update a symbolic ref
|
|
46
46
|
#
|
|
47
|
-
#
|
|
47
|
+
# @overload call(name, ref, **options)
|
|
48
48
|
#
|
|
49
|
-
#
|
|
50
|
-
#
|
|
49
|
+
# @param name [String] the symbolic ref name to update
|
|
50
|
+
# (e.g. `HEAD`)
|
|
51
51
|
#
|
|
52
|
-
#
|
|
53
|
-
#
|
|
52
|
+
# @param ref [String] the target ref to point to
|
|
53
|
+
# (e.g. `refs/heads/main`)
|
|
54
54
|
#
|
|
55
|
-
#
|
|
56
|
-
# (e.g. `refs/heads/main`)
|
|
55
|
+
# @param options [Hash] command options
|
|
57
56
|
#
|
|
58
|
-
#
|
|
57
|
+
# @option options [String] :m (nil) a reflog message for
|
|
58
|
+
# the update
|
|
59
59
|
#
|
|
60
|
-
#
|
|
61
|
-
#
|
|
60
|
+
# @return [Git::CommandLine::Result] the result of calling
|
|
61
|
+
# `git symbolic-ref`
|
|
62
62
|
#
|
|
63
|
-
#
|
|
64
|
-
# `git symbolic-ref`
|
|
63
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
65
64
|
#
|
|
66
|
-
#
|
|
65
|
+
# @raise [ArgumentError] if the name operand is missing
|
|
67
66
|
#
|
|
68
|
-
#
|
|
67
|
+
# @raise [ArgumentError] if the ref operand is missing
|
|
69
68
|
#
|
|
70
|
-
#
|
|
69
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
71
70
|
#
|
|
72
|
-
#
|
|
71
|
+
# @api public
|
|
72
|
+
#
|
|
73
|
+
def call(*, **)
|
|
74
|
+
super
|
|
75
|
+
end
|
|
73
76
|
end
|
|
74
77
|
end
|
|
75
78
|
end
|
|
@@ -16,10 +16,6 @@ module Git
|
|
|
16
16
|
# at a given branch
|
|
17
17
|
# - {SymbolicRef::Delete} — delete a symbolic ref
|
|
18
18
|
#
|
|
19
|
-
# @api private
|
|
20
|
-
#
|
|
21
|
-
# @see https://git-scm.com/docs/git-symbolic-ref git-symbolic-ref documentation
|
|
22
|
-
#
|
|
23
19
|
# @example Read the current HEAD
|
|
24
20
|
# cmd = Git::Commands::SymbolicRef::Read.new(lib)
|
|
25
21
|
# cmd.call('HEAD')
|
|
@@ -32,6 +28,10 @@ module Git
|
|
|
32
28
|
# cmd = Git::Commands::SymbolicRef::Delete.new(lib)
|
|
33
29
|
# cmd.call('HEAD')
|
|
34
30
|
#
|
|
31
|
+
# @see https://git-scm.com/docs/git-symbolic-ref git-symbolic-ref documentation
|
|
32
|
+
#
|
|
33
|
+
# @api private
|
|
34
|
+
#
|
|
35
35
|
module SymbolicRef
|
|
36
36
|
end
|
|
37
37
|
end
|
|
@@ -54,85 +54,88 @@ module Git
|
|
|
54
54
|
operand :commit
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
-
#
|
|
57
|
+
# Executes the git tag command to create a new tag
|
|
58
58
|
#
|
|
59
|
-
#
|
|
59
|
+
# @overload call(tagname, commit = nil, **options)
|
|
60
60
|
#
|
|
61
|
-
# @
|
|
61
|
+
# @param tagname [String] the name of the tag to create
|
|
62
62
|
#
|
|
63
|
-
#
|
|
63
|
+
# @param commit [String, nil] the commit, branch, or object to tag
|
|
64
64
|
#
|
|
65
|
-
#
|
|
65
|
+
# Defaults to HEAD when omitted.
|
|
66
66
|
#
|
|
67
|
-
#
|
|
67
|
+
# @param options [Hash] command options
|
|
68
68
|
#
|
|
69
|
-
#
|
|
69
|
+
# @option options [Boolean, nil] :annotate (nil) make an unsigned, annotated tag object
|
|
70
70
|
#
|
|
71
|
-
#
|
|
71
|
+
# Requires a message via `:message` or `:file`.
|
|
72
72
|
#
|
|
73
|
-
#
|
|
73
|
+
# Alias: :a
|
|
74
74
|
#
|
|
75
|
-
#
|
|
75
|
+
# @option options [Boolean, nil] :sign (nil) make a GPG-signed tag using the default signing
|
|
76
|
+
# key (`--sign`)
|
|
76
77
|
#
|
|
77
|
-
#
|
|
78
|
-
# key (`--sign`)
|
|
78
|
+
# Requires a message via `:message` or `:file`.
|
|
79
79
|
#
|
|
80
|
-
#
|
|
80
|
+
# Alias: :s
|
|
81
81
|
#
|
|
82
|
-
#
|
|
82
|
+
# @option options [Boolean, nil] :no_sign (nil) override `tag.gpgSign` config to disable
|
|
83
|
+
# signing (`--no-sign`)
|
|
83
84
|
#
|
|
84
|
-
#
|
|
85
|
-
# signing (`--no-sign`)
|
|
85
|
+
# @option options [String] :local_user (nil) make a cryptographically signed tag using the given key
|
|
86
86
|
#
|
|
87
|
-
#
|
|
87
|
+
# Requires a message via `:message` or `:file`.
|
|
88
88
|
#
|
|
89
|
-
#
|
|
89
|
+
# Alias: :u
|
|
90
90
|
#
|
|
91
|
-
#
|
|
91
|
+
# @option options [Boolean, nil] :force (nil) replace an existing tag with the given name instead of failing
|
|
92
92
|
#
|
|
93
|
-
#
|
|
93
|
+
# Alias: :f
|
|
94
94
|
#
|
|
95
|
-
#
|
|
95
|
+
# @option options [String] :message (nil) use the given message as the tag message
|
|
96
96
|
#
|
|
97
|
-
#
|
|
97
|
+
# Implies `--annotate` if none of `--annotate`, `--sign`, or `--local-user` is given.
|
|
98
98
|
#
|
|
99
|
-
#
|
|
99
|
+
# Alias: :m
|
|
100
100
|
#
|
|
101
|
-
#
|
|
101
|
+
# @option options [String] :file (nil) take the tag message from the given file
|
|
102
102
|
#
|
|
103
|
-
#
|
|
103
|
+
# Use `-` to read from standard input. Implies `--annotate` if none of
|
|
104
|
+
# `--annotate`, `--sign`, or `--local-user` is given.
|
|
104
105
|
#
|
|
105
|
-
#
|
|
106
|
-
# `--annotate`, `--sign`, or `--local-user` is given.
|
|
106
|
+
# Alias: :F
|
|
107
107
|
#
|
|
108
|
-
#
|
|
108
|
+
# @option options [Boolean, nil] :edit (nil) open an editor to further edit the tag message (`--edit`)
|
|
109
109
|
#
|
|
110
|
-
#
|
|
110
|
+
# Alias: :e
|
|
111
111
|
#
|
|
112
|
-
#
|
|
112
|
+
# @option options [Boolean, nil] :no_edit (nil) suppress the editor (`--no-edit`)
|
|
113
113
|
#
|
|
114
|
-
#
|
|
114
|
+
# @option options [Hash, Array<Array>] :trailer (nil) add trailers to the tag message
|
|
115
115
|
#
|
|
116
|
-
#
|
|
116
|
+
# Can be a Hash `{ 'Key' => 'value' }` or Array of pairs `[['Key', 'value']]`.
|
|
117
|
+
# Multiple trailers can be specified.
|
|
117
118
|
#
|
|
118
|
-
#
|
|
119
|
-
# Multiple trailers can be specified.
|
|
119
|
+
# @option options [String] :cleanup (nil) set how the tag message is cleaned up
|
|
120
120
|
#
|
|
121
|
-
#
|
|
121
|
+
# Must be one of: `verbatim` (no changes), `whitespace` (remove leading/trailing
|
|
122
|
+
# whitespace lines), or `strip` (remove whitespace and commentary). Default is `strip`.
|
|
122
123
|
#
|
|
123
|
-
#
|
|
124
|
-
# whitespace lines), or `strip` (remove whitespace and commentary). Default is `strip`.
|
|
124
|
+
# @option options [Boolean, nil] :create_reflog (nil) create a reflog for the tag
|
|
125
125
|
#
|
|
126
|
-
#
|
|
126
|
+
# Enables date-based sha1 expressions such as `tag@{yesterday}`.
|
|
127
127
|
#
|
|
128
|
-
#
|
|
128
|
+
# @return [Git::CommandLine::Result] the result of calling `git tag`
|
|
129
129
|
#
|
|
130
|
-
#
|
|
130
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
131
131
|
#
|
|
132
|
-
#
|
|
132
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
133
133
|
#
|
|
134
|
-
#
|
|
134
|
+
# @api public
|
|
135
135
|
#
|
|
136
|
+
def call(*, **)
|
|
137
|
+
super
|
|
138
|
+
end
|
|
136
139
|
end
|
|
137
140
|
end
|
|
138
141
|
end
|
|
@@ -35,7 +35,7 @@ module Git
|
|
|
35
35
|
# git tag --delete exits with status 1 when a tag does not exist, which is acceptable
|
|
36
36
|
allow_exit_status 0..1
|
|
37
37
|
|
|
38
|
-
# @!method call(
|
|
38
|
+
# @!method call(*)
|
|
39
39
|
#
|
|
40
40
|
# @overload call(*tagname)
|
|
41
41
|
#
|
|
@@ -43,12 +43,14 @@ module Git
|
|
|
43
43
|
#
|
|
44
44
|
# @param tagname [Array<String>] one or more tag names to delete
|
|
45
45
|
#
|
|
46
|
-
# @return [Git::
|
|
46
|
+
# @return [Git::CommandLine::Result] the result of calling `git tag --delete`
|
|
47
47
|
#
|
|
48
|
-
# @raise [ArgumentError] if no tag names are provided
|
|
48
|
+
# @raise [ArgumentError] if no tag names are provided
|
|
49
49
|
#
|
|
50
50
|
# @raise [Git::FailedError] if git exits outside the allowed range (exit code > 1)
|
|
51
51
|
#
|
|
52
|
+
# @api public
|
|
53
|
+
#
|
|
52
54
|
end
|
|
53
55
|
end
|
|
54
56
|
end
|