git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] git-prompt: fix sequencer/todo detection

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 7, 2022, 22:43 UTC
Message-ID
<xmqq7d80qzuq.fsf@gitster.g>
In-Reply-To
<nycvar.QRO.7.76.6.2204072315330.347@tvgsbejvaqbjf.bet>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 19 quoted lines
>> > 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.
Previous: Johannes Schindelin
Message 5 of 5 in “git-prompt: fix sequencer/todo detection”
  1. git-prompt: fix sequencer/todo detectionDanny Lin, Mar 25, 2022
  2. Junio C HamanoMar 26, 2022
  3. Junio C HamanoMar 28, 2022
  4. Johannes SchindelinApr 7, 2022
  5. Junio C HamanoApr 7, 2022

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.