git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why do dates in refspecs require the reflog?
@ 2014-12-30 20:12 Robert Dailey
  2014-12-30 20:16 ` Stefan Beller
                   ` (3 more replies)
  0 siblings, 4 replies; 9+ messages in thread
From: Robert Dailey @ 2014-12-30 20:12 UTC (permalink / raw)
  To: Git

I was surprised to find today that the following didn't work as expected:

$ git show master@{"1 year ago"}:Path/To/File.h

It gave me the following warning which did not make the problem obvious at all:
warning: Log for 'master' only goes back to Mon, 8 Sep 2014 12:08:44 -0500.

What it is trying to tell me (and I only found this out after a lot of
poking and prodding around Google) is that I can't refer to a commit
by date if it extends beyond the range of the reflog.

I don't understand why this requirement is in place. Each commit has a
time stamp, so in theory it should be possible to calculate an
absolute date from the duration specified in the refspec and grab the
commit from `git log` from that.

I can only assume I'm oversimplifying things and that there is a good
reason for this. If I can't get this to work, how can I view the
contents of a file at a specified relative time frame as I have done
above?

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2014-12-31  1:26 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-12-30 20:12 Why do dates in refspecs require the reflog? Robert Dailey
2014-12-30 20:16 ` Stefan Beller
2014-12-30 20:31 ` Junio C Hamano
2014-12-30 20:47 ` Junio C Hamano
2014-12-30 20:52 ` Michael Haggerty
2014-12-30 20:55   ` Junio C Hamano
2014-12-30 21:39     ` Robert Dailey
2014-12-31  1:26       ` Jeff King
2014-12-30 21:49     ` Michael Haggerty

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).