git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Shawn Pearce <spearce@spearce.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git <git@vger.kernel.org>
Subject: Re: blame --reverse selecting wrong commit
Date: Sun, 29 May 2011 19:33:07 -0700	[thread overview]
Message-ID: <BANLkTimAij28ibW3DV2HaHPK5z0D-CrDHQ@mail.gmail.com> (raw)
In-Reply-To: <BANLkTikuFEg686VH_RojEe-zmBZRBOx6eA@mail.gmail.com>

On Sun, May 29, 2011 at 19:21, Shawn Pearce <spearce@spearce.org> wrote:
> Although blame shows Stefan Lay removed the block in commit 05fa1713,
> this isn't what happened. It was actually removed in commit 2302a6d3
> by Christian Halstrick. It looks like blame gets confused around this
> section of the JGit history.
>
> Repository URL:  git://egit.eclipse.jgit/jgit.git
>
> $ git blame -L 1080, --reverse 40fa75feb..master --
> org.eclipse.jgit.test/tst/org/eclipse/jgit/storage/file/RefDirectoryTest.java

Actually, you can use a narrower history range of 16e810b2..aa05559.

I found this glitch while working on the new JGit implementation of
reverse blame. It just so happens you and I both took the same rule on
a merge commit, follow the parent that has exactly the blob of the
merge itself... passing all blame onto it.

Except that in reverse mode this isn't true. One of the "parents" is
the descendent that deleted this method, so of course its not
identical content. The other parent is a different side-branch that
didn't touch the file at all. Later blame finds these branches merge
together, and lays the blame on the wrong side.

It seems that we may want to avoid "parents" that have identical file
content when in reverse mode if there is another parent that has
different content for the current target path.

-- 
Shawn.

  reply	other threads:[~2011-05-30  2:33 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-05-30  2:21 blame --reverse selecting wrong commit Shawn Pearce
2011-05-30  2:33 ` Shawn Pearce [this message]
2011-05-30  3:11   ` Shawn Pearce
2011-05-30  6:47     ` Junio C Hamano
2011-05-30 17:57       ` Shawn Pearce
2011-05-30 20:01         ` Junio C Hamano

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=BANLkTimAij28ibW3DV2HaHPK5z0D-CrDHQ@mail.gmail.com \
    --to=spearce@spearce.org \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.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).