How can I tell if a SHA1 is a submodule reference?
- Date: Thu, 15 May 2008 12:39:03 -0700
- From: Robin Luckey <robin@xxxxxxxxx>
- Subject: How can I tell if a SHA1 is a submodule reference?
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 b0f8c354b142e27333abd0f175544b71a0cc444eThis 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 -- 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
- Follow-Ups:
- Re: How can I tell if a SHA1 is a submodule reference?
- From: Junio C Hamano
- Re: How can I tell if a SHA1 is a submodule reference?
- From: Linus Torvalds
- Re: How can I tell if a SHA1 is a submodule reference?
- From: Avery Pennarun
- Re: How can I tell if a SHA1 is a submodule reference?
- Prev by Date: Re: [PATCH v3] Add support for GIT_CEILING_DIRS
- Next by Date: Re: [PATCH] builtin-clone: fix initial checkout
- Previous by thread: [PATCH] Updated status to show 'Not currently on any branch' in red
- Next by thread: Re: How can I tell if a SHA1 is a submodule reference?
- Index(es):