threads / discuss / 55536

The meaning of the '+' before the submodule hash.

Subject: The meaning of the '+' before the submodule hash.

## tl;dr

3 messages between Apr 21, 2021 and Apr 21, 2021.

replies: 2people: 2as markdown or json

Hongyi Zhao· Apr 21, 2021, 14:19 UTC · lore
Hi,
See the following output given below by `git submodule status`:
$ git submodule status
+c7b9787f0b7826a87f07ce00cbfe4947b8521101 external/devxlib (heads/master)
 d0197c76ae76bbf4d3fed20444fac31af550069d external/eigensolver_gpu
(v0.3.1-7-gd0197c7)
+6fef49bcfc4a380432f15734ed0ca1f0b0388977 external/fox (4.1.2-89-g6fef49b)
+4b3c7c249f6a2cfed76603d9987cf5164fa6f9e1 external/lapack
(v3.7.0-1026-g4b3c7c249)
+2899044d2a6828aa16e0189913662bc35ce8f645 external/mbd (0.12.1-43-g2899044)
+2b9973c12e85397fa9564370f6cced16f8428834 external/wannier90
(v3.1.0-35-g2b9973c)

What's the meaning of the '+' sign at the beginning? Why do some submodules have this symbol, but some submodules don't?

Regards
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China
Taylor Blau· Apr 21, 2021, 14:25 UTC · re: Hongyi Zhao · lore

Re: The meaning of the '+' before the submodule hash.

On Wed, Apr 21, 2021 at 10:19:25PM +0800, Hongyi Zhao wrote:
> What's the meaning of the '+' sign at the beginning? Why do some
> submodules have this symbol, but some submodules don't?

There are three symbols, 'U', '-', and '+'. From the documentation [1], they mean:

    Each SHA-1 will possibly be prefixed with `-` if the submodule is not
    initialized, `+` if the currently checked out submodule commit does not
    match the SHA-1 found in the index of the containing repository and `U`
    if the submodule has merge conflicts.
[1]: https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-status--cached--recursive--ltpathgt82308203

Thanks, Taylor

Hongyi Zhao· Apr 21, 2021, 14:36 UTC · re: Taylor Blau · lore

Re: The meaning of the '+' before the submodule hash.

On Wed, Apr 21, 2021 at 10:25 PM Taylor Blau <me@ttaylorr.com> wrote:
Show 14 quoted lines
>
> On Wed, Apr 21, 2021 at 10:19:25PM +0800, Hongyi Zhao wrote:
> > What's the meaning of the '+' sign at the beginning? Why do some
> > submodules have this symbol, but some submodules don't?
>
> There are three symbols, 'U', '-', and '+'. From the documentation [1],
> they mean:
>
>     Each SHA-1 will possibly be prefixed with `-` if the submodule is not
>     initialized, `+` if the currently checked out submodule commit does not
>     match the SHA-1 found in the index of the containing repository and `U`
>     if the submodule has merge conflicts.
>
> [1]: https://git-scm.com/docs/git-submodule#Documentation/git-submodule.txt-status--cached--recursive--ltpathgt82308203

Thank you very much for pointing out this document information to me. The above submodules status for my case were achieved by the following command:

$ git submodule update --init --recursive --remote

As you can see, this will cause the status denoted by '+', i.e., the currently checked out submodule commit does not match the SHA-1 found in the index of the containing repository. I'm not sure if this is harmful.

HY
> Thanks,
> Taylor
-- 
Assoc. Prof. Hongyi Zhao <hongyi.zhao@gmail.com>
Theory and Simulation of Materials
Hebei Polytechnic University of Science and Technology engineering
NO. 552 North Gangtie Road, Xingtai, China

← back to recent threads