# git show submodule

2 messages from 2020-12-30 to 2020-12-30. Participants: Михаил Павлович Сидоренко, Philippe Blain.
Thread: https://gitlist.dev/t/54904

## Михаил Павлович Сидоренко, 2020-12-30 07:29

Subject: git show submodule
Message-ID: <4ddc481f-7d03-e225-13a0-d5fd33456c43@gmail.com>
URL: https://gitlist.dev/e/4ddc481f-7d03-e225-13a0-d5fd33456c43%40gmail.com
In-Reply-To: <ab49430e-5a9f-5910-e048-7f07dca8f898@gmail.com>

```
Hello!

git show dose not work with file-submodule. Try this series of commands:

cd /tmp/
git clone https://github.com/abdes/submodule-docker-dev-workflow.git
cd submodule-docker-dev-workflow
git show ee83dd336f27315d14a7ad6ad934897a61e49623:LICENSE | head -n 1 # 
good
git show ee83dd336f27315d14a7ad6ad934897a61e49623:server # bad

My output:

$ cd /tmp/
$ git clone https://github.com/abdes/submodule-docker-dev-workflow.git
Клонирование в «submodule-docker-dev-workflow»…
remote: Enumerating objects: 110, done.
remote: Total 110 (delta 0), reused 0 (delta 0), pack-reused 110
Получение объектов: 100% (110/110), 24.76 KiB | 313.00 KiB/s, готово.
Определение изменений: 100% (56/56), готово.
$ cd submodule-docker-dev-workflow
$ git show ee83dd336f27315d14a7ad6ad934897a61e49623:LICENSE | head -n 1 
# good
The MIT License (MIT)
$ git show ee83dd336f27315d14a7ad6ad934897a61e49623:server # bad
fatal: bad object ee83dd336f27315d14a7ad6ad934897a61e49623:server

It would be convenient for me so that I could see the revision of the 
submodule through git show. Without using the git submodule status command.

Happy New Year,
Mikhail Pavlovich Sidorenko.

```

## Philippe Blain, 2020-12-30 16:13

Subject: Re: git show submodule
Message-ID: <5b66521a-9533-63dd-09dc-25785d03f76a@gmail.com>
URL: https://gitlist.dev/e/5b66521a-9533-63dd-09dc-25785d03f76a%40gmail.com
In-Reply-To: <4ddc481f-7d03-e225-13a0-d5fd33456c43@gmail.com>

```
Hi Mikhail,

Le 2020-12-30 à 02:29, Михаил Павлович Сидоренко a écrit :
> Hello!
> 
> git show dose not work with file-submodule. Try this series of commands:
> 
> cd /tmp/
> git clone https://github.com/abdes/submodule-docker-dev-workflow.git
> cd submodule-docker-dev-workflow
> git show ee83dd336f27315d14a7ad6ad934897a61e49623:LICENSE | head -n 1 # good
> git show ee83dd336f27315d14a7ad6ad934897a61e49623:server # bad
> 
> My output:
> 
> $ cd /tmp/
> $ git clone https://github.com/abdes/submodule-docker-dev-workflow.git
> Клонирование в «submodule-docker-dev-workflow»…
> remote: Enumerating objects: 110, done.
> remote: Total 110 (delta 0), reused 0 (delta 0), pack-reused 110
> Получение объектов: 100% (110/110), 24.76 KiB | 313.00 KiB/s, готово.
> Определение изменений: 100% (56/56), готово.
> $ cd submodule-docker-dev-workflow
> $ git show ee83dd336f27315d14a7ad6ad934897a61e49623:LICENSE | head -n 1 # good
> The MIT License (MIT)
> $ git show ee83dd336f27315d14a7ad6ad934897a61e49623:server # bad
> fatal: bad object ee83dd336f27315d14a7ad6ad934897a61e49623:server

I can reproduce that behavior, and it happens even if the submodules
are initialized (`git submodule update --init`, or `git clone --recurse-submodules`).

> 
> It would be convenient for me so that I could see the revision of the submodule through git show. Without using the git submodule status command.

Note that `git rev-parse ee83dd336f27315d14a7ad6ad934897a61e49623:server`
does work.

> 
> Happy New Year,
> Mikhail Pavlovich Sidorenko.

Cheers,

Philippe.

```
