Git development
 help / color / mirror / Atom feed
From: Jeff King <peff@peff.net>
To: Raymundo <gypark@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: 'git log --source' seems to fail to show ref name after the first tag comes out.
Date: Wed, 25 Nov 2015 07:59:57 -0500	[thread overview]
Message-ID: <20151125125956.GC4504@sigill.intra.peff.net> (raw)
In-Reply-To: <CAAe7MbAwWHXxVOu-CU7QpN0K3XTKJ1=xp4-dzSwBQatdAZ1vaQ@mail.gmail.com>

On Wed, Nov 25, 2015 at 07:29:02PM +0900, Raymundo wrote:

> At first, I'm sorry I'm not good at English.

No problem. Your report was very clear. :)

> When I execute this command:
> 
> git log --oneline --source --all --decorate
> [...]
> As you can see, ref names in the second column repeats to disappear
> and come back, at every lines that contain tags.

I was able to reproduce this pretty easily with a short test case:

  git init
  git commit --allow-empty -m one
  git commit --allow-empty -m two
  git commit --allow-empty -m three
  git tag -m mytag HEAD^

Starting from one source works:

  $ git log --oneline --source master
  de009a4 master three
  b75220d master two
  62f49bd master one

But starting from the tag as well does not:

  $ git log --oneline --source master mytag
  de009a4 master three
  b75220d  two
  62f49bd  one

Or more simply, starting from the tag never has any sources:

  $ git log --oneline --source mytag
  b75220d  two
  62f49bd  one

It's like the tag paints its commit with an empty "source" field (and
then we propagate that down the graph).

> I tested using Git version 2.6.3
> 
> For reference, Git version 1.7.9.rc0 does not have this problem. It
> shows ref names on all lines well.

Sounds like a good opportunity to use git-bisect. I came up with 2073949
(traverse_commit_list: support pending blobs/trees with paths,
2014-10-15) from git v2.2.0, which unfortunately was written by me. :)

This one-liner seems to fix it:

diff --git a/revision.c b/revision.c
index af2a18e..d434b8b 100644
--- a/revision.c
+++ b/revision.c
@@ -297,7 +297,6 @@ static struct commit *handle_commit(struct rev_info *revs,
 		 * through to the non-tag handlers below. Do not
 		 * propagate data from the tag's pending entry.
 		 */
-		name = "";
 		path = NULL;
 		mode = 0;
 	}

But I'm not sure if it causes other problems. In particular, I see why
we would not propagate a path field, but I do not know why the original
was avoiding propagating the name field.

-Peff

  reply	other threads:[~2015-11-25 13:00 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-11-25 10:29 'git log --source' seems to fail to show ref name after the first tag comes out Raymundo
2015-11-25 12:59 ` Jeff King [this message]
2015-11-25 14:00   ` Raymundo

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=20151125125956.GC4504@sigill.intra.peff.net \
    --to=peff@peff.net \
    --cc=git@vger.kernel.org \
    --cc=gypark@gmail.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