зеркало из https://github.com/microsoft/git.git
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>
This commit is contained in:
Родитель
8108513422
Коммит
3d279863de
|
@ -947,6 +947,8 @@ _git_ls_tree ()
|
||||||
__git_complete_file
|
__git_complete_file
|
||||||
}
|
}
|
||||||
|
|
||||||
|
__git_log_pretty_formats="oneline short medium full fuller email raw format:"
|
||||||
|
|
||||||
_git_log ()
|
_git_log ()
|
||||||
{
|
{
|
||||||
__git_has_doubledash && return
|
__git_has_doubledash && return
|
||||||
|
@ -954,8 +956,7 @@ _git_log ()
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--pretty=*)
|
--pretty=*)
|
||||||
__gitcomp "
|
__gitcomp "$__git_log_pretty_formats
|
||||||
oneline short medium full fuller email raw
|
|
||||||
" "" "${cur##--pretty=}"
|
" "" "${cur##--pretty=}"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
@ -1483,8 +1484,7 @@ _git_show ()
|
||||||
local cur="${COMP_WORDS[COMP_CWORD]}"
|
local cur="${COMP_WORDS[COMP_CWORD]}"
|
||||||
case "$cur" in
|
case "$cur" in
|
||||||
--pretty=*)
|
--pretty=*)
|
||||||
__gitcomp "
|
__gitcomp "$__git_log_pretty_formats
|
||||||
oneline short medium full fuller email raw
|
|
||||||
" "" "${cur##--pretty=}"
|
" "" "${cur##--pretty=}"
|
||||||
return
|
return
|
||||||
;;
|
;;
|
||||||
|
|
Загрузка…
Ссылка в новой задаче