mirror of
https://github.com/RGBCube/nu_scripts
synced 2025-08-02 15:17:47 +00:00
Add git cherry-pick completion (#355)
This commit is contained in:
parent
b4a5b9e940
commit
a023cea71a
1 changed files with 17 additions and 0 deletions
|
@ -10,6 +10,10 @@ def "nu-complete git log" [] {
|
||||||
^git log --pretty=%h | lines | each { |line| $line | str trim }
|
^git log --pretty=%h | lines | each { |line| $line | str trim }
|
||||||
}
|
}
|
||||||
|
|
||||||
|
def "nu-complete git commits" [] {
|
||||||
|
^git rev-list --all --remotes --pretty=oneline | lines | parse "{value} {description}"
|
||||||
|
}
|
||||||
|
|
||||||
# Check out git branches and files
|
# Check out git branches and files
|
||||||
export extern "git checkout" [
|
export extern "git checkout" [
|
||||||
...targets: string@"nu-complete git branches" # name of the branch or files to checkout
|
...targets: string@"nu-complete git branches" # name of the branch or files to checkout
|
||||||
|
@ -135,3 +139,16 @@ export extern "git switch" [
|
||||||
--recurse-submodules # update the contents of sub-modules
|
--recurse-submodules # update the contents of sub-modules
|
||||||
--track(-t) # set "upstream" configuration
|
--track(-t) # set "upstream" configuration
|
||||||
]
|
]
|
||||||
|
|
||||||
|
# Apply the change introduced by an existing commit
|
||||||
|
extern "git cherry-pick" [
|
||||||
|
commit?: string@"nu-complete git commits" # The commit ID to be cherry-picked
|
||||||
|
--edit(-e) # Edit the commit message prior to committing
|
||||||
|
--no-commit(-n) # Apply changes without making any commit
|
||||||
|
--signoff(-s) # Add Signed-off-by line to the commit message
|
||||||
|
--ff # Fast-forward if possible
|
||||||
|
--continue # Continue the operation in progress
|
||||||
|
--abort # Cancel the operation
|
||||||
|
--skip # Skip the current commit and continue with the rest of the sequence
|
||||||
|
]
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue