@matheusbsbs / matheus-bagliano / commits / 07ba53f724
Fork 0

bash: Add completion for gitk --merge

Option is only completed when .git/MERGE_HEAD is present. Signed-off-by: Richard Quirk <richard.quirk@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Richard Quirk committed Apr 27, 2008 at 17:35 UTC 07ba53f724b95a817f957b8e943c9e4f545a0949
1 file changed +6 -1
contrib/completion/git-completion.bash
+6 -1
@@ -1346,9 +1346,14 @@ _git ()
1346 _gitk ()
1347 {
1348 local cur="${COMP_WORDS[COMP_CWORD]}"
1349 + local g="$(git rev-parse --git-dir 2>/dev/null)"
1350 + local merge=""
1351 + if [ -f $g/MERGE_HEAD ]; then
1352 + merge="--merge"
1353 + fi
1354 case "$cur" in
1355 --*)
1351 - __gitcomp "--not --all"
1356 + __gitcomp "--not --all $merge"
1357 return
1358 ;;
1359 esac