git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
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: Sun, 29 Jun 2008 23:27:45 -0400	[thread overview]
Message-ID: <20080630032744.GA18930@sigill.intra.peff.net> (raw)
In-Reply-To: <486843C3.30402@rea-group.com>

On Mon, Jun 30, 2008 at 12:24:03PM +1000, Toby Corkindale wrote:

> `man git-rev-parse` seems to indicate that one can look at the state of  
> the repository by date (absolute or relative), and use this for diff or  
> checkout, etc.
> It includes examples such as "{yesterday}" and "{1979-02-26 18:30:00}".

It's a little bit more complex than that. The branch@{time} syntax means
"what was in _my_ branch at that time". And if you just cloned, your
branch doesn't go back very far.

If you want to say "find commits that happened before time T", you want
--until or --since (or their aliases --before and --after).

Would the documentation patch below have helped with the confusion?

-- >8 --
doc/rev-parse: clarify reflog vs --until for specifying revisions

The rev-parse manpage introduces the branch@{date} syntax,
and mentions the reflog specifically. However, new users may
not be familiar with the distinction between the reflog and
the commit date, so let's help them out with a "you may be
interested in --until" pointer.

Signed-off-by: Jeff King <peff@peff.net>
---
 Documentation/git-rev-parse.txt |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-rev-parse.txt b/Documentation/git-rev-parse.txt
index 9e273bc..59e95ad 100644
--- a/Documentation/git-rev-parse.txt
+++ b/Documentation/git-rev-parse.txt
@@ -184,7 +184,10 @@ blobs contained in a commit.
   second ago\}' or '\{1979-02-26 18:30:00\}') to specify the value
   of the ref at a prior point in time.  This suffix may only be
   used immediately following a ref name and the ref must have an
-  existing log ($GIT_DIR/logs/<ref>).
+  existing log ($GIT_DIR/logs/<ref>). Note that this looks up the state
+  of your *local* ref at a given time; e.g., what was in your local
+  `master` branch last week. If you want to look at commits made during
+  certain times, see `--since` and `--until`.
 
 * A ref followed by the suffix '@' with an ordinal specification
   enclosed in a brace pair (e.g. '\{1\}', '\{15\}') to specify
-- 
1.5.6.1.202.g3a23.dirty

  reply	other threads:[~2008-06-30  3:29 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 [this message]
2008-06-30  4:38   ` Toby Corkindale
2008-06-30  5:09     ` Daniel Barkalow
2008-06-30  5:21     ` Jeff King
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=20080630032744.GA18930@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).