Git development
 help / color / mirror / Atom feed
From: Ben Knoble <ben.knoble@gmail.com>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, "Patrick Steinhardt" <ps@pks.im>,
	"Rubén Justo" <rjusto@gmail.com>
Subject: Re: [PATCH v2 5/5] completion: drop "stash save" completion altogether
Date: Fri, 23 Oct 2026 14:07:36 -0400	[thread overview]
Message-ID: <53FFC1C4-1569-4A9D-A1B7-B60A1BF53DF2@gmail.com> (raw)
In-Reply-To: <xmqqpkx08hyk.fsf@gitster.g>


> Le 23 oct. 2026 à 13:06, Junio C Hamano <gitster@pobox.com> a écrit :
> 
> "D. Ben Knoble" <ben.knoble@gmail.com> writes:
> 
>> It's been deprecated since fd2ebf14db (stash: mark "git stash save"
>> deprecated in the man page, 2017-10-22) and the previous commit removed
>> further documentation suggesting to use it.
>> 
>> Since we recommend push instead, stop completing for "save" and remove a
>> special case in completion code. It still appears for "git stash <tab>"
>> when GIT_COMPLETION_SHOW_ALL=1, and when typed explicitly we still
>> complete options for
>> 
>>    git stash save --<tab>
>> 
>> which is helpful for folks with finger-memory for save.
> 
> Well, if we can replace the command line to "git stash push --" on
> the first <tab> and then start completing for "stash push" with the
> second <tab>, it would be superb.

We probably can (I know Zsh is capable), but that means
more complex special-casing ;) I’d rather get rid of this case
and leave that nicety for someone who’s motivated to get
consensus for it, which I am not. 

> 
>> diff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash
>> index 697fef5462..9cd9c7cadb 100644
>> --- a/contrib/completion/git-completion.bash
>> +++ b/contrib/completion/git-completion.bash
>> @@ -3558,16 +3558,13 @@ _git_stash ()
>>    __git_resolve_builtins stash
>> 
>>    subcommands="$___git_resolved_builtins"
>> -    subcommand="$(__git_find_on_cmdline "$subcommands save")"
>> +    subcommand="$(__git_find_on_cmdline "$subcommands")"
>> 
>>    if [ -z "$subcommand" ]; then
>>        case "$((cword - __git_cmd_idx)),$cur" in
>>        *,--*)
>>            __gitcomp_builtin stash_push
>>            ;;
>> -        1,sa*)
>> -            __gitcomp "save"
>> -            ;;
> 
> Nice to see this go.  This would have been maintenance nightmare if
> left forever as we will have to remember updating it when "sa" no
> longer becomes a unique prefix.

  reply	other threads:[~2026-10-23 18:07 UTC|newest]

Thread overview: 28+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-12 17:48 [PATCH 0/5] stash completion miscellany D. Ben Knoble
2026-10-12 17:48 ` [PATCH 1/5] completion: simplify stash subcommand completion D. Ben Knoble
2026-10-16  8:01   ` Patrick Steinhardt
2026-10-19 19:58     ` Ben Knoble
2026-10-12 17:48 ` [PATCH 2/5] completion: extract common stash listing code D. Ben Knoble
2026-10-12 17:48 ` [PATCH 3/5] completion: fix Zsh handling of stash names D. Ben Knoble
2026-10-16  8:01   ` Patrick Steinhardt
2026-10-19 19:56     ` Ben Knoble
2026-10-12 17:48 ` [PATCH 4/5] doc: drop usage mentions of "git stash save" D. Ben Knoble
2026-10-16  8:01   ` Patrick Steinhardt
2026-10-12 17:48 ` [PATCH 5/5] completion: drop "stash save" completion altogether D. Ben Knoble
2026-10-16  8:01   ` Patrick Steinhardt
2026-10-19 20:01     ` Ben Knoble
2026-10-20  6:05       ` Patrick Steinhardt
2026-10-22 13:14         ` D. Ben Knoble
2026-10-23  6:21           ` Patrick Steinhardt
2026-10-23 13:20 ` [PATCH v2 0/5] stash completion miscellany D. Ben Knoble
2026-10-23 13:20   ` [PATCH v2 1/5] completion: simplify stash subcommand completion D. Ben Knoble
2026-10-23 13:20   ` [PATCH v2 2/5] Completion: extract common stash listing code D. Ben Knoble
2026-10-23 17:06     ` Junio C Hamano
2026-10-23 13:20   ` [PATCH v2 3/5] completion: fix Zsh handling of stash names D. Ben Knoble
2026-10-23 13:20   ` [PATCH v2 4/5] doc: drop usage mentions of "git stash save" D. Ben Knoble
2026-10-23 13:20   ` [PATCH v2 5/5] completion: drop "stash save" completion altogether D. Ben Knoble
2026-10-23 17:06     ` Junio C Hamano
2026-10-23 18:07       ` Ben Knoble [this message]
2026-10-23 14:33   ` [PATCH v2 0/5] stash completion miscellany Kristoffer Haugsbakk
2026-10-26  8:48   ` Patrick Steinhardt
2026-10-26 14:30     ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53FFC1C4-1569-4A9D-A1B7-B60A1BF53DF2@gmail.com \
    --to=ben.knoble@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=ps@pks.im \
    --cc=rjusto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox