diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-05-07 17:55:37 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-05-07 17:55:37 -0700 |
commit | 0f1a2e9acf8128e058090730c082cd18f3f47840 (patch) | |
tree | c8d885799788d1498c4f0c3b726885ffcca6c5cd | |
parent | Merge branch 'jc/rerere-cleanup' into seen (diff) | |
parent | completion: don't complete revs when --no-format-patch (diff) | |
download | git-0f1a2e9acf8128e058090730c082cd18f3f47840.tar.xz git-0f1a2e9acf8128e058090730c082cd18f3f47840.zip |
Merge branch 'bk/complete-send-email' into seen
Command line completion support (in contrib/) has been taught to
avoid offering revision names as candidates to "git send-email" when
the command is used to send pre-generated files.
* bk/complete-send-email:
completion: don't complete revs when --no-format-patch
-rw-r--r-- | contrib/completion/git-completion.bash | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash index 5c0ddeb3d4f..ba8ad888d8e 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1329,10 +1329,12 @@ __git_find_last_on_cmdline () while test $# -gt 1; do case "$1" in --show-idx) show_idx=y ;; + --) shift && break ;; *) return 1 ;; esac shift done + [ $# -eq 1 ] || return 1 # return 1 if we got wrong # of non-opts local wordlist="$1" while [ $c -gt "$__git_cmd_idx" ]; do @@ -2596,7 +2598,9 @@ _git_send_email () return ;; esac - __git_complete_revlist + if [ "$(__git_find_last_on_cmdline -- "--format-patch --no-format-patch")" != "--no-format-patch" ]; then + __git_complete_revlist + fi } _git_stage () |