summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 5de40f5)
raw | patch | inline | side by side (parent: 5de40f5)
author | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 27 Nov 2006 20:10:42 +0000 (15:10 -0500) | ||
committer | Junio C Hamano <junkio@cox.net> | |
Mon, 27 Nov 2006 20:57:15 +0000 (12:57 -0800) |
Because git-merge and git-rebase both accept -s, --strategy or --strategy=
we should recognize all three formats in the bash completion functions and
issue back all merge strategies on demand.
I also moved the prior word testing to be before the current word testing,
as the current word cannot be completed with -- if the prior word was an
option which requires a parameter, such as -s or --strategy.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
we should recognize all three formats in the bash completion functions and
issue back all merge strategies on demand.
I also moved the prior word testing to be before the current word testing,
as the current word cannot be completed with -- if the prior word was an
option which requires a parameter, such as -s or --strategy.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <junkio@cox.net>
contrib/completion/git-completion.bash | patch | blob | history |
index 73c67691c928bcb7fa0b72e0179f74df11a087c2..16b8dda17dbe1e3c09f3b1377e4a98b9c19900f7 100755 (executable)
_git_merge ()
{
local cur="${COMP_WORDS[COMP_CWORD]}"
+ case "${COMP_WORDS[COMP_CWORD-1]}" in
+ -s|--strategy)
+ COMPREPLY=($(compgen -W "$(__git_merge_strategies)" -- "$cur"))
+ return
+ esac
case "$cur" in
+ --strategy=*)
+ COMPREPLY=($(compgen -W "$(__git_merge_strategies)" \
+ -- "${cur##--strategy=}"))
+ return
+ ;;
--*)
COMPREPLY=($(compgen -W "
--no-commit --no-summary --squash --strategy
" -- "$cur"))
return
esac
- case "${COMP_WORDS[COMP_CWORD-1]}" in
- -s|--strategy)
- COMPREPLY=($(compgen -W "$(__git_merge_strategies)" -- "$cur"))
- return
- esac
COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}
" -- "$cur"))
return
fi
+ case "${COMP_WORDS[COMP_CWORD-1]}" in
+ -s|--strategy)
+ COMPREPLY=($(compgen -W "$(__git_merge_strategies)" -- "$cur"))
+ return
+ esac
case "$cur" in
+ --strategy=*)
+ COMPREPLY=($(compgen -W "$(__git_merge_strategies)" \
+ -- "${cur##--strategy=}"))
+ return
+ ;;
--*)
COMPREPLY=($(compgen -W "
--onto --merge --strategy
" -- "$cur"))
return
esac
- case "${COMP_WORDS[COMP_CWORD-1]}" in
- -s|--strategy)
- COMPREPLY=($(compgen -W "$(__git_merge_strategies)" -- "$cur"))
- return
- esac
COMPREPLY=($(compgen -W "$(__git_refs)" -- "$cur"))
}