git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Junio C Hamano <gitster@pobox.com>
Cc: Matt McClure <matthewlmcclure@gmail.com>, git@vger.kernel.org
Subject: Re: Can `git blame` show the date that each line was merged?
Date: Tue, 4 Jun 2013 13:44:20 -0400	[thread overview]
Message-ID: <20130604174420.GA25318@sigill.intra.peff.net> (raw)
In-Reply-To: <7vfvwx9461.fsf@alter.siamese.dyndns.org>

On Tue, Jun 04, 2013 at 10:28:06AM -0700, Junio C Hamano wrote:

> > (though I suspect it would interact oddly with the "--reverse" option,
> > and we would want to either declare them mutually exclusive or figure
> > out some sane semantics).
> 
> It is entirely unclear who the first child is, so I tend to think
> that they have to be mutually exclusive.

That's my thinking, too, but I didn't want to rule out somebody thinking
of something clever.

> > Your problem is not the presence of "--merges" here, but that you forgot
> > the necessary "file" argument. Try "git blame --merges foo.c".
> >
> > However, this suffers from the same problem as --first-parent, in that
> > it is accepted but not respected. Doing so would not be impossible, but
> > it is a little more than the two-liner above.
> 
> What the command does when it "respects" it is unclear to me.
> In a history like this:
> 
> ---A---B---C
>     \       \
>      E---F---G---H
> 
> and starting at H, pretend everything that happened in, B, C, E and
> F since A was done by G?  Who gets the blame for what A or H did?

In general, I would expect "git blame" with revision arguments to behave
as if it was fed the history graph (including parent rewriting). So in
this case, I would think it would blame everything before G on G
(assuming there are no merges before A), and everything in H would be
"not yet committed".

That being said, we do not seem to rewrite parents for min/max parent
cases even in "git log". I'm not sure why, nor can I seem to provoke it
with simplification options. So maybe I am missing something clever.

-Peff

      reply	other threads:[~2013-06-04 17:44 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2013-06-04 13:39 Can `git blame` show the date that each line was merged? Matt McClure
2013-06-04 15:56 ` Jeff King
2013-06-04 17:26   ` Matt McClure
2013-06-04 17:28   ` Junio C Hamano
2013-06-04 17:44     ` Jeff King [this message]

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=20130604174420.GA25318@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    --cc=matthewlmcclure@gmail.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).