Git development
 help / color / mirror / Atom feed
* How can I tell if a SHA1 is a submodule reference?
@ 2008-05-15 19:39 Robin Luckey
  2008-05-15 20:12 ` Avery Pennarun
                   ` (2 more replies)
  0 siblings, 3 replies; 5+ messages in thread
From: Robin Luckey @ 2008-05-15 19:39 UTC (permalink / raw)
  To: git

I am parsing the output of git-diff-tree to create some code analysis  
reports.

When a user adds a submodule to a repository, git-diff-tree reports  
the SHA1 of the commit from the submodule.

However, if I subsequently try to pass this SHA1 to git-cat-file, or  
indeed any other git command I have tried, I receive an error:

error: unable to find b0f8c354b142e27333abd0f175544b71a0cc444e
fatal: Not a valid object name b0f8c354b142e27333abd0f175544b71a0cc444e

This makes sense to me, since these objects are not stored locally;  
they are stored in the submodule repository.

However, is there a simple and reliable way for me to know which SHA1  
hashes refer to such submodule objects? I'd like to simply ignore them.

My ideal feature would be that `git cat-file -t` would respond with  
`submodule`, but of course this does not happen. Long term, an '-- 
ingore-submodules' flag for git would be great since I wouldn't see  
these hashes in the first place.

However, today, given an arbitrary hash, how can I tell whether it is  
a submodule commit?

Thanks,
Robin

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

end of thread, other threads:[~2008-05-15 20:57 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-05-15 19:39 How can I tell if a SHA1 is a submodule reference? Robin Luckey
2008-05-15 20:12 ` Avery Pennarun
2008-05-15 20:13 ` Linus Torvalds
2008-05-15 20:21 ` Junio C Hamano
2008-05-15 20:56   ` Robin Luckey

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox