Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Rast <trast@student.ethz.ch>2009-02-16 19:34:57 +0300
committerJunio C Hamano <gitster@pobox.com>2009-02-18 21:41:45 +0300
commitbf3c20f6e855521fb92f455a9e70fbe8f107c53d (patch)
treeccb794c4c38985f68e873dba98b8b2a672c0509b
parenta393777ec9ca7c33cb76efa225ddacc53784c0dd (diff)
bash completion: only show 'log --merge' if merging
The gitk completion only shows --merge if MERGE_HEAD is present. Do it the same way for git-log completion. Signed-off-by: Thomas Rast <trast@student.ethz.ch> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rwxr-xr-xcontrib/completion/git-completion.bash7
1 files changed, 6 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
index 6e5260ee75..0a3092f646 100755
--- a/contrib/completion/git-completion.bash
+++ b/contrib/completion/git-completion.bash
@@ -1003,6 +1003,11 @@ _git_log ()
__git_has_doubledash && return
local cur="${COMP_WORDS[COMP_CWORD]}"
+ local g="$(git rev-parse --git-dir 2>/dev/null)"
+ local merge=""
+ if [ -f $g/MERGE_HEAD ]; then
+ merge="--merge"
+ fi
case "$cur" in
--pretty=*)
__gitcomp "$__git_log_pretty_formats
@@ -1030,7 +1035,7 @@ _git_log ()
--decorate
--walk-reflogs
--parents --children
- --merge
+ $merge
$__git_diff_common_options
--pickaxe-all --pickaxe-regex
"