Re: [RFC 5/5] Support 'master@2 hours ago' syntax

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Junio C Hamano <junkio@xxxxxxx> wrote:
> Linus Torvalds <torvalds@xxxxxxxx> writes:
> 
> > On Wed, 17 May 2006, Junio C Hamano wrote:
> >> 
> >> This does not allow '2006-05-17 00:00:00' as the timespec, and
> >> the documentation carefully avoids giving that example, but I
> >> think it is better to spell that limitation out.
> >
> > It doesn't? The "approxidate()" function should handle any reasonable date 
> > specifier, and the above is certainly more than reasonable.
> >
> > Why doesn't approxidate handle it?
> 
> The way I read the code is that get_sha1() would first do its
> magic at the first colon and feeds get_sha1_1() with prefix up
> to the first colon.  This gets passed down to get_sha1_basic()
> and what approxidate() is fed is the suffix of that prefix. It
> ends up seeing stuff between '@' and ':'.  I.e.
> 
> 	"master@2006-05-17 00:00:00:cache.h"
> 
> would ask for "00:00:cache.h" file in the "master" branch as of
> timestamp "2006-05-17 00".

Good catch.  I'll see if I can deal with it later; probably early
tomorrow morning before work.  It may just come down to documenting
this particular case as ambiguous and sure to parse the way you
did not mean it to.  :-)

I tested a bunch of other date formats but not the basic ISO.  Argh.
I'll send a test case soon for the expression parsing here, to be
sure we pull stuff from the log as expected as well as parse the
expression in a consistent way between releases.  :-)

-- 
Shawn.
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]