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

Re: [PATCH v3] git cherry-pick: Add NULL check to sequencer parsing of HEAD

From
Junio C Hamano <gitster@pobox.com>
Date
May 3, 2012, 17:13 UTC
Message-ID
<7vobq5fasa.fsf@alter.siamese.dyndns.org>
In-Reply-To
<vpqtxzx5hxz.fsf@bauges.imag.fr>
Matthieu Moy <Matthieu.Moy@grenoble-inp.fr> writes:
Show 17 quoted lines
> Neil Horman <nhorman@tuxdriver.com> writes:
>
>> -	if (!head_commit || parse_commit(head_commit))
>> -		return error(_("could not parse commit %s\n"),
>> -			     sha1_to_hex(head_commit->object.sha1));
>> +
>> +	if (parse_commit(head_commit))
>> +		return -1;
>
> Why did you replace the error("...") with only a -1? error() also
> returns -1, but displays a message before, which I think was fine. If
> you want to remove the message, then explain why in the commit message.
>
> If you do not test for head_commit to be null, you can't use it in the
> error message. But from the context, it seems you can use head_sha1. If
> not, a message like "Could not parse HEAD commit" seems better than
> nothing.
Yeah, I think v2 in this series is the appropriate fix.
Previous: Matthieu MoyNext: Neil Horman
Message 8 of 9 in “git cherry-pick: Add NULL check to sequencer parsing of HEAD”
  1. git cherry-pick: Add NULL check to sequencer parsing of HEADNeil Horman, May 3, 2012
  2. René ScharfeMay 3, 2012
  3. Neil HormanMay 3, 2012
  4. René ScharfeMay 3, 2012
  5. git cherry-pick: Add NULL check to sequencer parsing of HEADNeil Horman, May 3, 2012
  6. git cherry-pick: Add NULL check to sequencer parsing of HEADNeil Horman, May 3, 2012
  7. Matthieu MoyMay 3, 2012
  8. Junio C HamanoMay 3, 2012
  9. Neil HormanMay 3, 2012

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.