From: David Madore <david.madore@ens.fr>
To: GIT mailing-list <git@vger.kernel.org>
Cc: Jakub Narebski <jnareb@gmail.com>
Subject: Re: referencing a revision at a certain date
Date: Mon, 11 Feb 2008 19:57:13 +0100 [thread overview]
Message-ID: <20080211185713.GA16898@clipper.ens.fr> (raw)
In-Reply-To: <m3r6fje3q8.fsf@localhost.localdomain>
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@ens.fr,
http://www.madore.org/~david/ )
prev parent reply other threads:[~2008-02-11 18:57 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-11 18:04 referencing a revision at a certain date David Madore
2008-02-11 18:29 ` Jeff King
2008-02-11 18:40 ` Jakub Narebski
2008-02-11 18:57 ` David Madore [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20080211185713.GA16898@clipper.ens.fr \
--to=david.madore@ens.fr \
--cc=git@vger.kernel.org \
--cc=jnareb@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).