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

Re: [PATCH 1/2] status: show 'revert' state and status hint

From
Matthieu Moy <matthieu.moy@grenoble-inp.fr>
Date
Apr 2, 2013, 20:36 UTC
Message-ID
<vpqr4isd60r.fsf@grenoble-inp.fr>
In-Reply-To
<7vobdwbs86.fsf@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:
Show 15 quoted lines
>> +	if (advice_status_hints) {
>> +	}
>> +	if (advice_status_hints)
>> +		status_printf_ln(s, color,
>> +			_("  (use \"git revert --abort\" to cancel the revert operation)"));
>
> Why not a single conditional? i.e.
>
> 	if (advice_status_hints) {
> 		if unmerged
> 			fix and continue
> 		else
> 			say continue
> 		you can also say abort
> 	}

Oops, you're right. I wrote the code mostly with cut-and-past + edit from other functions, and didn't notice the obvious refactoring opportunity.

-- 
Matthieu Moy
http://www-verimag.imag.fr/~moy/
Previous: Junio C Hamano
Message 6 of 6 in “bash: teach __git_ps1 about REVERT_HEAD”
  1. bash: teach __git_ps1 about REVERT_HEADRobin Rosenberg, Mar 31, 2013
  2. Junio C HamanoApr 1, 2013
  3. 1/2 status: show 'revert' state and status hintMatthieu Moy, Apr 2, 2013
  4. 2/2 status: show commit sha1 in "You are currently reverting" messageMatthieu Moy, Apr 2, 2013
  5. Junio C HamanoApr 2, 2013
  6. Matthieu MoyApr 2, 2013

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.