Thread (1 message) 1 message, 1 author, 2017-01-11

Re: git cat-file on a submodule

From: Junio C Hamano <hidden>
Date: 2017-01-11 18:57:00

Jeff King [off-list ref] writes:
On Tue, Jan 10, 2017 at 07:11:40PM -0500, David Turner wrote:
quoted
Why does git cat-file -t $sha:foo, where foo is a submodule, not work?
...
I'm not sure if I'm complaining or not. I can't immediately think of
something that would be horribly broken. But it really feels like you
are using the wrong tool, and patching the tool to handle this case will
probably lead to weird cognitive dissonance down the road.
"git cat-file [any option] $sha" should fail and complain for any
$sha that does not name an object that exists in the object database
of the repository it is working on.  

So I'd complain if the first example command quoted above from
David's mail stopped failing when the commit bound at 'foo' in the
top-level treeish $sha (i.e. a commit in the submodule) does not
exist in the top-level repository's object database.
Maybe it would help to describe your use case more fully. If what you
care about is the presumed type based on the surrounding tree, then
maybe:

  git --literal-pathspecs ls-tree $sha -- foo

would be a better match.
Yup.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help