git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Jeff King <peff@peff.net>
Cc: Edmundo Carmona Antoranz <eantoranz@gmail.com>,
	Git List <git@vger.kernel.org>
Subject: Re: difflame
Date: Mon, 30 Jan 2017 13:08:41 -0800	[thread overview]
Message-ID: <xmqqd1f4uug6.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <20170128035321.yrcqwkg2fiwadxj4@sigill.intra.peff.net> (Jeff King's message of "Fri, 27 Jan 2017 22:53:21 -0500")

Jeff King <peff@peff.net> writes:

> On Tue, Jan 17, 2017 at 11:24:02PM -0600, Edmundo Carmona Antoranz wrote:
>
>> For a very long time I had wanted to get the output of diff to include
>> blame information as well (to see when something was added/removed).
>
> This is something I've wanted, too. The trickiest part, though, is
> blaming deletions, because git-blame only tracks the origin of content,
> not the origin of a change.

Hmph, this is a comment without looking at what difflame does
internally, so you can ignore me if I am misunderstood what problem
you are pointing out, but I am not sure how "tracks the origin of
content" could be a problem.

If output from "git show" says this:

	--- a/file
	+++ b/file
	@@ -1,5 +1,6 @@
	 a
	 b
	-c
	+C
	+D
	 d
	 e

in order to annotate lines 'a', 'b', 'd', and 'e' for their origin,
you would run 'blame' on the commit the above output was taken from
(or its parent---they are in the context so either would be OK).

You know where 'C' and 'D' came from already.  It's the commit you
are feeding "git show".

In order to run blame to find where 'c' came from, you need to start
at the _parent_ of the commit the above output came from, and the
hunk header shows which line range to find the final 'c'.

So...


  reply	other threads:[~2017-01-30 21:08 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-01-18  5:24 difflame Edmundo Carmona Antoranz
2017-01-28  3:53 ` difflame Jeff King
2017-01-30 21:08   ` Junio C Hamano [this message]
2017-01-30 23:26     ` difflame Jeff King
2017-01-31  1:35       ` difflame Edmundo Carmona Antoranz
2017-01-31  2:37         ` difflame Edmundo Carmona Antoranz
2017-02-03  4:46           ` difflame Edmundo Carmona Antoranz
2017-02-03  4:47             ` difflame Edmundo Carmona Antoranz

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqd1f4uug6.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=eantoranz@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).