git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Jan Hudec <bulb@ucw.cz>
To: Matthieu Moy <Matthieu.Moy@imag.fr>
Cc: Samuel Lucas Vaz de Mello <samuellucas@datacom.ind.br>,
	git@vger.kernel.org
Subject: Re: Blamming a diff between two commits?
Date: Sun, 22 Feb 2009 20:11:38 +0100	[thread overview]
Message-ID: <20090222191138.GC6504@efreet.light.src> (raw)
In-Reply-To: <vpqtz6mpas3.fsf@bauges.imag.fr>

[-- Attachment #1: Type: text/plain, Size: 1753 bytes --]

On Sun, Feb 22, 2009 at 19:49:16 +0100, Matthieu Moy wrote:
> Jan Hudec <bulb@ucw.cz> writes:
> > On Tue, Feb 17, 2009 at 10:16:17 -0300, Samuel Lucas Vaz de Mello wrote:
> >> Hi,
> >> 
> >> Is there any way to git blame (or annotate) a diff between two commits?
> >> [...]
> >
> > What about doing a diff of the blames? It should do the same thing (except
> > the +/- would be at the begining of the lines). Well, not exactly, because if
> > there was a change, that was reverted again, blames would change, so it would
> > appear here, but that's probably rare enough to ignore (if you don't even
> > want to see it rather than not).
> 
> I don't think that would do it.
> 
> Suppose I have the following history (in a one-line file) :
> 
> revision: R1 -> R2 -> R3 -> R4 -> R5 -> R6
> content:  A  -> B  -> B  -> C  -> D  -> E 
> 
> If I do a blame at revision R3, I'll get
> 
> R2 B
> 
> Then, at revision R6, I'd get
> 
> R6 E
> 
> so the diff will be
> 
> - R2 B
> + R6 E
> 
> while the original poster actually wanted
> 
> - R3 B
> + R6 E
> 
> In the first case, the annotation for - lines tell where the removed
> line had been introduced before, while the second case tells up to
> which revision the line has been existing (or, it could show the
> revision which removed it, R4 here).

You are right, it is something different.

Both are probably useful, though -- knowing where the deleted line was
introduced would be useful so you can look up rationale for the old code in
the respective commit message and check whether the new version does not miss
any points mentioned there. Provided you have good descriptions in the
comments, of course.

-- 
						 Jan 'Bulb' Hudec <bulb@ucw.cz>

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 197 bytes --]

      reply	other threads:[~2009-02-22 19:13 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-02-17 13:16 Blamming a diff between two commits? Samuel Lucas Vaz de Mello
2009-02-17 13:53 ` Johannes Schindelin
2009-02-17 14:09   ` Samuel Lucas Vaz de Mello
2009-02-17 14:27     ` Johannes Schindelin
2009-02-17 14:03 ` Matthieu Moy
2009-02-17 14:09 ` Thomas Rast
2009-02-20 20:04   ` Thomas Rast
2009-02-22 12:32 ` Jan Hudec
2009-02-22 18:49   ` Matthieu Moy
2009-02-22 19:11     ` Jan Hudec [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=20090222191138.GC6504@efreet.light.src \
    --to=bulb@ucw.cz \
    --cc=Matthieu.Moy@imag.fr \
    --cc=git@vger.kernel.org \
    --cc=samuellucas@datacom.ind.br \
    /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).