git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* How do I specify a revision for "git blame" by date?
@ 2012-06-14 15:26 perryh
  2012-06-14 10:05 ` Thomas Rast
  2012-06-14 10:19 ` Andreas Schwab
  0 siblings, 2 replies; 9+ messages in thread
From: perryh @ 2012-06-14 15:26 UTC (permalink / raw)
  To: git

How do I get "git blame" to operate "as of" a particular date in
the past, without having to manually look up the corresponding
SHA1 using "git rev-list"?  For example, I can get a report as of
2011-12-29 by doing something like:

  $ git rev-list --all --date-order --format="%h %ai" .
  ...
  7c69106 2012-01-03 ...
  b4227af 2011-12-27 ...
  ...

  $ git blame <file> b4227af

but I want to have git look up the last revision prior to the given
date, by doing something like

  $ git blame <file> @{2011-12-29}

This does not work as written:  it ignores the date parameter with
a warning:

  warning: Log for '' only goes back to Thu, 10 May 2012 08:14:16 -0700.

If I use HEAD@ instead of just @ I get the same message with 'HEAD'
in place of '', and everything else I've tried gives a "fatal: bad
revision" message.

Clearly, as shown by git rev-list, the log for the _repository_
goes back farther than May 10, so this is a problem of finding the
correct syntax rather than of wanting to do something "impossible".
What do I need to put in front of the @ to cause the entire log to
be examined?

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

end of thread, other threads:[~2012-06-16 20:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-06-14 15:26 How do I specify a revision for "git blame" by date? perryh
2012-06-14 10:05 ` Thomas Rast
2012-06-15 13:02   ` perryh
2012-06-15 15:01     ` Jeff King
2012-06-15 15:53       ` Junio C Hamano
2012-06-16  4:13         ` perryh
2012-06-14 10:19 ` Andreas Schwab
2012-06-14 17:22   ` Junio C Hamano
2012-06-15 13:03   ` perryh

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