aboutsummaryrefslogtreecommitdiff
path: root/contrib/completion
diff options
context:
space:
mode:
authorSZEDER Gábor <szeder@ira.uka.de>2009-01-16 17:02:15 +0100
committerJunio C Hamano <gitster@pobox.com>2009-01-17 18:23:27 -0800
commit3d279863dedf6c07eefe307b27fb3a08e519140f (patch)
tree1bbe6c6a5fe7c98b862fb6c623978ac3e360c56d /contrib/completion
parent8108513422eac0b0df947ab58f63a6a215faa1ae (diff)
downloadgit-3d279863dedf6c07eefe307b27fb3a08e519140f.tar.gz
git-3d279863dedf6c07eefe307b27fb3a08e519140f.tar.xz
bash: refactor 'git log --pretty=<format>' options
Both 'git log' and 'show' have the same '--pretty=<format>' option with the same formats. So refactor these formats into a common variable. While at it, also add 'format:' to the list. Signed-off-by: SZEDER Gábor <szeder@ira.uka.de> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'contrib/completion')
-rwxr-xr-xcontrib/completion/git-completion.bash8
1 files changed, 4 insertions, 4 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 80edfcacc..ec701e806 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -947,6 +947,8 @@ _git_ls_tree ()
__git_complete_file
}
+__git_log_pretty_formats="oneline short medium full fuller email raw format:"
+
_git_log ()
{
__git_has_doubledash && return
@@ -954,8 +956,7 @@ _git_log ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
- __gitcomp "
- oneline short medium full fuller email raw
+ __gitcomp "$__git_log_pretty_formats
" "" "${cur##--pretty=}"
return
;;
@@ -1483,8 +1484,7 @@ _git_show ()
local cur="${COMP_WORDS[COMP_CWORD]}"
case "$cur" in
--pretty=*)
- __gitcomp "
- oneline short medium full fuller email raw
+ __gitcomp "$__git_log_pretty_formats
" "" "${cur##--pretty=}"
return
;;