From: Jeff King <peff@peff.net>
To: Toby Corkindale <toby.corkindale@rea-group.com>
Cc: Junio C Hamano <gitster@pobox.com>, git@vger.kernel.org
Subject: Re: diff/Checking out by date specification
Date: Mon, 30 Jun 2008 01:21:05 -0400 [thread overview]
Message-ID: <20080630052105.GA21954@sigill.intra.peff.net> (raw)
In-Reply-To: <48686339.60205@rea-group.com>
On Mon, Jun 30, 2008 at 02:38:17PM +1000, Toby Corkindale wrote:
> I think it would be good if you could give a couple of examples, such as:
> How would I go about checking out the code at the state it was in at,
> say, 2008-01-01?
> Or how one can get a diff between 2008-01-01 and 2008-01-08?
>
> (I note that "git-diff --until=2008-01-08 --since=2008-01-01" fails, as
> does "git-checkout --until=2008-01-08")
That is a little bit trickier, since there is a not a convenient syntax
for selecting a particular revision by commit time. So you _can_ do
this:
git diff \
`git rev-list -1 --until=2008-01-01 HEAD` \
`git rev-list -1 --until=2008-01-08 HEAD`
But that isn't quite what you want either. Remember that history can
follow many branches simultaneously. So what we are saying with
"--until" here is "show me all the commits that happened before this
time", and then we use "-1" to say "pick the first one." So you are
really picking two points in time that are close to what you want, and
then diffing the two states.
Depending on what you want to do, that may be enough. But more likely,
you are interested in the actual shape of history, so looking at the
individual commits with something like "gitk --since=2008-01-01
--until=2008-01-08" is probably going to be more instructive.
-Peff
next prev parent reply other threads:[~2008-06-30 5:22 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-30 2:24 diff/Checking out by date specification Toby Corkindale
2008-06-30 3:27 ` Jeff King
2008-06-30 4:38 ` Toby Corkindale
2008-06-30 5:09 ` Daniel Barkalow
2008-06-30 5:21 ` Jeff King [this message]
2008-06-30 5:26 ` Jeff King
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=20080630052105.GA21954@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=toby.corkindale@rea-group.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).