Re: git cat-file on a submodule
- From
Stefan Beller <sbeller@google.com>
- Date
- Jan 11, 2017, 00:25 UTC
- Message-ID
- <CAGZ79kbb8b=jLiwJAE7ktq-wYKce-152__aA3bU_uBnV1pbXqg@mail.gmail.com>
- In-Reply-To
- <1484093500.17967.6.camel@frank>
On Tue, Jan 10, 2017 at 4:11 PM, David Turner <novalis@novalis.org> wrote:
Show 5 quoted lines
> Why does git cat-file -t $sha:foo, where foo is a submodule, not work? > > git rev-parse $sha:foo works. > > By "why", I mean "would anyone complain if I fixed it?"
$ git log -- builtin/cat-file.c |grep -i -e gitlink -e submodule $ # no result
I think nobody cared so far. Go for it!
> FWIW, I think > -p should just return the submodule's sha.
That sounds right as the sha1 is also printed for the tree already, i.e. in Gerrit you can get the submodules via $ git cat-file -p HEAD:plugins/ 100644 blob c6bb7f182440d6ab860bbcfadc9901b0d94d1ee3 BUCK 160000 commit 9b163e113de9f3a49219a02d388f7f46ea2559d3 commit-message-length-validator 160000 commit 69b8f9f413ce83a71593a4068a3b8e81f684cbad cookbook-plugin 160000 commit 7b41f3a413b46140b050ae5324cbbcdd467d2b3a download-commands 160000 commit 3acc14d10d26678eae6489038fe0d4dad644a9b4 hooks 160000 commit c5123d6a5604cc740d6f42485235c0d3ec141c4e replication 160000 commit 3f3d572e9618f268b19cc54856deee4c96180e4c reviewnotes 160000 commit 3ca1167edda713f4bfdcecd9c0e2626797d7027f singleusergroup
"commit <sha1>" is the correct answer already :)
Thanks, Stefan