From: David Madore <david.madore@ens.fr>
To: GIT mailing-list <git@vger.kernel.org>
Subject: referencing a revision at a certain date
Date: Mon, 11 Feb 2008 19:04:24 +0100 [thread overview]
Message-ID: <20080211180424.GA4905@clipper.ens.fr> (raw)
Hi,
I'm left quite confused by the git-rev-parse(1) man page, I wonder if
someone can help me with this.
I understand that if "rev" denotes a certain revision, then "rev~42"
references the commit which is 42 generations back from rev. What I'd
like to do is write something like "rev~@{2008-01-18}" (say) to get
the same thing but with the 42 being computed automatically so that
the commit in question is the latest possible (in commit date) before
2008-01-18. Is this possible? If so, how? If not, might I suggest
this as an addition for consideration?
I thought "rev@{2008-01-18}" did this, but apparently it doesn't: it
requires a ref log of some kind, and I don't know how to make a ref
log (git-clone doesn't seem to copy them).
So, is there some way I can either generate a ref log by
systematically taking the first parent in each commit as per git-log
--first-parent, OR (better) specify a revision directly that way?
Typical problem I'm faced with:
mizar david /tmp $ git clone git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux-2.6.git
Initialized empty Git repository in /tmp/linux-2.6/.git/
remote: Counting objects: 712898, done.
remote: Compressing objects: 100% (124199/124199), done.
Indexing 712898 objects...
remote: Total 712898 (delta 591709), reused 708828 (delta 587713)
100% (712898/712898) done
Resolving 591709 deltas...
100% (591709/591709) done
Checking 23757 files out...
100% (23757/23757) done
mizar david /tmp $ cd linux-2.6
mizar david /tmp/linux-2.6 $ git rev-parse 'master@{2008-02-01}'
warning: Log for 'master' only goes back to Mon, 11 Feb 2008 18:34:33 +0100.
0000000000000000000000000000000000000000
mizar david /tmp/linux-2.6 $ git rev-parse 'origin@{2008-02-01}'
warning: Log for 'origin' only goes back to Mon, 11 Feb 2008 18:34:32 +0100.
0000000000000000000000000000000000000000
mizar david /tmp/linux-2.6 $ git cat-file -p 'master~1126' | head -5
tree a72dadd4a8b4957a4e21bf7ae38a763a71d6e274
parent e1a9c9872dd004617555dff079b357a6ffd945e9
parent c4772d99300a9fc13c86aaa370e630c5973664f6
author Linus Torvalds <torvalds@linux-foundation.org> 1201821909 +1100
committer Linus Torvalds <torvalds@linux-foundation.org> 1201821909 +1100
=> there must be some intelligent way of finding this revision, but
which is it?
Cheers,
--
David A. Madore
(david.madore@ens.fr,
http://www.madore.org/~david/ )
next reply other threads:[~2008-02-11 18:18 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-02-11 18:04 David Madore [this message]
2008-02-11 18:29 ` referencing a revision at a certain date Jeff King
2008-02-11 18:40 ` Jakub Narebski
2008-02-11 18:57 ` David Madore
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=20080211180424.GA4905@clipper.ens.fr \
--to=david.madore@ens.fr \
--cc=git@vger.kernel.org \
/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).