Re: referencing a revision at a certain date

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

 



On Mon, Feb 11, 2008 at 10:40:39AM -0800, Jakub Narebski wrote:
> But you can can get commit closest to given date by combining the time
> limiting with limiting number of commits, as described in "Commit
> limiting" in git-rev-list(1) and git-log(1) manpages.
> 
>   $ git log -n 1 --before=<date> <branch>
> 
> which would return first commit older than <date>, starting from
> <branch>.

OK, thanks, I guess the --before part answers my question: so to get
revision "rev" back at date "YYYY-MM-DD" (always using first parents)
I'd do

git rev-list rev -n 1 --first-parent --before=YYYY-MM-DD

as in:

git checkout "`git rev-list rev -n 1 --first-parent --before=YYYY-MM-DD`"

It's a bit of a mouthful, but it does what I want (although I still
think a syntax such as rev~@{YYYY-MM-DD} or rev~{YYYY-MM-DD} or
whatever might prove useful: I imagine I'm not the first person to
wish for something of the sort).

Thanks,

-- 
     David A. Madore
    (david.madore@xxxxxx,
     http://www.madore.org/~david/ )
-
To unsubscribe from this list: 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]

  Powered by Linux