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

Re: [PATCH 2/2] apply: notice creation/removal patches produced by GNU diff

From
Linus Torvalds <torvalds@linux-foundation.org>
Date
Jul 11, 2009, 03:32 UTC
Message-ID
<alpine.LFD.2.01.0907102029570.3552@localhost.localdomain>
In-Reply-To
<7vbpnrrjld.fsf_-_@alter.siamese.dyndns.org>
On Fri, 10 Jul 2009, Junio C Hamano wrote:
>
> Unified context patch generated by GNU diff has UNIX epoch timestamp
> on the side that does not exist when the patch is about a creation or
> a deletion event.  Notice this convention when reading a non-git diff.

Hmm. Do you really want to do a regex here? That seems overkill. Why not just try to parse the date?

Show 6 quoted lines
> +	const char stamp_regexp[] =
> +		"^[0-9][0-9][0-9][0-9]-[01][0-9]-[0-3][0-9]"
> +		" "
> +		"[0-2][0-9]:[0-5][0-9]:[0-6][0-9](\\.0+)?"
> +		" "
> +		"[-+][0-2][0-9][0-5][0-9]\n";

Also, why are you apparently expecting micro-seconds to always be all zeroes? Maybe that's the common case, but I'd expect that somebody has non-zero microseconds on filesystems that support them..

		Linus
Previous: Junio C HamanoNext: Junio C Hamano
Message 6 of 7 in “Re: What's happening with vr41xx_giu.c?”
  1. Ralf BaechleJul 10, 2009
  2. Junio C HamanoJul 10, 2009
  3. Junio C HamanoJul 11, 2009
  4. 1/2 tm_to_time_t(): allow times in year 1969Junio C Hamano, Jul 11, 2009
  5. 2/2 apply: notice creation/removal patches produced by GNU diffJunio C Hamano, Jul 11, 2009
  6. Linus TorvaldsJul 11, 2009
  7. Junio C HamanoJul 11, 2009

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.