aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/completions
diff options
context:
space:
mode:
authorGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-13 16:18:29 +0200
committerGravatar Fabian Homborg <FHomborg@gmail.com>2016-05-13 16:18:29 +0200
commita998921f399f9657cf04313cc99e5116c6d11c98 (patch)
treef5d3596cae8f130869ed160845e2057e8a59c5fb /share/completions
parent3daccf3c22c63d9480df563d1cddd72f9ae3b221 (diff)
git: Complete reflog for reset
Diffstat (limited to 'share/completions')
-rw-r--r--share/completions/git.fish5
1 files changed, 5 insertions, 0 deletions
diff --git a/share/completions/git.fish b/share/completions/git.fish
index 234db0d7..1bdec5cc 100644
--- a/share/completions/git.fish
+++ b/share/completions/git.fish
@@ -199,6 +199,10 @@ function __fish_git_possible_commithash
return 1
end
+function __fish_git_reflog
+ command git reflog | string replace -r '[0-9a-f]* (.+@\{[0-9]+\}): (.*)$' '$1\t$2'
+end
+
# general options
complete -f -c git -l help -d 'Display the manual of a git command'
complete -f -c git -n '__fish_git_using_command log show diff-tree rev-list' -l pretty -a 'oneline short medium full fuller email raw format:'
@@ -481,6 +485,7 @@ complete -c git -n '__fish_git_needs_command' -a reset -d 'Reset current HEAD to
complete -f -c git -n '__fish_git_using_command reset' -l hard -d 'Reset files in working directory'
complete -c git -n '__fish_git_using_command reset' -a '(__fish_git_branches)' -d 'Branch'
complete -f -c git -n '__fish_git_using_command reset' -a '(__fish_git_staged_files)' -d 'File'
+complete -f -c git -n '__fish_git_using_command reset' -a '(__fish_git_reflog)' -d 'Reflog'
# TODO options
### revert