Fix completions for git push and git checkout close: #5021 and #4599 (#5188)

This commit is contained in:
Justin Ma 2022-04-14 21:17:58 +08:00 committed by GitHub
parent 56af7e8d5f
commit 9844e6125b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -14,59 +14,61 @@ module completions {
^git remote | lines | each { |line| $line | str trim } ^git remote | lines | each { |line| $line | str trim }
} }
# Check out git branches and files
export extern "git checkout" [ export extern "git checkout" [
branch?: string@"nu-complete git branches" # name of the branch to checkout ...targets: string@"nu-complete git branches" # name of the branch or files to checkout
-b: string # create and checkout a new branch --conflict: string # conflict style (merge or diff3)
-B: string # create/reset and checkout a branch --detach(-d) # detach HEAD at named commit
-l # create reflog for new branch --force(-f) # force checkout (throw away local modifications)
--guess # second guess 'git checkout <no-such-branch>' (default) --guess # second guess 'git checkout <no-such-branch>' (default)
--overlay # use overlay mode (default) --ignore-other-worktrees # do not check if another worktree is holding the given ref
--quiet(-q) # suppress progress reporting --ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only
--recurse-submodules: string # control recursive updating of submodules --merge(-m) # perform a 3-way merge with the new branch
--progress # force progress reporting --orphan: string # new unparented branch
--merge(-m) # perform a 3-way merge with the new branch --ours(-2) # checkout our version for unmerged files
--conflict: string # conflict style (merge or diff3) --overlay # use overlay mode (default)
--detach(-d) # detach HEAD at named commit --overwrite-ignore # update ignored files (default)
--track(-t) # set upstream info for new branch --patch(-p) # select hunks interactively
--force(-f) # force checkout (throw away local modifications) --pathspec-from-file: string # read pathspec from file
--orphan: string # new unparented branch --progress # force progress reporting
--overwrite-ignore # update ignored files (default) --quiet(-q) # suppress progress reporting
--ignore-other-worktrees # do not check if another worktree is holding the given ref --recurse-submodules: string # control recursive updating of submodules
--ours(-2) # checkout our version for unmerged files --theirs(-3) # checkout their version for unmerged files
--theirs(-3) # checkout their version for unmerged files --track(-t) # set upstream info for new branch
--patch(-p) # select hunks interactively -b: string # create and checkout a new branch
--ignore-skip-worktree-bits # do not limit pathspecs to sparse entries only -B: string # create/reset and checkout a branch
--pathspec-from-file: string # read pathspec from file -l # create reflog for new branch
] ]
# Push changes
export extern "git push" [ export extern "git push" [
remote?: string@"nu-complete git remotes", # the name of the remote remote?: string@"nu-complete git remotes", # the name of the remote
refspec?: string@"nu-complete git branches"# the branch / refspec ...refs: string@"nu-complete git branches" # the branch / refspec
--verbose(-v) # be more verbose --all # push all refs
--quiet(-q) # be more quiet --atomic # request atomic transaction on remote side
--repo: string # repository --delete(-d) # delete refs
--all # push all refs --dry-run(-n) # dry run
--mirror # mirror all refs --exec: string # receive pack program
--delete(-d) # delete refs --follow-tags # push missing but relevant tags
--tags # push tags (can't be used with --all or --mirror) --force-with-lease: string # require old value of ref to be at this value
--dry-run(-n) # dry run --force(-f) # force updates
--porcelain # machine-readable output --ipv4(-4) # use IPv4 addresses only
--force(-f) # force updates --ipv6(-6) # use IPv6 addresses only
--force-with-lease: string # require old value of ref to be at this value --mirror # mirror all refs
--recurse-submodules: string # control recursive pushing of submodules --no-verify # bypass pre-push hook
--thin # use thin pack --porcelain # machine-readable output
--receive-pack: string # receive pack program --progress # force progress reporting
--exec: string # receive pack program --prune # prune locally removed refs
--set-upstream(-u) # set upstream for git pull/status --push-option(-o): string # option to transmit
--progress # force progress reporting --quiet(-q) # be more quiet
--prune # prune locally removed refs --receive-pack: string # receive pack program
--no-verify # bypass pre-push hook --recurse-submodules: string # control recursive pushing of submodules
--follow-tags # push missing but relevant tags --repo: string # repository
--signed: string # GPG sign the push --set-upstream(-u) # set upstream for git pull/status
--atomic # request atomic transaction on remote side --signed: string # GPG sign the push
--push-option(-o): string # option to transmit --tags # push tags (can't be used with --all or --mirror)
--ipv4(-4) # use IPv4 addresses only --thin # use thin pack
--ipv6(-6) # use IPv6 addresses only --verbose(-v) # be more verbose
] ]
} }