@matheusbsbs / matheus-bagliano / commits / e25e2b4201
Fork 0

bash: Support new 'git fetch' options

Support the new options --all, --prune, and --dry-run for 'git fetch'. As the --multiple option was primarily introduced to enable 'git remote update' to be re-implemented in terms of 'git fetch' (16679e37) and is not likely to be used much from the command line, it does not seems worthwhile to complicate the code (to support completion of multiple remotes) to handle it. Signed-off-by: Björn Gustavsson <bgustavsson@gmail.com> Acked-by: Shawn O. Pearce <spearce@spearce.org> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Björn Gustavsson committed Dec 12, 2009 at 11:21 UTC e25e2b4201716a912b29397515a858238497dbdd
1 file changed +12 -2
contrib/completion/git-completion.bash
+12 -2
@@ -417,7 +417,17 @@ __git_complete_remote_or_refspec ()
417 while [ $c -lt $COMP_CWORD ]; do
418 i="${COMP_WORDS[c]}"
419 case "$i" in
420 - --all|--mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
420 + --mirror) [ "$cmd" = "push" ] && no_complete_refspec=1 ;;
421 + --all)
422 + case "$cmd" in
423 + push) no_complete_refspec=1 ;;
424 + fetch)
425 + COMPREPLY=()
426 + return
427 + ;;
428 + *) ;;
429 + esac
430 + ;;
431 -*) ;;
432 *) remote="$i"; break ;;
433 esac
@@ -1002,7 +1012,7 @@ _git_difftool ()
1012
1013 __git_fetch_options="
1014 --quiet --verbose --append --upload-pack --force --keep --depth=
1005 - --tags --no-tags
1015 + --tags --no-tags --all --prune --dry-run
1016 "
1017
1018 _git_fetch ()