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

3 messages from 2021-04-21 to 2021-04-21. Participants: Hongyi Zhao, Taylor Blau.
Thread: https://gitlist.dev/t/55536

## Hongyi Zhao, 2021-04-21 14:19

Subject: The meaning of the '+' before the submodule hash.
Message-ID: <CAGP6PO+6MA9J1LRgGn4rcz8DBcW-hht92p-ahFaM9g6tcNFh-Q@mail.gmail.com>
URL: https://gitlist.dev/e/CAGP6PO%2B6MA9J1LRgGn4rcz8DBcW-hht92p-ahFaM9g6tcNFh-Q%40mail.gmail.com

```
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, 2021-04-21 14:25

Subject: Re: The meaning of the '+' before the submodule hash.
Message-ID: <YIA10O/BVrP3z/LK@nand.local>
URL: https://gitlist.dev/e/YIA10O%2FBVrP3z%2FLK%40nand.local
In-Reply-To: <CAGP6PO+6MA9J1LRgGn4rcz8DBcW-hht92p-ahFaM9g6tcNFh-Q@mail.gmail.com>

```
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, 2021-04-21 14:36

Subject: Re: The meaning of the '+' before the submodule hash.
Message-ID: <CAGP6POKTTBfrtsXEKi2P+xg0DLPNzo4+jRY+ySmJ0wOQFPdZpw@mail.gmail.com>
URL: https://gitlist.dev/e/CAGP6POKTTBfrtsXEKi2P%2Bxg0DLPNzo4%2BjRY%2BySmJ0wOQFPdZpw%40mail.gmail.com
In-Reply-To: <YIA10O/BVrP3z/LK@nand.local>

```
On Wed, Apr 21, 2021 at 10:25 PM Taylor Blau <me@ttaylorr.com> wrote:
>
> 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

```
