From: Linus Torvalds Date: Sat, 11 Jul 2009 03:32:01 GMT Subject: Re: [PATCH 2/2] apply: notice creation/removal patches produced by GNU diff Message-ID: 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? > + 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