diff options
author | Junio C Hamano <gitster@pobox.com> | 2024-01-24 00:52:27 +0300 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2024-01-24 00:52:27 +0300 |
commit | 407f05103c874197ee86b448d4b01544c9f6bf3d (patch) | |
tree | dbcfad95c4c8fe9d67fe51927ec2a6842f9e77ee /contrib | |
parent | 54325d451029ca796bf87eb2cbc2b345b3a9cead (diff) | |
parent | d372feb203cda9725e78154dd0553654427501e8 (diff) |
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
Diffstat (limited to 'contrib')
-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 7c7284f17f..5d09e3d317 100644 --- a/contrib/completion/git-completion.bash +++ b/contrib/completion/git-completion.bash @@ -1276,10 +1276,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 @@ -2529,7 +2531,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 () |