Re: can git-describe learn first-parent behavior?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Johannes Sixt venit, vidit, dixit 21.09.2010 12:03:
> Am 9/21/2010 11:34, schrieb Michael J Gruber:
>> The earlier tag (in terms of depth) wins, yes.
> 
> Does it? Then explain this result:
> 
> git describe e5498e8a^2 e5498e8a^1~24 e5498e8a
> v1.7.0.7
> v1.7.1.1
> v1.7.1.1-38-ge5498e8
> 
> v1.7.1.1 is 25 commits away, while v1.7.0.7 is a parent (the second).
> 
> AFAICS, git-describe does The Right Thing (--first-parent).

I'm not saying it does the wrong thing. I'm saying it does not do
--first-parent but depth priority (where depth is a bit complicated),
which may or may not be the same as first-parent transversal/priority.
You picked one case where they coincide:

git describe --debug e5498e8a^2 e5498e8a^2~24 e5498e8a
v1.7.0.7
v1.7.0.5
searching to describe e5498e8a
 annotated         38 v1.7.1.1
 annotated        252 v1.7.1
 annotated        268 v1.7.1-rc2
 annotated        318 v1.7.1-rc1
 annotated        355 v1.7.1-rc0
 annotated        478 v1.7.0.7
 annotated        492 v1.7.0.6
 annotated        512 v1.7.0.5
 annotated        539 v1.7.0.4
 annotated        564 v1.7.0.3
traversed 1267 commits
more than 10 tags found; listed 10 most recent
gave up search at 97222d9634b5518cd3d328aa86b52746a16334a7
v1.7.1.1-38-ge5498e8

v1.7.1.1 clearly wins by depth priority.


In an example like Joshua's, it is obviously not the first parent which
wins by default:

* 771c6c7 (HEAD, master) more_development
*   88b63bd Merge branch 'maint'
|\
| * d99fb44 (tag: v1.1-stable, maint) v1.1-stable
* | c2f7480 development
* | 9480bca (tag: v2.0-base) v2.0-base
|/
* 31e78ef (tag: v1.0-stable) v1.0-stable

git describe --debug --tags  HEAD
searching to describe HEAD
 lightweight        4 v1.1-stable
 lightweight        4 v2.0-base
 lightweight        5 v1.0-stable
traversed 6 commits
v1.1-stable-4-g771c6c7

git describe --debug --tags --match v2\* HEAD
searching to describe HEAD
 lightweight        4 v2.0-base
traversed 6 commits
v2.0-base-4-g771c6c7

git describe --debug --tags --first-parent HEAD
searching to describe HEAD
 lightweight        3 v2.0-base
 lightweight        4 v1.0-stable
traversed 5 commits
v2.0-base-3-g771c6c7

The latter is with my RFC PATCH, of course.

Note that without the commit "development", v2.0-base wins even in the
first case, even though this does not change the first-parent relationships.

Cheers
Michael
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]