git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Johannes Schindelin <Johannes.Schindelin@gmx.de>
Cc: Danny Lin <danny0838@gmail.com>, git develop <git@vger.kernel.org>
Subject: Re: [PATCH] git-prompt: fix sequencer/todo detection
Date: Thu, 07 Apr 2022 15:43:09 -0700	[thread overview]
Message-ID: <xmqq7d80qzuq.fsf@gitster.g> (raw)
In-Reply-To: <nycvar.QRO.7.76.6.2204072315330.347@tvgsbejvaqbjf.bet> (Johannes Schindelin's message of "Thu, 7 Apr 2022 23:45:20 +0200 (CEST)")

Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:

>> > diff --git a/contrib/completion/git-prompt.sh b/contrib/completion/git-prompt.sh
>> > index db7c0068fb..8ae341a306 100644
>> > --- a/contrib/completion/git-prompt.sh
>> > +++ b/contrib/completion/git-prompt.sh
>> > @@ -315,7 +315,7 @@ __git_sequencer_status ()
>> >  	elif __git_eread "$g/sequencer/todo" todo
>> >  	then
>> >  		case "$todo" in
>> > -		p[\ \	]|pick[\ \	]*)
>> > +		p[\ \	]*|pick[\ \	]*)
>> >  			r="|CHERRY-PICKING"
>> >  			return 0
>> >  		;;
>> ...
>
> It looks to me as if the abbreviated commands cannot be generated by Git
> (the `replay_opts` in `builtin/revert.c` are all initialized to
> `REPLAY_OPTS_INIT`, so there is not even any chance of uninitialized data
> there).

Good.  Then the right "fix" would be to drop the misleading "We
would also accept the abbreviated" side of the case arm, instead of
fixing "if we were generating the abbreviated one, here is how we
might support it" code, I guess.

Thanks for sanity-checking my digging in the sequencer.c code.



      reply	other threads:[~2022-04-07 22:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-03-25 14:53 [PATCH] git-prompt: fix sequencer/todo detection Danny Lin
2022-03-26  0:15 ` Junio C Hamano
2022-03-28 21:53 ` Junio C Hamano
2022-04-07 21:45   ` Johannes Schindelin
2022-04-07 22:43     ` Junio C Hamano [this message]

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

  List information: http://vger.kernel.org/majordomo-info.html

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

  git send-email \
    --in-reply-to=xmqq7d80qzuq.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=danny0838@gmail.com \
    --cc=git@vger.kernel.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).