Skip to contentSkip to conversation

git problem

DISCUSSION Thomas Koeller 3 participants 7 messages Nov 28, 2007 – Nov 29, 2007 MIPS

lore
Share & tools
lore
#0 lore raw

Hi,

on my machine I have clones of both the linux-mips and Linus' kernel tree. I recently found that git-describe behaves differently in those trees:

bash-3.2$ cd linux-2.6.git/
bash-3.2$ git-status
# On branch master
nothing to commit (working directory clean)
bash-3.2$ git-describe bd71c182d5a02337305fc381831c11029dd17d64 v2.6.21-2747-gbd71c18
bash-3.2$ cd ../excite.git/
bash-3.2$ git-status
# On branch master
nothing to commit (working directory clean)
bash-3.2$ git-describe bd71c182d5a02337305fc381831c11029dd17d64
fatal: cannot describe 'bd71c182d5a02337305fc381831c11029dd17d64'

The commit is of course present in both trees. AFAIK the 'cannot describe' error shows if there are no tags at all, but this is not the case; .git/refs/tags is fully populated. Has anybody got a clue as to what may be wrong here?

Signature · 2 lines
Thomas Koeller
thomas at koeller dot dyndns dot org
#1 lore raw
Quoted 17 lines · Thomas Koeller

on my machine I have clones of both the linux-mips and Linus' kernel tree. I recently found that git-describe behaves differently in those trees:

bash-3.2$ cd linux-2.6.git/
bash-3.2$ git-status
# On branch master
nothing to commit (working directory clean)
bash-3.2$ git-describe bd71c182d5a02337305fc381831c11029dd17d64 v2.6.21-2747-gbd71c18
bash-3.2$ cd ../excite.git/
bash-3.2$ git-status
# On branch master
nothing to commit (working directory clean)
bash-3.2$ git-describe bd71c182d5a02337305fc381831c11029dd17d64
fatal: cannot describe 'bd71c182d5a02337305fc381831c11029dd17d64'

Quoted 4 lines

The commit is of course present in both trees. AFAIK the 'cannot describe' error shows if there are no tags at all, but this is not the case; .git/refs/tags is fully populated. Has anybody got a clue as to what may be wrong here?

I know the issue, for example:

[ralf@denk linux-mips]$ git log linux-1.3.0 | head -5 commit 908d4681a1dc3792ecafbe64265783a86c4cccb6

Author: Ralf Baechle <[email protected]>
Date:   Sun Oct 6 07:00:00 1996 +0000

Import of Linux/MIPS 2.1.1
[ralf@denk linux-mips]$ git describe 908d4681a1dc3792ecafbe64265783a86c4cccb6
fatal: cannot describe '908d4681a1dc3792ecafbe64265783a86c4cccb6' [ralf@denk linux-mips]$

I notice it primarily with fairly old tags though not necessarily as antique as this one.

Cheers,

Ralf

#2 lore raw
In reply to Thomas Koeller
Quoted 3 lines · Thomas Koeller

on my machine I have clones of both the linux-mips and Linus' kernel tree. I recently found that git-describe behaves differently in those trees:

[snip]

Quoted 3 lines

The commit is of course present in both trees. AFAIK the 'cannot describe' error shows if there are no tags at all, but this is not the case; .git/refs/tags is fully populated.

Not really, it can happen if the commit you're trying to describe and all of its parents are not tagged.

Quoted 1 line

Has anybody got a clue as to what may be wrong here?

Is the commit originally part of Linus' tree and was pulled later by Ralf ?

If so, it probably means that the commits committed by Ralf in his tree, which are the tagged ones, have no relationship with the ones pulled from Linus.

Franck

#3 lore raw
Quoted 14 lines · Franck Bui-Huu
Quoted 3 lines · Thomas Koeller

on my machine I have clones of both the linux-mips and Linus' kernel tree. I recently found that git-describe behaves differently in those trees:

[snip]

Quoted 3 lines

The commit is of course present in both trees. AFAIK the 'cannot describe' error shows if there are no tags at all, but this is not the case; .git/refs/tags is fully populated.

Not really, it can happen if the commit you're trying to describe and all of its parents are not tagged.

Quoted 8 lines
Quoted 1 line

Has anybody got a clue as to what may be wrong here?

Is the commit originally part of Linus' tree and was pulled later by Ralf ?

If so, it probably means that the commits committed by Ralf in his tree, which are the tagged ones, have no relationship with the ones pulled from Linus.

I intentionally do not carry the tags from Linus tree in the lmo git tree. Lots of additional tags with little actual use. Whoever would like then can pull from Linus' tree into a lmo clone to get Linus' tags.

Back to the original topic - git describe fails even with some of the very old commits of the lmo tree which are known to be tagged so there is something wrong.

Ralf

#4 lore raw
Quoted 3 lines · Ralf Baechle

Back to the original topic - git describe fails even with some of the very old commits of the lmo tree which are known to be tagged so there is something wrong.

Your issue seems different from Thomas' one. In your case:

	$ git cat-file -t refs/tags/linux-1.3.0
	commit

So the tag you mentioned is a _lightweight_ tag. These are not considered by git-describe by default.

To make git-describe work, just do:

	$ git describe --tags $(cat .git/refs/tags/linux-1.3.0)
	linux-1.3.0

Franck

#5 lore raw
Quoted 5 lines · Franck Bui-Huu
Quoted 3 lines · Ralf Baechle

Back to the original topic - git describe fails even with some of the very old commits of the lmo tree which are known to be tagged so there is something wrong.

Quoted 7 lines

Your issue seems different from Thomas' one. In your case:

	$ git cat-file -t refs/tags/linux-1.3.0
	commit

So the tag you mentioned is a _lightweight_ tag. These are not considered by git-describe by default.

Ah, thanks solving that miracle.

The lightweight tags were all created by the git to CVS converter two years ago. I was planning to replace those with signed tags anyway, another reason to do so.

Ralf

#6 lore raw
In reply to Franck Bui-Huu
Quoted 7 lines · Franck Bui-Huu
Quoted 3 lines · Thomas Koeller

The commit is of course present in both trees. AFAIK the 'cannot describe' error shows if there are no tags at all, but this is not the case; .git/refs/tags is fully populated.

Not really, it can happen if the commit you're trying to describe and all of its parents are not tagged.

Yes, that is what I meant to say.

Quoted 2 lines

Is the commit originally part of Linus' tree and was pulled later by Ralf ?

Indeed.

Quoted 4 lines

If so, it probably means that the commits committed by Ralf in his tree, which are the tagged ones, have no relationship with the ones pulled from Linus.

So far it has been my understanding that if I pull from a remote repository, all the commits are merged into the target branch, resulting in a combined history containing all my commits as well as those pulled. This means that as long as any (locally created or pulled) commit preceeding the one that git-describe is applied to is tagged, I would expect git-describe to find that tag. This seems to be a misconception, then?

Thomas

Signature · 2 lines
Thomas Koeller
[email protected]