From: Greg KH <gregkh@linuxfoundation.org>
To: Junio C Hamano <gitster@pobox.com>
Cc: git@vger.kernel.org, Linus Torvalds <torvalds@linux-foundation.org>
Subject: Re: Funny 'git describe --contains' output
Date: Wed, 29 Aug 2012 11:17:32 -0700 [thread overview]
Message-ID: <20120829181731.GD3906@kroah.com> (raw)
In-Reply-To: <7vharmxkzl.fsf@alter.siamese.dyndns.org>
On Tue, Aug 28, 2012 at 11:36:46PM -0700, Junio C Hamano wrote:
> Junio C Hamano <gitster@pobox.com> writes:
>
> > Greg KH <gregkh@linuxfoundation.org> writes:
> >
> >> In the Linux kernel tree, commit 0136db586c028f71e7cc21cc183064ff0d5919
> >> is a bit "odd".
> >>
> >> If I go to look to see what release it was in, I normally do:
> >> $ git describe --contains 0136db586c028f71e7cc21cc183064ff0d5919
> >> v3.6-rc1~59^2~56^2~76
> >> ...
> >> Any ideas?
> >
> > That is 59 + 1 + 56 + 1 + 76 = 193 steps away from the tag v3.6-rc1.
> >
> > $ git name-rev --refs=refs/tags/v3.5-rc1 0136db58
> > 0136db58 tags/v3.5-rc1~83^2~81^2~76
> >
> > which is 83 + 1 + 81 + 1 + 76 = 242 steps away from that tag.
> >
> > So it _is_ odd that the newly tagged tip merged a branch that had
> > smaller development since it merged the commit, but name-rev seems
> > to be measuring the steps it takes from the tags to reach the commit
> > and giving us the one that gives the shortest path correctly.
> >
> > Obviously, that is not the same as "which tag is the oldest one
> > among the ones that can reach this commit?"
>
> As is usual for what I say, the above is an explanation of what we
> are seeing, not necessarily a justification.
>
> Given a history of this shape:
>
> o---o---o---o TONS!!!
> \
> ---o--o--o--o--o--Y--o---o---Z
> \ / /
> \ / /
> X---------------o
>
> where Y is v3.5-rc1 and Z is v3.6-rc1, "name-rev X" measures the
> distance of the shortest path between Z and X (Z^^2^ = 3 steps away)
> and between Y and X (Y~3^2 = 4 steps away), and uses the tag with
> the shortest path.
>
> But in order to answer "which is the earlier tag that merges X",
> what "name-rev" measures is not very interesting.
>
> What we want to see is the tag whose "weight" (imagine these commits
> are beads on strings, and you hold the tag between your fingers and
> lift it, pulling all the commits behind it on the history) is the
> smallest and reaches the commit X in question. The distance on the
> shortest path to X totally ignores tons of merges that went into the
> mainline between Y and Z. That is what makes name-rev not useful
> for this purpose.
>
> That "weight" is what Linus's "rev-list | wc -l" showed, but it is
> fairly expensive to compute. We do have a code that computes such
> weight in the history bisection code (it computes this exact weight
> for each and every commit that is still suspect, and picks the one
> that is half-way). We know how to compute it, but I suspect that
> applying that code naively to name-rev would make it unusably slow.
Thanks for the full explaination. "Normally" this never is an issue for
me, as this is the first time, in the history of Linux stable kernel
releases, that I've ever noticed this. And I agree, it's probably not
something that can easily be resolved in git, given how it's calculated.
thanks,
greg k-h
next prev parent reply other threads:[~2012-08-29 18:17 UTC|newest]
Thread overview: 19+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-08-29 4:48 Funny 'git describe --contains' output Greg KH
2012-08-29 5:57 ` Junio C Hamano
2012-08-29 6:36 ` Junio C Hamano
2012-08-29 18:17 ` Greg KH [this message]
2012-08-29 21:17 ` [PATCH 0/3] "git name-rev --weight" Junio C Hamano
2012-08-29 21:17 ` [PATCH 1/3] name-rev: lose unnecessary typedef Junio C Hamano
2012-08-29 21:17 ` [PATCH 2/3] name_rev: clarify when a new tip-name is assigned to a commit Junio C Hamano
2012-08-29 21:17 ` [PATCH 3/3] name-rev: --weight option (WIP) Junio C Hamano
2012-08-29 23:37 ` Junio C Hamano
2012-08-30 3:36 ` Jeff King
2012-08-30 3:53 ` Junio C Hamano
2012-08-30 3:55 ` Jeff King
2012-08-30 4:10 ` Junio C Hamano
2012-08-30 4:15 ` Junio C Hamano
2012-08-30 15:59 ` Junio C Hamano
2012-08-30 3:51 ` Jeff King
2012-08-30 4:09 ` Junio C Hamano
2012-08-30 7:06 ` [PATCH 0/3] "git name-rev --weight" Philip Oakley
2012-08-30 15:54 ` 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=20120829181731.GD3906@kroah.com \
--to=gregkh@linuxfoundation.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=torvalds@linux-foundation.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 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).