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

custom-completions: git: Add git rebase (#404)

Co-authored-by: Simon Gasse <sgasse@users.noreply.github.com>
This commit is contained in:
sgasse 2023-03-12 12:22:52 +01:00 committed by GitHub
parent e3b02b38ee
commit 471c81c5ff
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,6 +24,13 @@ def "nu-complete git commits" [] {
^git rev-list --all --remotes --pretty=oneline | lines | parse "{value} {description}"
}
def "nu-complete git branches and commits" [] {
nu-complete git switchable branches
| parse "{value}"
| insert description Branch
| append (nu-complete git commits)
}
# Check out git branches and files
export extern "git checkout" [
...targets: string@"nu-complete git switchable branches" # name of the branch or files to checkout
@ -161,3 +168,15 @@ export extern "git cherry-pick" [
--abort # Cancel the operation
--skip # Skip the current commit and continue with the rest of the sequence
]
# Rebase the current branch
export extern "git rebase" [
branch?: string@"nu-complete git branches and commits" # name of the branch to rebase onto
upstream?: string@"nu-complete git branches and commits" # upstream branch to compare against
--continue # restart rebasing process after editing/resolving a conflict
--abort # abort rebase and reset HEAD to original branch
--quit # abort rebase but do not reset HEAD
--interactive(-i) # rebase interactively with list of commits in editor
--onto?: string@"nu-complete git branches and commits" # starting point at which to create the new commits
--root # start rebase from root commit
]