git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Ryan Anderson <ryan@michonline.com>
To: Jeff King <peff@peff.net>
Cc: ryan@michonline.com, git@vger.kernel.org
Subject: Re: git-annotate bug report
Date: Mon, 7 Aug 2006 04:50:01 -0700	[thread overview]
Message-ID: <20060807115000.GC15477@h4x0r5.com> (raw)
In-Reply-To: <20060803203848.GA15121@coredump.intra.peff.net>

On Thu, Aug 03, 2006 at 04:38:48PM -0400, Jeff King wrote:
> git-annotate on the tip of master seems to be broken for some files (but
> not for others):

Well, I think I've found a few bugs here tonight, basically all are
related to handling merges correctly.

First, a trivial one:

git diff-tree -M --name-status -z outputs the sha1 without honoring the
-z.  Patch following this email.

Second, one I don't know how to fix, at the moment:

git annotate uses the automatic tree simplification that git rev-list
does.  So, when it sees a commit with 1 parent, it assumes that it
really only has one parent.  git diff-tree -c doesn't know about this
same tree simplification, and, in the case of a merge commit, will still
output the -c format patch.

That particular case is trivial, simply remove the -c from commits where
I *know* there is only parent, and ask for the exact diff I need, from
the parent to the current rev.

There is, unfortunately, another situation, that of an octopus merge.
In the case of read-tree.c (after the rename is followed), the commit
7bd1527d2d8c80a6e9a0f8583082a5aee5428c68 is problematic.  In it we have
a 4-way merge, yet only 3 paths affected read-tree.c.  The diff-parsing
in annotate constructs a regular expression to find the diff header and
read out the line number to work on, and also to construct some regular
expressions from which to tell which lines affect which parents.

For example, it looks for a line like:
+ ++Line added in 3 parents
with dynamically generated regular expressions.  These, of course, need
to know how many parents there are.  The fact that diff-tree uses a
different number of parents makes the parsing fail, and then, the fact
that there isn't a great way to figure out which of the real parents
corresponds to the pseudo parents, makes this whole thing very
messy to fix.

So, the solution I've settled on is to use git merge-base to perform
some analysis and create a pseudo-parent list that is the same size as
the actual parent list, but consisting mostly of the fake parents
git-rev-list gives me.

If anyone else is confused by this email, it's probably because I
stopped and fixed a bug in the middle of writing it.

Patches as followups to this.


-- 

Ryan Anderson
  sometimes Pug Majere

  parent reply	other threads:[~2006-08-07 11:51 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-08-03 20:38 git-annotate bug report Jeff King
2006-08-03 21:10 ` Ryan Anderson
2006-08-07 11:50 ` Ryan Anderson [this message]
2006-08-07 12:11   ` [PATCH 1/2] log-tree: show_log() should respect the setting of diffopt->line_termination Ryan Anderson
2006-08-07 12:11     ` [PATCH 2/2] annotate: Fix bug when parsing merges with differing real and logical parents Ryan Anderson
2006-08-07 19:16       ` Junio C Hamano
2006-08-07 19:45         ` Ryan Anderson
2006-08-07 20:00         ` Annotate another problem report Junio C Hamano
2006-08-07 20:19           ` Ryan Anderson
2006-08-07 19:38     ` [PATCH 1/2] log-tree: show_log() should respect the setting of diffopt->line_termination Junio C Hamano
2006-08-08  8:49   ` git-annotate bug report 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=20060807115000.GC15477@h4x0r5.com \
    --to=ryan@michonline.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.
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).