git/list[1] front-page[2] threads[3] people[4] search[5] about
 

git describe --contains doesn't work properly for a commit

From
MHMichal Hocko <mhocko@suse.cz>
Date
Feb 26, 2015, 13:35 UTC
Message-ID
<20150226133534.GB14878@dhcp22.suse.cz>
Hi,
I have just encountered an old kernel git commit:
commit c854363e80b49dd04a4de18ebc379eb8c8806674
Author: Dave Chinner <david@fromorbit.com>
Date:   Sat Feb 6 12:39:36 2010 +1100
    xfs: Use delayed write for inodes rather than async V2
[...]

which cannot be described properly: $ git describe --contains c854363e80b49dd04a4de18ebc379eb8c8806674 fatal: cannot describe 'c854363e80b49dd04a4de18ebc379eb8c8806674'

but it seems to find a tag on which the commit is based: $ git describe c854363e80b49dd04a4de18ebc379eb8c8806674 v2.6.33-rc4-49-gc854363e80b4

if I follow parents
sha=c854363e80b49dd04a4de18ebc379eb8c8806674; 
while true
do 
	parent=$(git show --format=%P $sha | head -1)
	echo $sha $parent
	git describe --contains $parent && break
	sha=$parent
done
c854363e80b49dd04a4de18ebc379eb8c8806674 777df5afdb26c71634edd60582be620ff94e87a0
fatal: cannot describe '777df5afdb26c71634edd60582be620ff94e87a0'
777df5afdb26c71634edd60582be620ff94e87a0 d5db0f97fbbeff11c88dec1aaf1536a975afbaeb
fatal: cannot describe 'd5db0f97fbbeff11c88dec1aaf1536a975afbaeb'
d5db0f97fbbeff11c88dec1aaf1536a975afbaeb 388f1f0c346b533b06d8bc792f7204ebc3e4b7da
v2.6.34-rc1~278^2~14

I am using: $ git --version git version 2.1.4

but the same seems to be the case with older git version (1.8.5.6). $ git rev-list c854363e80b49dd04a4de18ebc379eb8c8806674..v2.6.34 | wc -l 11648

So there seems to be a line between the two commits AFAIU.
Is the history somehow broken or is it a bug in git?
-- 
Michal Hocko
SUSE Labs
Next: Michal Hocko
Message 1 of 9 in “git describe --contains doesn't work properly for a commit”
  1. Michal HockoFeb 26, 2015
  2. Michal HockoFeb 26, 2015
  3. Jeff KingMar 4, 2015
  4. Michael J GruberMar 4, 2015
  5. Jeff KingMar 4, 2015
  6. Junio C HamanoMar 4, 2015
  7. Mike HommeyMar 4, 2015
  8. Jeff KingMar 5, 2015
  9. Junio C HamanoMar 5, 2015

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.