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

Re: [PATCH 3/3] parse_commit(): handle broken whitespace-only timestamp

From
Jeff King <peff@peff.net>
Date
Apr 25, 2023, 05:56 UTC
Message-ID
<20230425055620.GA4015761@coredump.intra.peff.net>
In-Reply-To
<20230423003715.GB3953216@coredump.intra.peff.net>
On Sat, Apr 22, 2023 at 08:37:15PM -0400, Jeff King wrote:
Show 13 quoted lines
> > You could use (our own) isdigit() here instead.  It's more concise and
> > efficient.
> 
> Heh, yes, that is much better. I had strspn() on the mind since that is
> what split_ident_line() uses.
> 
> I think it could even just be:
> 
>   if (dateptr != eol)
> 
> which implies that we found some non-whitespace character, and then we
> rely on parse_timestamp() to return 0 (which is what the current code is
> effectively doing).

This should be "dateptr == eol" of course, because the body of the conditional is "return 0" to signal an error. It's correct in the v2 of the series I just sent out.

-Peff
Previous: Jeff KingNext: Junio C Hamano
Message 4 of 6 in “parse_commit(): handle broken whitespace-only timestamp”
  1. 3/3 parse_commit(): handle broken whitespace-only timestampJeff King, Apr 22, 2023
  2. René ScharfeApr 22, 2023
  3. Jeff KingApr 23, 2023
  4. Jeff KingApr 25, 2023
  5. Junio C HamanoApr 24, 2023
  6. Jeff KingApr 25, 2023

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.