git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: How do I specify a revision for "git blame" by date?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 15, 2012, 15:53 UTC
Message-ID
<7vsjdwbmh6.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20120615150107.GA4572@sigill.intra.peff.net>
Jeff King <peff@peff.net> writes:
Show 34 quoted lines
> But that still doesn't address the issue that (a) is not well-defined.
> Imagine I have this history:
>
>   A--B--C---G--H
>    \       /
>     D--E--F
>
> that is, two lines of development splitting at A and merging at H. And
> imagine the commit timestamps are (let's just refer to them as integers
> for the sake of simplicity, but they are representing days or seconds or
> whatever):
>
>   A(1)--B(2)--C(3)--G(7)--H(8)
>    \               /
>     D(2)--E(4)--F(6)
>
> What does it mean to ask for the commit at time=5?
> ...
> Git-blame expects you to give it a well-defined point (as it must, since
> it is a backwards walk down history showing what led to a particular set
> of content; it wouldn't make sense to feed it multiple starting points).
> You could do so by asking rev-list to walk the graph according to your
> requirements and feeding the result to blame, like:
>
>   # most recent on any line of development that is merged to HEAD
>   git blame `git rev-list -1 --until=5 HEAD`
>
>   # most recent on any line of development in the whole repo
>   git blame `git rev-list -1 --until=5 --all`
>
>   # most recent version on the first-parent; if you follow a
>   # topic-branch workflow and always merge up into "master", then this
>   # will blame what was on master at time=5
>   git blame `git rev-list -1 --until=5 --first-parent HEAD`
Very well explained.  Thanks.
The short answer to the question on "Subject:" line is "You don't".
Previous: Jeff KingNext: perryh@pluto.rain.com
Message 5 of 9 in “How do I specify a revision for "git blame" by date?”
  1. perryh@pluto.rain.comJun 14, 2012
  2. Thomas RastJun 14, 2012
  3. perryh@pluto.rain.comJun 15, 2012
  4. Jeff KingJun 15, 2012
  5. Junio C HamanoJun 15, 2012
  6. perryh@pluto.rain.comJun 16, 2012
  7. Andreas SchwabJun 14, 2012
  8. Junio C HamanoJun 14, 2012
  9. perryh@pluto.rain.comJun 15, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.