All of lore.kernel.org
 help / color / mirror / Atom feed
From: Adam Simpkins <adam@adamsimpkins.net>
To: git@vger.kernel.org
Subject: Re: "gitk" and "git log --graph": Strange behaviour with --follow
Date: Wed, 9 Apr 2008 02:40:45 -0700	[thread overview]
Message-ID: <20080409094044.GA20235@adamsimpkins.net> (raw)
In-Reply-To: <20080408164208.GA13871@mithlond>

On Tue, Apr 08, 2008 at 07:42:08PM +0300, Teemu Likonen wrote:
> I found something very strange in graphical history tools "gitk" and
> "git log --graph" when used with --follow. In Git repository compare the
> following:
> 
>   $ gitk -- utf8.c
>   $ gitk --follow -- utf8.c
> 
> The output of "git log --graph" is somewhat similar:
> 
>   $ git log --graph --pretty=oneline -- utf8.c
>   $ git log --graph --pretty=oneline --follow -- utf8.c
> 
> All I can say is that the output is not intuitive at _all_. Almost all
> the commits are in separate history lines.

Yes, I see this behavior too.  The --follow option disables parent
rewriting, which gitk and "git log --graph" both rely on in this
instance.

Without --follow, the revision list is first pruned, and then the
parents are rewritten to include only those in the pruned list.  The
revision walk then occurs only over the pruned list.

With --follow, the revision list is not pruned, so parent rewriting
doesn't happen (and even if it did, I don't think it would have any
effect, since all commits are still in the list).  Instead, the
revision walk traverses all commits, but the log-tree/diff code simply
doesn't print any output for commits that aren't relevant.


I'm not familiar enough with the diff code to know the best way to fix
this.  One possible way might be to perform an extra revision walk in
revision.c before the "real" walk occurs.  This initial walk would
perform all of the diff calculations performed by the real walk, but
only for the purpose of pruning the list.  Then parent rewriting could
be done, and the "real" revision walk would only walk over the pruned
list.

-- 
Adam Simpkins
adam@adamsimpkins.net

      reply	other threads:[~2008-04-09  9:41 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-04-08 16:42 "gitk" and "git log --graph": Strange behaviour with --follow Teemu Likonen
2008-04-09  9:40 ` Adam Simpkins [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=20080409094044.GA20235@adamsimpkins.net \
    --to=adam@adamsimpkins.net \
    --cc=git@vger.kernel.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.