1
Fork 0
mirror of https://github.com/RGBCube/nu_scripts synced 2025-08-02 15:17:47 +00:00

Fix completions for git push and git checkout (#204)

This commit is contained in:
Justin Ma 2022-04-14 21:18:19 +08:00 committed by GitHub
parent 2d084463c1
commit af33063bf3
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -12,78 +12,78 @@ def "nu-complete git log" [] {
# Check out git branches and files # 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 # 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
] ]
# Switch between branches and commits # Switch between branches and commits
export extern "git switch" [ export extern "git switch" [
switch?: string@"nu-complete git branches" # name of branch to switch to switch?: string@"nu-complete git branches" # name of branch to switch to
--create(-c): string # create a new branch --create(-c): string # create a new branch
--force-create(-C): string # forces creation of new branch, if it exists then the existing branch will be reset to starting point --detach(-d): string@"nu-complete git log" # switch to a commit in a detatched state
--detach(-d): string@"nu-complete git log" # switch to a commit in a detatched state --force-create(-C): string # forces creation of new branch, if it exists then the existing branch will be reset to starting point
--guess # if there is no local branch which matches then name but there is a remote one then this is checked out --force(-f) # alias for --discard-changes
--no-guess # do not attempt to match remote branch names --guess # if there is no local branch which matches then name but there is a remote one then this is checked out
--force(-f) # alias for --discard-changes --ignore-other-worktrees # switch even if the ref is held by another worktree
--merge(-m) # attempts to merge changes when switching branches if there are local changes --merge(-m) # attempts to merge changes when switching branches if there are local changes
--quiet(-q) # suppress feedback messages --no-guess # do not attempt to match remote branch names
--progress # report progress status --no-progress # do not report progress
--no-progress # do not report progress --no-recurse-submodules # do not update the contents of sub-modules
--track(-t) # set "upstream" configuration --no-track # do not set "upstream" configuration
--no-track # do not set "upstream" configuration --orphan: string # create a new orphaned branch
--orphan: string # create a new orphaned branch --progress # report progress status
--ignore-other-worktrees # switch even if the ref is held by another worktree --quiet(-q) # suppress feedback messages
--recurse-submodules # update the contents of sub-modules --recurse-submodules # update the contents of sub-modules
--no-recurse-submodules # do not update the contents of sub-modules --track(-t) # set "upstream" configuration
] ]