From 1f2b3ea2036f81135bedcf467c8d66f6fccdb538 Mon Sep 17 00:00:00 2001 From: nickl- Date: Sun, 22 Jul 2012 22:51:57 +0200 Subject: [PATCH] Alphabetically sorted bash_completion. Makes it easier to work with and slightly optimizes things for bash_completion which sorts these completions alphabetically. --- etc/bash_completion.sh | 32 ++++++++++++++++++-------------- 1 file changed, 18 insertions(+), 14 deletions(-) diff --git a/etc/bash_completion.sh b/etc/bash_completion.sh index e37fa74..db68dfa 100644 --- a/etc/bash_completion.sh +++ b/etc/bash_completion.sh @@ -1,5 +1,9 @@ # bash completion support for git-extras. +_git_bug(){ + __git_extras_workflow "bug" +} + _git_changelog(){ __gitcomp "--list" } @@ -28,6 +32,14 @@ _git_extras(){ __gitcomp "--version update" } +__git_extras_workflow(){ + __gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish" +} + +_git_feature(){ + __git_extras_workflow "feature" +} + _git_graft(){ __gitcomp "$(__git_heads)" } @@ -45,22 +57,14 @@ _git_ignore(){ esac } -_git_squash(){ - __gitcomp "$(__git_heads)" -} - -__git_extras_workflow(){ - __gitcomp "$(__git_heads | grep ^$1/ | sed s/^$1\\///g) finish" -} - -_git_feature(){ - __git_extras_workflow "feature" -} - _git_refactor(){ __git_extras_workflow "refactor" } -_git_bug(){ - __git_extras_workflow "bug" +_git_squash(){ + __gitcomp "$(__git_heads)" +} + +_git_undo(){ + __gitcomp "--hard --soft -h -s" }