git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Can someone explain this git-blame/git-rev behavior to me?
@ 2007-07-16 10:43 David Kastrup
  2007-07-16 13:24 ` Johannes Sixt
  2007-07-16 23:13 ` Junio C Hamano
  0 siblings, 2 replies; 6+ messages in thread
From: David Kastrup @ 2007-07-16 10:43 UTC (permalink / raw)
  To: git


Try the following (assuming you have a clone of the git master):

git-blame tags/v1.4.2-rc1~87 -- contrib/emacs/vc-git.el | grep b5dd
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 164) (defun vc-git-print-log (file &optional buffer)
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 167)     (vc-do-command buffer 'async "git" name "rev-list" "--pretty" "HEAD" "--")))
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 169) (defun vc-git-diff (file &optional rev1 rev2 buffer)
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 170)   (let ((name (file-relative-name file))
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 171)         (buf (or buffer "*vc-diff*")))
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 173)         (vc-do-command buf 0 "git" name "diff-tree" "-p" rev1 rev2 "--")
b5dd9d20 (Ville Skyttä      2006-07-05 01:35:52 +0300 174)       (vc-do-command buf 0 "git" name "diff-index" "-p" (or rev1 "HEAD") "--"))

Ok, now do

git-name-rev b5dd9d20
b5dd9d20 tags/v1.4.2-rc1~88

So what is it I am doing wrong here?  The problem I have is that in
Emacs, one can go to the "next version" in an annotated file, and I
get stuck in a loop here, since tags/v1.4.2-rc1~88 delivers

git-rev-list HEAD --not tags/v1.4.2-rc1~88 --parents contrib/emacs/vc-git.el|tail -1|git-name-rev --stdin

d87b90e47f7430455385edcf8506288b9a73d3b5 (tags/v1.4.2-rc1~87) b5dd9d2027c1bd5758033c7baf6d087752b0263d (tags/v1.4.2-rc1~88) 280242d1cc1fe2847f649d2f16b273e168fcbc48 (tags/v1.4.2-rc1~92)

So we have tags/v1.4.2-rc1~87 listed as successor again, so I get into
a loop of blame.

Is there something I don't understand about merges?

FWIW,
git-fsck --unreachable b5dd9d20
git-fsck --unreachable d87b90e47f
do not return anything.


-- 
David Kastrup

^ permalink raw reply	[flat|nested] 6+ messages in thread
* Re: Can someone explain this git-blame/git-rev behavior to me?
@ 2007-07-16 16:38 David Kastrup
  0 siblings, 0 replies; 6+ messages in thread
From: David Kastrup @ 2007-07-16 16:38 UTC (permalink / raw)
  To: git

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


Oops, I accidentally sent the following mail in private.  So I have to
forward back to the list (don't have the original):


[-- Attachment #2: Type: message/rfc822, Size: 2671 bytes --]

From: Johannes Sixt <J.Sixt@eudaptics.com>
To: David Kastrup <dak@gnu.org>
Subject: Re: Can someone explain this git-blame/git-rev behavior to me?
Date: Mon, 16 Jul 2007 18:09:39 +0200
Message-ID: <469B9843.835B5356@eudaptics.com>

David Kastrup wrote:
> 
> Johannes Sixt <J.Sixt@eudaptics.com> writes:
> 
> > David Kastrup wrote:
> 
> >> [nonsense not really related to the problem he has been seeing]
> 
> > [Johannes replied with a reasonable analysis]
> 
> Ok, scratch that.  I got completely confused.  Here is the gist of the
> problem that kicked me, this time boiled down to the actually relevant
> part:
> 
> I am looking for a descendant of tags/v1.4.4-rc1~72 with regard to
> contrib/emacs/vc-git.el by scanning the output of the first command
> in the following pipeline:
> 
> git-rev-list --parents HEAD ^tags/v1.4.4-rc1~72 -- vc-git.el|git-name-rev --stdin|fgrep tags/v1.4.4-rc1
> 
> This gives:
> 4de0f9f9b6ed1731de00b67952504e5a783f54a4 (tags/v1.5.0-rc0~31) 1259404c7e5cd88b7f6692986469cd20cbfacdad (tags/v1.4.4-rc1~71)
> 1259404c7e5cd88b7f6692986469cd20cbfacdad (tags/v1.4.4-rc1~71) b4aee09e610567529dc619d7324dc2fe85a11db5 (tags/v1.4.4-rc1~72) 0abc0260fa3419de649fcc1444e3d256a17ca6c7 (tags/v1.4.3.2~6)
> 
> And this looks like it would tell us that tags/v1.4.4-rc1~72 has with
> regard to vc-git.el a child tags/v1.4.4-rc1~71 and a grandchild of
> tags/v1.5.0-rc0~31.
> 
> Now if I instead do
> git-rev-list --parents HEAD -- vc-git.el|git-name-rev --stdin|fgrep tags/v1.4.4-rc1
> 
> 4de0f9f9b6ed1731de00b67952504e5a783f54a4 (tags/v1.5.0-rc0~31) b4aee09e610567529dc619d7324dc2fe85a11db5 (tags/v1.4.4-rc1~72)
> b4aee09e610567529dc619d7324dc2fe85a11db5 (tags/v1.4.4-rc1~72) 474a90fef9ebcdedee041b2def4b9a98b94cd146 (tags/v1.4.3.2~8)
> 
> I get to see that the child of tags/v1.4.4-rc1~72 is actually
> tags/v1.5.0-rc0~31, skipping tags/v1.4.4-rc1~71 which presumably did
> not change vc-git.el.
> 
> So the ^tags/v1.4.4-rc1~72 specification caused an additional mention
> of tags/v1.4.4-rc1~71 even though, with regard to vc-git.el, it would
> be equivalent to tags/v1.4.4-rc1~72.
> 
> So is there a way I can get the information of the second call without
> the performance loss of going through the entire history?

You better send the question again, this time to the list. I'm certainly
not the one who can answer this or even solve it.

It seems that there is an unwanted interaction between --parents and
history simplification at the edge commits. I don't think that there
will be an easy solution.

-- Hannes


[-- Attachment #3: Type: text/plain, Size: 66 bytes --]



So anybody has an idea how to go about this?

-- 
David Kastrup

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2007-07-17  9:57 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-07-16 10:43 Can someone explain this git-blame/git-rev behavior to me? David Kastrup
2007-07-16 13:24 ` Johannes Sixt
     [not found]   ` <86ps2s736g.fsf@lola.quinscape.zz>
     [not found]     ` <469B9843.835B5356@eudaptics.com>
2007-07-16 20:41       ` David Kastrup
2007-07-16 23:13 ` Junio C Hamano
2007-07-17  9:57   ` David Kastrup
  -- strict thread matches above, loose matches on Subject: below --
2007-07-16 16:38 David Kastrup

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).