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