git 4.3.2 → 5.0.0.beta.1
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/.github/copilot-instructions.md +67 -2705
- data/.github/pull_request_template.md +3 -1
- data/.github/skills/breaking-change-analysis/SKILL.md +102 -0
- data/.github/skills/ci-cd-troubleshooting/SKILL.md +264 -0
- data/.github/skills/command-implementation/REFERENCE.md +993 -0
- data/.github/skills/command-implementation/SKILL.md +229 -0
- data/.github/skills/command-test-conventions/SKILL.md +660 -0
- data/.github/skills/command-yard-documentation/SKILL.md +426 -0
- data/.github/skills/dependency-management/SKILL.md +72 -0
- data/.github/skills/development-workflow/SKILL.md +506 -0
- data/.github/skills/extract-command-from-lib/SKILL.md +487 -0
- data/.github/skills/extract-facade-from-base-lib/SKILL.md +586 -0
- data/.github/skills/facade-implementation/REFERENCE.md +840 -0
- data/.github/skills/facade-implementation/SKILL.md +260 -0
- data/.github/skills/facade-test-conventions/SKILL.md +380 -0
- data/.github/skills/facade-yard-documentation/SKILL.md +429 -0
- data/.github/skills/make-skill-template/SKILL.md +176 -0
- data/.github/skills/pr-readiness-review/SKILL.md +185 -0
- data/.github/skills/project-context/SKILL.md +313 -0
- data/.github/skills/pull-request-review/SKILL.md +168 -0
- data/.github/skills/refactor-command-to-commandlineresult/SKILL.md +131 -0
- data/.github/skills/release-management/SKILL.md +125 -0
- data/.github/skills/review-arguments-dsl/CHECKLIST.md +788 -0
- data/.github/skills/review-arguments-dsl/SKILL.md +214 -0
- data/.github/skills/review-backward-compatibility/SKILL.md +275 -0
- data/.github/skills/review-cross-command-consistency/SKILL.md +139 -0
- data/.github/skills/reviewing-skills/SKILL.md +189 -0
- data/.github/skills/rspec-unit-testing-standards/SKILL.md +639 -0
- data/.github/skills/tdd-refactor-step/SKILL.md +236 -0
- data/.github/skills/test-debugging/SKILL.md +160 -0
- data/.github/skills/yard-documentation/SKILL.md +793 -0
- data/.github/workflows/continuous_integration.yml +3 -2
- data/.github/workflows/enforce_conventional_commits.yml +1 -1
- data/.github/workflows/experimental_continuous_integration.yml +2 -2
- data/.github/workflows/release.yml +3 -4
- data/.gitignore +8 -0
- data/.husky/pre-commit +13 -0
- data/.release-please-manifest.json +1 -1
- data/.rspec +3 -0
- data/.rubocop.yml +7 -3
- data/.rubocop_todo.yml +23 -5
- data/.yardopts +1 -0
- data/CHANGELOG.md +0 -40
- data/CONTRIBUTING.md +694 -53
- data/README.md +17 -5
- data/Rakefile +61 -9
- data/commitlint.test +4 -0
- data/git.gemspec +14 -8
- data/lib/git/args_builder.rb +0 -8
- data/lib/git/base.rb +486 -410
- data/lib/git/branch.rb +380 -43
- data/lib/git/branch_delete_failure.rb +31 -0
- data/lib/git/branch_delete_result.rb +63 -0
- data/lib/git/branch_info.rb +178 -0
- data/lib/git/branches.rb +130 -24
- data/lib/git/command_line/base.rb +245 -0
- data/lib/git/command_line/capturing.rb +249 -0
- data/lib/git/command_line/result.rb +96 -0
- data/lib/git/command_line/streaming.rb +194 -0
- data/lib/git/command_line.rb +43 -322
- data/lib/git/command_line_result.rb +4 -88
- data/lib/git/commands/add.rb +131 -0
- data/lib/git/commands/am/abort.rb +43 -0
- data/lib/git/commands/am/apply.rb +252 -0
- data/lib/git/commands/am/continue.rb +43 -0
- data/lib/git/commands/am/quit.rb +43 -0
- data/lib/git/commands/am/retry.rb +47 -0
- data/lib/git/commands/am/show_current_patch.rb +64 -0
- data/lib/git/commands/am/skip.rb +42 -0
- data/lib/git/commands/am.rb +33 -0
- data/lib/git/commands/apply.rb +237 -0
- data/lib/git/commands/archive/list_formats.rb +46 -0
- data/lib/git/commands/archive.rb +140 -0
- data/lib/git/commands/arguments.rb +3510 -0
- data/lib/git/commands/base.rb +403 -0
- data/lib/git/commands/branch/copy.rb +94 -0
- data/lib/git/commands/branch/create.rb +173 -0
- data/lib/git/commands/branch/delete.rb +80 -0
- data/lib/git/commands/branch/list.rb +162 -0
- data/lib/git/commands/branch/move.rb +94 -0
- data/lib/git/commands/branch/set_upstream.rb +86 -0
- data/lib/git/commands/branch/show_current.rb +49 -0
- data/lib/git/commands/branch/unset_upstream.rb +57 -0
- data/lib/git/commands/branch.rb +34 -0
- data/lib/git/commands/cat_file/batch.rb +364 -0
- data/lib/git/commands/cat_file/filtered.rb +105 -0
- data/lib/git/commands/cat_file/raw.rb +210 -0
- data/lib/git/commands/cat_file.rb +49 -0
- data/lib/git/commands/checkout/branch.rb +151 -0
- data/lib/git/commands/checkout/files.rb +115 -0
- data/lib/git/commands/checkout.rb +38 -0
- data/lib/git/commands/checkout_index.rb +105 -0
- data/lib/git/commands/clean.rb +100 -0
- data/lib/git/commands/clone.rb +240 -0
- data/lib/git/commands/commit.rb +272 -0
- data/lib/git/commands/commit_tree.rb +100 -0
- data/lib/git/commands/config_option_syntax/add.rb +83 -0
- data/lib/git/commands/config_option_syntax/get.rb +117 -0
- data/lib/git/commands/config_option_syntax/get_all.rb +115 -0
- data/lib/git/commands/config_option_syntax/get_color.rb +91 -0
- data/lib/git/commands/config_option_syntax/get_color_bool.rb +93 -0
- data/lib/git/commands/config_option_syntax/get_regexp.rb +115 -0
- data/lib/git/commands/config_option_syntax/get_urlmatch.rb +102 -0
- data/lib/git/commands/config_option_syntax/list.rb +107 -0
- data/lib/git/commands/config_option_syntax/remove_section.rb +74 -0
- data/lib/git/commands/config_option_syntax/rename_section.rb +78 -0
- data/lib/git/commands/config_option_syntax/replace_all.rb +104 -0
- data/lib/git/commands/config_option_syntax/set.rb +114 -0
- data/lib/git/commands/config_option_syntax/unset.rb +89 -0
- data/lib/git/commands/config_option_syntax/unset_all.rb +89 -0
- data/lib/git/commands/config_option_syntax.rb +56 -0
- data/lib/git/commands/describe.rb +155 -0
- data/lib/git/commands/diff.rb +656 -0
- data/lib/git/commands/diff_files.rb +518 -0
- data/lib/git/commands/diff_index.rb +496 -0
- data/lib/git/commands/fetch.rb +352 -0
- data/lib/git/commands/fsck.rb +136 -0
- data/lib/git/commands/gc.rb +132 -0
- data/lib/git/commands/grep.rb +338 -0
- data/lib/git/commands/init.rb +99 -0
- data/lib/git/commands/log.rb +632 -0
- data/lib/git/commands/ls_files.rb +191 -0
- data/lib/git/commands/ls_remote.rb +155 -0
- data/lib/git/commands/ls_tree.rb +131 -0
- data/lib/git/commands/maintenance/register.rb +75 -0
- data/lib/git/commands/maintenance/run.rb +104 -0
- data/lib/git/commands/maintenance/start.rb +66 -0
- data/lib/git/commands/maintenance/stop.rb +55 -0
- data/lib/git/commands/maintenance/unregister.rb +79 -0
- data/lib/git/commands/maintenance.rb +31 -0
- data/lib/git/commands/merge/abort.rb +44 -0
- data/lib/git/commands/merge/continue.rb +44 -0
- data/lib/git/commands/merge/quit.rb +46 -0
- data/lib/git/commands/merge/start.rb +245 -0
- data/lib/git/commands/merge.rb +28 -0
- data/lib/git/commands/merge_base.rb +86 -0
- data/lib/git/commands/mv.rb +77 -0
- data/lib/git/commands/name_rev.rb +114 -0
- data/lib/git/commands/pull.rb +377 -0
- data/lib/git/commands/push.rb +246 -0
- data/lib/git/commands/read_tree.rb +149 -0
- data/lib/git/commands/remote/add.rb +91 -0
- data/lib/git/commands/remote/get_url.rb +66 -0
- data/lib/git/commands/remote/list.rb +54 -0
- data/lib/git/commands/remote/prune.rb +61 -0
- data/lib/git/commands/remote/remove.rb +52 -0
- data/lib/git/commands/remote/rename.rb +69 -0
- data/lib/git/commands/remote/set_branches.rb +63 -0
- data/lib/git/commands/remote/set_head.rb +82 -0
- data/lib/git/commands/remote/set_url.rb +71 -0
- data/lib/git/commands/remote/set_url_add.rb +61 -0
- data/lib/git/commands/remote/set_url_delete.rb +64 -0
- data/lib/git/commands/remote/show.rb +71 -0
- data/lib/git/commands/remote/update.rb +72 -0
- data/lib/git/commands/remote.rb +42 -0
- data/lib/git/commands/repack.rb +277 -0
- data/lib/git/commands/reset.rb +147 -0
- data/lib/git/commands/rev_parse.rb +297 -0
- data/lib/git/commands/revert/abort.rb +45 -0
- data/lib/git/commands/revert/continue.rb +57 -0
- data/lib/git/commands/revert/quit.rb +47 -0
- data/lib/git/commands/revert/skip.rb +44 -0
- data/lib/git/commands/revert/start.rb +153 -0
- data/lib/git/commands/revert.rb +29 -0
- data/lib/git/commands/rm.rb +114 -0
- data/lib/git/commands/show.rb +632 -0
- data/lib/git/commands/show_ref/exclude_existing.rb +120 -0
- data/lib/git/commands/show_ref/exists.rb +78 -0
- data/lib/git/commands/show_ref/list.rb +145 -0
- data/lib/git/commands/show_ref/verify.rb +120 -0
- data/lib/git/commands/show_ref.rb +42 -0
- data/lib/git/commands/stash/apply.rb +75 -0
- data/lib/git/commands/stash/branch.rb +65 -0
- data/lib/git/commands/stash/clear.rb +41 -0
- data/lib/git/commands/stash/create.rb +58 -0
- data/lib/git/commands/stash/drop.rb +67 -0
- data/lib/git/commands/stash/list.rb +39 -0
- data/lib/git/commands/stash/pop.rb +78 -0
- data/lib/git/commands/stash/push.rb +103 -0
- data/lib/git/commands/stash/show.rb +149 -0
- data/lib/git/commands/stash/store.rb +63 -0
- data/lib/git/commands/stash.rb +38 -0
- data/lib/git/commands/status.rb +169 -0
- data/lib/git/commands/symbolic_ref/delete.rb +68 -0
- data/lib/git/commands/symbolic_ref/read.rb +95 -0
- data/lib/git/commands/symbolic_ref/update.rb +76 -0
- data/lib/git/commands/symbolic_ref.rb +38 -0
- data/lib/git/commands/tag/create.rb +139 -0
- data/lib/git/commands/tag/delete.rb +55 -0
- data/lib/git/commands/tag/list.rb +143 -0
- data/lib/git/commands/tag/verify.rb +71 -0
- data/lib/git/commands/tag.rb +26 -0
- data/lib/git/commands/update_ref/batch.rb +140 -0
- data/lib/git/commands/update_ref/delete.rb +92 -0
- data/lib/git/commands/update_ref/update.rb +106 -0
- data/lib/git/commands/update_ref.rb +42 -0
- data/lib/git/commands/version.rb +52 -0
- data/lib/git/commands/worktree/add.rb +140 -0
- data/lib/git/commands/worktree/list.rb +64 -0
- data/lib/git/commands/worktree/lock.rb +58 -0
- data/lib/git/commands/worktree/management_base.rb +51 -0
- data/lib/git/commands/worktree/move.rb +66 -0
- data/lib/git/commands/worktree/prune.rb +67 -0
- data/lib/git/commands/worktree/remove.rb +63 -0
- data/lib/git/commands/worktree/repair.rb +76 -0
- data/lib/git/commands/worktree/unlock.rb +47 -0
- data/lib/git/commands/worktree.rb +43 -0
- data/lib/git/commands/write_tree.rb +68 -0
- data/lib/git/commands.rb +89 -0
- data/lib/git/detached_head_info.rb +54 -0
- data/lib/git/diff.rb +297 -7
- data/lib/git/diff_file_numstat_info.rb +29 -0
- data/lib/git/diff_file_patch_info.rb +134 -0
- data/lib/git/diff_file_raw_info.rb +127 -0
- data/lib/git/diff_info.rb +169 -0
- data/lib/git/diff_path_status.rb +78 -19
- data/lib/git/diff_result.rb +32 -0
- data/lib/git/diff_stats.rb +59 -14
- data/lib/git/dirstat_info.rb +86 -0
- data/lib/git/errors.rb +65 -2
- data/lib/git/execution_context/global.rb +56 -0
- data/lib/git/execution_context/repository.rb +147 -0
- data/lib/git/execution_context.rb +482 -0
- data/lib/git/file_ref.rb +74 -0
- data/lib/git/fsck_object.rb +9 -9
- data/lib/git/fsck_result.rb +1 -1
- data/lib/git/lib.rb +1606 -1028
- data/lib/git/log.rb +15 -2
- data/lib/git/object.rb +92 -22
- data/lib/git/parsers/branch.rb +224 -0
- data/lib/git/parsers/cat_file.rb +111 -0
- data/lib/git/parsers/diff.rb +585 -0
- data/lib/git/parsers/fsck.rb +133 -0
- data/lib/git/parsers/grep.rb +42 -0
- data/lib/git/parsers/ls_tree.rb +58 -0
- data/lib/git/parsers/stash.rb +208 -0
- data/lib/git/parsers/tag.rb +257 -0
- data/lib/git/remote.rb +133 -9
- data/lib/git/repository/branching.rb +572 -0
- data/lib/git/repository/committing.rb +191 -0
- data/lib/git/repository/configuring.rb +156 -0
- data/lib/git/repository/diffing.rb +775 -0
- data/lib/git/repository/inspecting.rb +153 -0
- data/lib/git/repository/logging.rb +247 -0
- data/lib/git/repository/merging.rb +295 -0
- data/lib/git/repository/object_operations.rb +1101 -0
- data/lib/git/repository/path_resolver.rb +207 -0
- data/lib/git/repository/remote_operations.rb +753 -0
- data/lib/git/repository/shared_private.rb +51 -0
- data/lib/git/repository/staging.rb +390 -0
- data/lib/git/repository/stashing.rb +107 -0
- data/lib/git/repository/status_operations.rb +180 -0
- data/lib/git/repository/worktree_operations.rb +159 -0
- data/lib/git/repository.rb +264 -1
- data/lib/git/stash.rb +85 -4
- data/lib/git/stash_info.rb +104 -0
- data/lib/git/stashes.rb +130 -13
- data/lib/git/status.rb +224 -18
- data/lib/git/tag_delete_failure.rb +31 -0
- data/lib/git/tag_delete_result.rb +63 -0
- data/lib/git/tag_info.rb +105 -0
- data/lib/git/version.rb +109 -2
- data/lib/git/version_constraint.rb +81 -0
- data/lib/git/worktree.rb +120 -5
- data/lib/git/worktrees.rb +107 -7
- data/lib/git.rb +114 -18
- data/redesign/1_architecture_existing.md +54 -18
- data/redesign/2_architecture_redesign.md +365 -46
- data/redesign/3_architecture_implementation.md +1451 -54
- data/tasks/gem_tasks.rake +4 -0
- data/tasks/npm_tasks.rake +7 -0
- data/tasks/rspec.rake +48 -0
- data/tasks/test.rake +13 -1
- data/tasks/yard.rake +34 -7
- metadata +349 -20
- data/lib/git/index.rb +0 -6
- data/lib/git/path.rb +0 -38
- data/lib/git/working_directory.rb +0 -6
- /data/{release-please-config.json → .release-please-config.json} +0 -0
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote remove` command
|
|
9
|
+
#
|
|
10
|
+
# Removes a remote and its associated tracking refs and configuration.
|
|
11
|
+
#
|
|
12
|
+
# @example Remove a remote
|
|
13
|
+
# remove = Git::Commands::Remote::Remove.new(execution_context)
|
|
14
|
+
# remove.call('origin')
|
|
15
|
+
#
|
|
16
|
+
# @example Remove a remote with a name that looks like a flag
|
|
17
|
+
# remove = Git::Commands::Remote::Remove.new(execution_context)
|
|
18
|
+
# remove.call('-weirdremote')
|
|
19
|
+
#
|
|
20
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
21
|
+
#
|
|
22
|
+
# @see Git::Commands::Remote
|
|
23
|
+
#
|
|
24
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
25
|
+
#
|
|
26
|
+
# @api private
|
|
27
|
+
#
|
|
28
|
+
class Remove < Git::Commands::Base
|
|
29
|
+
arguments do
|
|
30
|
+
literal 'remote'
|
|
31
|
+
literal 'remove'
|
|
32
|
+
|
|
33
|
+
end_of_options
|
|
34
|
+
|
|
35
|
+
operand :name, required: true
|
|
36
|
+
end
|
|
37
|
+
|
|
38
|
+
# @!method call(*, **)
|
|
39
|
+
#
|
|
40
|
+
# @overload call(name)
|
|
41
|
+
#
|
|
42
|
+
# Execute the `git remote remove` command
|
|
43
|
+
#
|
|
44
|
+
# @param name [String] the remote name to remove
|
|
45
|
+
#
|
|
46
|
+
# @return [Git::CommandLineResult] the result of calling `git remote remove`
|
|
47
|
+
#
|
|
48
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
49
|
+
end
|
|
50
|
+
end
|
|
51
|
+
end
|
|
52
|
+
end
|
|
@@ -0,0 +1,69 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote rename` command
|
|
9
|
+
#
|
|
10
|
+
# Renames a remote and updates all its remote-tracking branches and
|
|
11
|
+
# configuration settings.
|
|
12
|
+
#
|
|
13
|
+
# @example Rename a remote
|
|
14
|
+
# rename = Git::Commands::Remote::Rename.new(execution_context)
|
|
15
|
+
# rename.call('origin', 'upstream')
|
|
16
|
+
#
|
|
17
|
+
# @example Rename a remote with progress reporting
|
|
18
|
+
# rename = Git::Commands::Remote::Rename.new(execution_context)
|
|
19
|
+
# rename.call('origin', 'upstream', progress: true)
|
|
20
|
+
#
|
|
21
|
+
# @example Suppress progress output during rename
|
|
22
|
+
# rename = Git::Commands::Remote::Rename.new(execution_context)
|
|
23
|
+
# rename.call('origin', 'upstream', no_progress: true)
|
|
24
|
+
#
|
|
25
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
26
|
+
#
|
|
27
|
+
# @see Git::Commands::Remote
|
|
28
|
+
#
|
|
29
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
30
|
+
#
|
|
31
|
+
# @api private
|
|
32
|
+
#
|
|
33
|
+
class Rename < Git::Commands::Base
|
|
34
|
+
arguments do
|
|
35
|
+
literal 'remote'
|
|
36
|
+
literal 'rename'
|
|
37
|
+
flag_option :progress, negatable: true
|
|
38
|
+
|
|
39
|
+
end_of_options
|
|
40
|
+
|
|
41
|
+
operand :old, required: true
|
|
42
|
+
operand :new, required: true
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @!method call(*, **)
|
|
46
|
+
#
|
|
47
|
+
# @overload call(old, new, **options)
|
|
48
|
+
#
|
|
49
|
+
# Execute the `git remote rename` command
|
|
50
|
+
#
|
|
51
|
+
# @param old [String] the current remote name
|
|
52
|
+
#
|
|
53
|
+
# @param new [String] the new remote name
|
|
54
|
+
#
|
|
55
|
+
# @param options [Hash] command options
|
|
56
|
+
#
|
|
57
|
+
# @option options [Boolean, nil] :progress (nil) enable progress reporting (`--progress`)
|
|
58
|
+
#
|
|
59
|
+
# @option options [Boolean, nil] :no_progress (nil) suppress progress output (`--no-progress`)
|
|
60
|
+
#
|
|
61
|
+
# @return [Git::CommandLineResult] the result of calling `git remote rename`
|
|
62
|
+
#
|
|
63
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
64
|
+
#
|
|
65
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
66
|
+
end
|
|
67
|
+
end
|
|
68
|
+
end
|
|
69
|
+
end
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote set-branches` command
|
|
9
|
+
#
|
|
10
|
+
# Changes the list of branches tracked for the named remote. This can be used
|
|
11
|
+
# to track a subset of the available remote branches after the initial setup.
|
|
12
|
+
#
|
|
13
|
+
# @example Set the tracked branches for a remote
|
|
14
|
+
# set_branches = Git::Commands::Remote::SetBranches.new(execution_context)
|
|
15
|
+
# set_branches.call('origin', 'main', 'develop')
|
|
16
|
+
#
|
|
17
|
+
# @example Append additional tracked branches without replacing existing ones
|
|
18
|
+
# set_branches = Git::Commands::Remote::SetBranches.new(execution_context)
|
|
19
|
+
# set_branches.call('origin', 'release/*', add: true)
|
|
20
|
+
#
|
|
21
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
22
|
+
#
|
|
23
|
+
# @see Git::Commands::Remote
|
|
24
|
+
#
|
|
25
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
26
|
+
#
|
|
27
|
+
# @api private
|
|
28
|
+
#
|
|
29
|
+
class SetBranches < Git::Commands::Base
|
|
30
|
+
arguments do
|
|
31
|
+
literal 'remote'
|
|
32
|
+
literal 'set-branches'
|
|
33
|
+
flag_option :add
|
|
34
|
+
|
|
35
|
+
end_of_options
|
|
36
|
+
|
|
37
|
+
operand :name, required: true
|
|
38
|
+
operand :branch, repeatable: true, required: true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @!method call(*, **)
|
|
42
|
+
#
|
|
43
|
+
# @overload call(name, *branch, **options)
|
|
44
|
+
#
|
|
45
|
+
# Execute the `git remote set-branches` command
|
|
46
|
+
#
|
|
47
|
+
# @param name [String] the remote name to update
|
|
48
|
+
#
|
|
49
|
+
# @param branch [Array<String>] one or more branch names or glob patterns to track
|
|
50
|
+
#
|
|
51
|
+
# @param options [Hash] command options
|
|
52
|
+
#
|
|
53
|
+
# @option options [Boolean, nil] :add (nil) append the given branches instead of replacing them
|
|
54
|
+
#
|
|
55
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-branches`
|
|
56
|
+
#
|
|
57
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
58
|
+
#
|
|
59
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
60
|
+
end
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote set-head` command
|
|
9
|
+
#
|
|
10
|
+
# Sets or deletes the default branch (symbolic HEAD) for the named remote.
|
|
11
|
+
#
|
|
12
|
+
# @example Set the remote HEAD to a specific branch
|
|
13
|
+
# set_head = Git::Commands::Remote::SetHead.new(execution_context)
|
|
14
|
+
# set_head.call('origin', 'main')
|
|
15
|
+
#
|
|
16
|
+
# @example Auto-detect the remote HEAD by querying the remote
|
|
17
|
+
# set_head = Git::Commands::Remote::SetHead.new(execution_context)
|
|
18
|
+
# set_head.call('origin', auto: true)
|
|
19
|
+
#
|
|
20
|
+
# @example Delete the remote HEAD symbolic ref
|
|
21
|
+
# set_head = Git::Commands::Remote::SetHead.new(execution_context)
|
|
22
|
+
# set_head.call('origin', delete: true)
|
|
23
|
+
#
|
|
24
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
25
|
+
#
|
|
26
|
+
# @see Git::Commands::Remote
|
|
27
|
+
#
|
|
28
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
29
|
+
#
|
|
30
|
+
# @api private
|
|
31
|
+
#
|
|
32
|
+
class SetHead < Git::Commands::Base
|
|
33
|
+
arguments do
|
|
34
|
+
literal 'remote'
|
|
35
|
+
literal 'set-head'
|
|
36
|
+
operand :name, required: true
|
|
37
|
+
flag_option %i[auto a]
|
|
38
|
+
flag_option %i[delete d]
|
|
39
|
+
operand :branch
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @!method call(*, **)
|
|
43
|
+
#
|
|
44
|
+
# @overload call(name, branch)
|
|
45
|
+
#
|
|
46
|
+
# Set the remote's HEAD symbolic ref to a specific branch
|
|
47
|
+
#
|
|
48
|
+
# @param name [String] the remote name to update
|
|
49
|
+
#
|
|
50
|
+
# @param branch [String] the branch to set as the remote HEAD
|
|
51
|
+
#
|
|
52
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-head`
|
|
53
|
+
#
|
|
54
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
55
|
+
#
|
|
56
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
57
|
+
#
|
|
58
|
+
# @overload call(name, **options)
|
|
59
|
+
#
|
|
60
|
+
# Detect or delete the remote's HEAD symbolic ref
|
|
61
|
+
#
|
|
62
|
+
# @param name [String] the remote name to update
|
|
63
|
+
#
|
|
64
|
+
# @param options [Hash] command options
|
|
65
|
+
#
|
|
66
|
+
# @option options [Boolean, nil] :auto (nil) detect the remote HEAD by querying the remote
|
|
67
|
+
#
|
|
68
|
+
# Mutually exclusive with `:delete`. Alias: :a
|
|
69
|
+
#
|
|
70
|
+
# @option options [Boolean, nil] :delete (nil) delete the configured remote HEAD symbolic ref
|
|
71
|
+
#
|
|
72
|
+
# Mutually exclusive with `:auto`. Alias: :d
|
|
73
|
+
#
|
|
74
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-head`
|
|
75
|
+
#
|
|
76
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
77
|
+
#
|
|
78
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
79
|
+
end
|
|
80
|
+
end
|
|
81
|
+
end
|
|
82
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote set-url` command
|
|
9
|
+
#
|
|
10
|
+
# Replaces a URL in the named remote's configuration. Sets the first URL
|
|
11
|
+
# for the remote matching regex <oldurl> (or the first URL if no <oldurl>
|
|
12
|
+
# is given) to <newurl>.
|
|
13
|
+
#
|
|
14
|
+
# @example Replace the fetch URL for a remote
|
|
15
|
+
# set_url = Git::Commands::Remote::SetUrl.new(execution_context)
|
|
16
|
+
# set_url.call('origin', 'https://example.com/repo.git')
|
|
17
|
+
#
|
|
18
|
+
# @example Replace the push URL for a remote
|
|
19
|
+
# set_url = Git::Commands::Remote::SetUrl.new(execution_context)
|
|
20
|
+
# set_url.call('origin', 'https://example.com/repo.git', push: true)
|
|
21
|
+
#
|
|
22
|
+
# @example Replace a URL matching a regex
|
|
23
|
+
# set_url = Git::Commands::Remote::SetUrl.new(execution_context)
|
|
24
|
+
# set_url.call('origin', 'https://new.example.com/repo.git', 'old.example.com')
|
|
25
|
+
#
|
|
26
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
27
|
+
#
|
|
28
|
+
# @see Git::Commands::Remote
|
|
29
|
+
#
|
|
30
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
31
|
+
#
|
|
32
|
+
# @api private
|
|
33
|
+
#
|
|
34
|
+
class SetUrl < Git::Commands::Base
|
|
35
|
+
arguments do
|
|
36
|
+
literal 'remote'
|
|
37
|
+
literal 'set-url'
|
|
38
|
+
flag_option :push
|
|
39
|
+
|
|
40
|
+
end_of_options
|
|
41
|
+
|
|
42
|
+
operand :name, required: true
|
|
43
|
+
operand :newurl, required: true
|
|
44
|
+
operand :oldurl
|
|
45
|
+
end
|
|
46
|
+
|
|
47
|
+
# @!method call(*, **)
|
|
48
|
+
#
|
|
49
|
+
# @overload call(name, newurl, oldurl = nil, **options)
|
|
50
|
+
#
|
|
51
|
+
# Execute the `git remote set-url` command
|
|
52
|
+
#
|
|
53
|
+
# @param name [String] the remote name to update
|
|
54
|
+
#
|
|
55
|
+
# @param newurl [String] the replacement URL
|
|
56
|
+
#
|
|
57
|
+
# @param oldurl [String, nil] a regex matching the existing URL to replace
|
|
58
|
+
#
|
|
59
|
+
# @param options [Hash] command options
|
|
60
|
+
#
|
|
61
|
+
# @option options [Boolean, nil] :push (nil) update push URLs instead of fetch URLs
|
|
62
|
+
#
|
|
63
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-url`
|
|
64
|
+
#
|
|
65
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
66
|
+
#
|
|
67
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote set-url --add` command
|
|
9
|
+
#
|
|
10
|
+
# Appends a new URL to the named remote's fetch or push URL list.
|
|
11
|
+
#
|
|
12
|
+
# @example Add an additional fetch URL to an existing remote
|
|
13
|
+
# set_url_add = Git::Commands::Remote::SetUrlAdd.new(execution_context)
|
|
14
|
+
# set_url_add.call('origin', 'https://mirror.example.com/repo.git')
|
|
15
|
+
#
|
|
16
|
+
# @example Add a push URL to an existing remote
|
|
17
|
+
# set_url_add = Git::Commands::Remote::SetUrlAdd.new(execution_context)
|
|
18
|
+
# set_url_add.call('origin', 'https://push.example.com/repo.git', push: true)
|
|
19
|
+
#
|
|
20
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
21
|
+
#
|
|
22
|
+
# @see Git::Commands::Remote
|
|
23
|
+
#
|
|
24
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
25
|
+
#
|
|
26
|
+
# @api private
|
|
27
|
+
#
|
|
28
|
+
class SetUrlAdd < Git::Commands::Base
|
|
29
|
+
arguments do
|
|
30
|
+
literal 'remote'
|
|
31
|
+
literal 'set-url'
|
|
32
|
+
literal '--add'
|
|
33
|
+
flag_option :push
|
|
34
|
+
|
|
35
|
+
end_of_options
|
|
36
|
+
|
|
37
|
+
operand :name, required: true
|
|
38
|
+
operand :newurl, required: true
|
|
39
|
+
end
|
|
40
|
+
|
|
41
|
+
# @!method call(*, **)
|
|
42
|
+
#
|
|
43
|
+
# @overload call(name, newurl, **options)
|
|
44
|
+
#
|
|
45
|
+
# Execute the `git remote set-url --add` command
|
|
46
|
+
#
|
|
47
|
+
# @param name [String] the remote name to update
|
|
48
|
+
#
|
|
49
|
+
# @param newurl [String] the URL to append
|
|
50
|
+
#
|
|
51
|
+
# @param options [Hash] command options
|
|
52
|
+
#
|
|
53
|
+
# @option options [Boolean, nil] :push (nil) add a push URL instead of a fetch URL
|
|
54
|
+
#
|
|
55
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-url --add`
|
|
56
|
+
#
|
|
57
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
58
|
+
end
|
|
59
|
+
end
|
|
60
|
+
end
|
|
61
|
+
end
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote set-url --delete` command
|
|
9
|
+
#
|
|
10
|
+
# Removes all URLs matching a regex from the named remote's configured URL list.
|
|
11
|
+
# By default operates on fetch URLs; pass `push: true` to target push URLs instead.
|
|
12
|
+
#
|
|
13
|
+
# @example Delete a fetch URL matching a pattern
|
|
14
|
+
# set_url_delete = Git::Commands::Remote::SetUrlDelete.new(execution_context)
|
|
15
|
+
# set_url_delete.call('origin', 'github')
|
|
16
|
+
#
|
|
17
|
+
# @example Delete a push URL matching a pattern
|
|
18
|
+
# set_url_delete = Git::Commands::Remote::SetUrlDelete.new(execution_context)
|
|
19
|
+
# set_url_delete.call('origin', 'github', push: true)
|
|
20
|
+
#
|
|
21
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
22
|
+
#
|
|
23
|
+
# @see Git::Commands::Remote
|
|
24
|
+
#
|
|
25
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
26
|
+
#
|
|
27
|
+
# @api private
|
|
28
|
+
#
|
|
29
|
+
class SetUrlDelete < Git::Commands::Base
|
|
30
|
+
arguments do
|
|
31
|
+
literal 'remote'
|
|
32
|
+
literal 'set-url'
|
|
33
|
+
literal '--delete'
|
|
34
|
+
flag_option :push
|
|
35
|
+
|
|
36
|
+
end_of_options
|
|
37
|
+
|
|
38
|
+
operand :name, required: true
|
|
39
|
+
operand :url, required: true
|
|
40
|
+
end
|
|
41
|
+
|
|
42
|
+
# @!method call(*, **)
|
|
43
|
+
#
|
|
44
|
+
# @overload call(name, url, **options)
|
|
45
|
+
#
|
|
46
|
+
# Execute the `git remote set-url --delete` command
|
|
47
|
+
#
|
|
48
|
+
# @param name [String] the remote name to update
|
|
49
|
+
#
|
|
50
|
+
# @param url [String] a regex selecting the URL or URLs to delete
|
|
51
|
+
#
|
|
52
|
+
# @param options [Hash] command options
|
|
53
|
+
#
|
|
54
|
+
# @option options [Boolean, nil] :push (nil) delete push URLs instead of fetch URLs
|
|
55
|
+
#
|
|
56
|
+
# @return [Git::CommandLineResult] the result of calling `git remote set-url --delete`
|
|
57
|
+
#
|
|
58
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
59
|
+
#
|
|
60
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
61
|
+
end
|
|
62
|
+
end
|
|
63
|
+
end
|
|
64
|
+
end
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote show` command
|
|
9
|
+
#
|
|
10
|
+
# Shows information about one or more remotes, including fetch and push URLs
|
|
11
|
+
# and branch tracking information.
|
|
12
|
+
#
|
|
13
|
+
# @example Show information about a remote
|
|
14
|
+
# show = Git::Commands::Remote::Show.new(execution_context)
|
|
15
|
+
# show.call('origin')
|
|
16
|
+
#
|
|
17
|
+
# @example Show cached information without contacting the remote
|
|
18
|
+
# show = Git::Commands::Remote::Show.new(execution_context)
|
|
19
|
+
# show.call('origin', n: true)
|
|
20
|
+
#
|
|
21
|
+
# @example Show verbose output for multiple remotes
|
|
22
|
+
# show = Git::Commands::Remote::Show.new(execution_context)
|
|
23
|
+
# show.call('origin', 'upstream', verbose: true)
|
|
24
|
+
#
|
|
25
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
26
|
+
#
|
|
27
|
+
# @see Git::Commands::Remote
|
|
28
|
+
#
|
|
29
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
30
|
+
#
|
|
31
|
+
# @api private
|
|
32
|
+
#
|
|
33
|
+
class Show < Git::Commands::Base
|
|
34
|
+
arguments do
|
|
35
|
+
literal 'remote'
|
|
36
|
+
flag_option %i[verbose v]
|
|
37
|
+
literal 'show'
|
|
38
|
+
flag_option :n
|
|
39
|
+
|
|
40
|
+
end_of_options
|
|
41
|
+
|
|
42
|
+
operand :name, repeatable: true, required: true
|
|
43
|
+
end
|
|
44
|
+
|
|
45
|
+
# @!method call(*, **)
|
|
46
|
+
#
|
|
47
|
+
# @overload call(*name, **options)
|
|
48
|
+
#
|
|
49
|
+
# Execute the `git remote show` command
|
|
50
|
+
#
|
|
51
|
+
# @param name [Array<String>] one or more remote names to inspect
|
|
52
|
+
#
|
|
53
|
+
# @param options [Hash] command options
|
|
54
|
+
#
|
|
55
|
+
# @option options [Boolean, nil] :verbose (nil) show the remote URL after the remote name
|
|
56
|
+
#
|
|
57
|
+
# Alias: :v
|
|
58
|
+
#
|
|
59
|
+
# @option options [Boolean, nil] :n (nil) do not query remote heads with `git ls-remote`
|
|
60
|
+
#
|
|
61
|
+
# Uses cached information instead of contacting the remote server.
|
|
62
|
+
#
|
|
63
|
+
# @return [Git::CommandLineResult] the result of calling `git remote show`
|
|
64
|
+
#
|
|
65
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
66
|
+
#
|
|
67
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
68
|
+
end
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require 'git/commands/base'
|
|
4
|
+
|
|
5
|
+
module Git
|
|
6
|
+
module Commands
|
|
7
|
+
module Remote
|
|
8
|
+
# `git remote update` command
|
|
9
|
+
#
|
|
10
|
+
# Fetches updates for remotes or remote groups in the repository. When neither
|
|
11
|
+
# a remote nor a group is specified, updates all remotes that are not marked
|
|
12
|
+
# with `remote.<name>.skipDefaultUpdate`.
|
|
13
|
+
#
|
|
14
|
+
# @example Fetch updates for all configured remotes
|
|
15
|
+
# update = Git::Commands::Remote::Update.new(execution_context)
|
|
16
|
+
# update.call
|
|
17
|
+
#
|
|
18
|
+
# @example Fetch updates for a specific remote
|
|
19
|
+
# update = Git::Commands::Remote::Update.new(execution_context)
|
|
20
|
+
# update.call('origin')
|
|
21
|
+
#
|
|
22
|
+
# @example Fetch updates and prune stale tracking refs
|
|
23
|
+
# update = Git::Commands::Remote::Update.new(execution_context)
|
|
24
|
+
# update.call('origin', prune: true)
|
|
25
|
+
#
|
|
26
|
+
# @note `arguments` block audited against https://git-scm.com/docs/git-remote/2.53.0
|
|
27
|
+
#
|
|
28
|
+
# @see Git::Commands::Remote
|
|
29
|
+
#
|
|
30
|
+
# @see https://git-scm.com/docs/git-remote git-remote
|
|
31
|
+
#
|
|
32
|
+
# @api private
|
|
33
|
+
#
|
|
34
|
+
class Update < Git::Commands::Base
|
|
35
|
+
arguments do
|
|
36
|
+
literal 'remote'
|
|
37
|
+
flag_option %i[verbose v]
|
|
38
|
+
literal 'update'
|
|
39
|
+
flag_option %i[prune p]
|
|
40
|
+
|
|
41
|
+
end_of_options
|
|
42
|
+
|
|
43
|
+
operand :remote_or_group, repeatable: true
|
|
44
|
+
end
|
|
45
|
+
|
|
46
|
+
# @!method call(*, **)
|
|
47
|
+
#
|
|
48
|
+
# @overload call(*remote_or_group, **options)
|
|
49
|
+
#
|
|
50
|
+
# Execute the `git remote update` command
|
|
51
|
+
#
|
|
52
|
+
# @param remote_or_group [Array<String>] zero or more remote names or remote group names
|
|
53
|
+
#
|
|
54
|
+
# @param options [Hash] command options
|
|
55
|
+
#
|
|
56
|
+
# @option options [Boolean, nil] :verbose (nil) show remote URLs alongside remote names
|
|
57
|
+
#
|
|
58
|
+
# Alias: :v
|
|
59
|
+
#
|
|
60
|
+
# @option options [Boolean, nil] :prune (nil) prune stale tracking refs while updating remotes
|
|
61
|
+
#
|
|
62
|
+
# Alias: :p
|
|
63
|
+
#
|
|
64
|
+
# @return [Git::CommandLineResult] the result of calling `git remote update`
|
|
65
|
+
#
|
|
66
|
+
# @raise [ArgumentError] if unsupported options are provided
|
|
67
|
+
#
|
|
68
|
+
# @raise [Git::FailedError] if git exits with a non-zero exit status
|
|
69
|
+
end
|
|
70
|
+
end
|
|
71
|
+
end
|
|
72
|
+
end
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
|
|
3
|
+
require_relative 'remote/add'
|
|
4
|
+
require_relative 'remote/get_url'
|
|
5
|
+
require_relative 'remote/list'
|
|
6
|
+
require_relative 'remote/prune'
|
|
7
|
+
require_relative 'remote/remove'
|
|
8
|
+
require_relative 'remote/rename'
|
|
9
|
+
require_relative 'remote/set_branches'
|
|
10
|
+
require_relative 'remote/set_head'
|
|
11
|
+
require_relative 'remote/set_url'
|
|
12
|
+
require_relative 'remote/set_url_add'
|
|
13
|
+
require_relative 'remote/set_url_delete'
|
|
14
|
+
require_relative 'remote/show'
|
|
15
|
+
require_relative 'remote/update'
|
|
16
|
+
|
|
17
|
+
module Git
|
|
18
|
+
module Commands
|
|
19
|
+
# Commands for managing git remotes via `git remote`
|
|
20
|
+
#
|
|
21
|
+
# This module contains command classes split by remote operation:
|
|
22
|
+
# - {Remote::List} - list configured remotes
|
|
23
|
+
# - {Remote::Add} - add a new remote
|
|
24
|
+
# - {Remote::Rename} - rename an existing remote
|
|
25
|
+
# - {Remote::Remove} - remove a remote
|
|
26
|
+
# - {Remote::SetHead} - manage a remote's default branch
|
|
27
|
+
# - {Remote::SetBranches} - configure tracked branches for a remote
|
|
28
|
+
# - {Remote::GetUrl} - retrieve fetch or push URLs
|
|
29
|
+
# - {Remote::SetUrl} - replace a remote URL
|
|
30
|
+
# - {Remote::SetUrlAdd} - append a remote URL
|
|
31
|
+
# - {Remote::SetUrlDelete} - delete a matching remote URL
|
|
32
|
+
# - {Remote::Show} - show details about one or more remotes
|
|
33
|
+
# - {Remote::Prune} - prune stale tracking refs for remotes
|
|
34
|
+
# - {Remote::Update} - update one or more remotes or groups
|
|
35
|
+
#
|
|
36
|
+
# @api private
|
|
37
|
+
#
|
|
38
|
+
# @see https://git-scm.com/docs/git-remote git-remote documentation
|
|
39
|
+
module Remote
|
|
40
|
+
end
|
|
41
|
+
end
|
|
42
|
+
end
|