completion: don't comp revs when --no-format-patch
A message that is not in the archive (sent off-list or not yet received): [email protected]
PATCH 1/1 completion: don't comp revs when --no-format-patch
In this case the user has specifically said they don't want send-email to run format-patch so revs aren't valid argument completions (and it's likely revs and dirs do have some same names or prefixes as in Documentation/MyFirstContribution.txt 'psuh').
Signed-off-by Britton Leo Kerin <[email protected]>
--- contrib/completion/git-completion.bash | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
contrib/completion/git-completion.bash +5 -1
@@ -1242,10 +1242,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
@@ -2429,7 +2431,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 ()
Signature · 1 line
2.43.0
Quoted 1 line
Subject: Re: [PATCH 1/1] completion: don't comp revs when --no-format-patch
I suspect "comp revs" -> "complete revs" is what you meant, but if so, please spell it out to help folks who read "git shortlog --no-merges" output, i.e. without help from the body of the log message.