From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: perryh@pluto.rain.com, trast@student.ethz.ch, git@vger.kernel.org
Subject: Re: How do I specify a revision for "git blame" by date?
Date: Fri, 15 Jun 2012 08:53:25 -0700 [thread overview]
Message-ID: <7vsjdwbmh6.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <20120615150107.GA4572@sigill.intra.peff.net> (Jeff King's message of "Fri, 15 Jun 2012 11:01:08 -0400")
Jeff King <peff@peff.net> writes:
> 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".
next prev parent reply other threads:[~2012-06-15 15:53 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
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 [this message]
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
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=7vsjdwbmh6.fsf@alter.siamese.dyndns.org \
--to=gitster@pobox.com \
--cc=git@vger.kernel.org \
--cc=peff@peff.net \
--cc=perryh@pluto.rain.com \
--cc=trast@student.ethz.ch \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.