{"thread":{"id":"52320","subject":"[PATCH 0/1] doc: Correct man page for the SHAs reported by 'submodule status'","startedAt":"2019-11-22T23:11:29Z","lastAt":"2019-11-23T05:54:34Z","messageCount":6,"participants":["Manish Goregaokar via GitGitGadget","Junio C Hamano","Manish Goregaokar"],"isPatch":true,"patchVersion":1,"patchTotal":1},"messages":[{"id":"386876","messageId":"pull.470.git.1574464285.gitgitgadget@gmail.com","threadId":"52320","inReplyTo":null,"subject":"[PATCH 0/1] doc: Correct man page for the SHAs reported by 'submodule status'","fromName":"Manish Goregaokar via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-11-22T23:11:24Z","receivedAt":"2019-11-22T23:11:29Z","isPatch":true,"sender":{"key":"manishearth@gmail.com","avatar":"https://gravatar.com/avatar/023027eb83ba0eeb1774e43360d71f411f5cd9aff19ce1c954bc0459b766217a?d=mp&s=160"},"body":"The documentation is currently incorrect, it talks about the checked out\nSHAs when git submodule status actually reports the superproject's tracked\nSHAs.\n\nIt's possible (but unlikely IMO) that we should change the behavior of the\ntool to match the documentation. A flag for this behavior may be useful.\n\nManish Goregaokar (1):\n  Documentation: Correct man page for the SHAs reported by 'submodule\n    status'\n\n Documentation/git-submodule.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\n\nbase-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-470%2FManishearth%2Fsubmodule-sha-v1\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-470/Manishearth/submodule-sha-v1\nPull-Request: https://github.com/gitgitgadget/git/pull/470\n-- \ngitgitgadget\n"},{"id":"386877","messageId":"0eabb27ba0c7a07bbf24f13f1766c0ff63995348.1574464285.git.gitgitgadget@gmail.com","threadId":"52320","inReplyTo":"pull.470.git.1574464285.gitgitgadget@gmail.com","subject":"[PATCH 1/1] Documentation: Correct man page for the SHAs reported by 'submodule status'","fromName":"Manish Goregaokar via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-11-22T23:11:25Z","receivedAt":"2019-11-22T23:11:30Z","isPatch":true,"sender":{"key":"manishearth@gmail.com","avatar":"https://gravatar.com/avatar/023027eb83ba0eeb1774e43360d71f411f5cd9aff19ce1c954bc0459b766217a?d=mp&s=160"},"body":"From: Manish Goregaokar <manishsmail@gmail.com>\n\n'git submodule status' reports the SHAs expected by the parent project,\nnot the SHAs that are actually checked out in the submodule. Checking\nout a new SHA in a submodule will not change the output of 'git\nsubmodule status' until you 'git add' the submodule.\n\nSigned-off-by: Manish Goregaokar <manishsmail@gmail.com>\n---\n Documentation/git-submodule.txt | 4 ++--\n 1 file changed, 2 insertions(+), 2 deletions(-)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 0ed5c24dc1..31e089454a 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -72,8 +72,8 @@ git-submodule will correctly locate the submodule using the relative\n URL in `.gitmodules`.\n \n status [--cached] [--recursive] [--] [<path>...]::\n-\tShow the status of the submodules. This will print the SHA-1 of the\n-\tcurrently checked out commit for each submodule, along with the\n+\tShow the status of the submodules. This will print the SHA-1\n+\trecorded in the superproject for each submodule, along with the\n \tsubmodule path and the output of 'git describe' for the\n \tSHA-1. Each SHA-1 will possibly be prefixed with `-` if the submodule is\n \tnot initialized, `+` if the currently checked out submodule commit\n-- \ngitgitgadget\n"},{"id":"386887","messageId":"xmqqo8x32xqv.fsf@gitster-ct.c.googlers.com","threadId":"52320","inReplyTo":"0eabb27ba0c7a07bbf24f13f1766c0ff63995348.1574464285.git.gitgitgadget@gmail.com","subject":"Re: [PATCH 1/1] Documentation: Correct man page for the SHAs reported by 'submodule status'","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2019-11-23T01:21:44Z","receivedAt":"2019-11-23T01:21:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"\"Manish Goregaokar via GitGitGadget\" <gitgitgadget@gmail.com>\nwrites:\n\n> From: Manish Goregaokar <manishsmail@gmail.com>\n>\n> 'git submodule status' reports the SHAs expected by the parent project,\n> not the SHAs that are actually checked out in the submodule. Checking\n> out a new SHA in a submodule will not change the output of 'git\n> submodule status' until you 'git add' the submodule.\n>\n> Signed-off-by: Manish Goregaokar <manishsmail@gmail.com>\n> ---\n>  Documentation/git-submodule.txt | 4 ++--\n>  1 file changed, 2 insertions(+), 2 deletions(-)\n>\n> diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> index 0ed5c24dc1..31e089454a 100644\n> --- a/Documentation/git-submodule.txt\n> +++ b/Documentation/git-submodule.txt\n> @@ -72,8 +72,8 @@ git-submodule will correctly locate the submodule using the relative\n>  URL in `.gitmodules`.\n>  \n>  status [--cached] [--recursive] [--] [<path>...]::\n> -\tShow the status of the submodules. This will print the SHA-1 of the\n> -\tcurrently checked out commit for each submodule, along with the\n> +\tShow the status of the submodules. This will print the SHA-1\n> +\trecorded in the superproject for each submodule, along with the\n>  \tsubmodule path and the output of 'git describe' for the\n\nAm I mistaken to say that neither the old or the new description is\ncorrect, depending on the use (or non-use) of the --cached option?\n\n\t... print the object name of the commit that is currently\n\tchecked out, or the commit that is recorded in the\n\tsuperproject if `--cached` option is given, for each\n\tsubmodule, ...\n\nperhaps?\n"},{"id":"386894","messageId":"CACpkpxmtuunTXPc6=3bvPqGL=T7i4-LB0sKDmzLPxcNcv1ZH6A@mail.gmail.com","threadId":"52320","inReplyTo":"xmqqo8x32xqv.fsf@gitster-ct.c.googlers.com","subject":"Re: [PATCH 1/1] Documentation: Correct man page for the SHAs reported by 'submodule status'","fromName":"Manish Goregaokar","fromEmail":"manishsmail@gmail.com","sentAt":"2019-11-23T05:46:25Z","receivedAt":"2019-11-23T05:46:45Z","isPatch":true,"sender":{"key":"manishsmail@gmail.com","avatar":"https://avatars.githubusercontent.com/u/1617736?v=4"},"body":"Turns out that I've found a bug! I was getting this behavior because\nit wasn't detecting that submodules were modified. I'll submit a patch\nshortly, but first fix this one since the documentation should be\nfixed regardless.\n\nThanks,\n-Manish Goregaokar\n\n-Manish Goregaokar\n\n\nOn Fri, Nov 22, 2019 at 5:21 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> \"Manish Goregaokar via GitGitGadget\" <gitgitgadget@gmail.com>\n> writes:\n>\n> > From: Manish Goregaokar <manishsmail@gmail.com>\n> >\n> > 'git submodule status' reports the SHAs expected by the parent project,\n> > not the SHAs that are actually checked out in the submodule. Checking\n> > out a new SHA in a submodule will not change the output of 'git\n> > submodule status' until you 'git add' the submodule.\n> >\n> > Signed-off-by: Manish Goregaokar <manishsmail@gmail.com>\n> > ---\n> >  Documentation/git-submodule.txt | 4 ++--\n> >  1 file changed, 2 insertions(+), 2 deletions(-)\n> >\n> > diff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\n> > index 0ed5c24dc1..31e089454a 100644\n> > --- a/Documentation/git-submodule.txt\n> > +++ b/Documentation/git-submodule.txt\n> > @@ -72,8 +72,8 @@ git-submodule will correctly locate the submodule using the relative\n> >  URL in `.gitmodules`.\n> >\n> >  status [--cached] [--recursive] [--] [<path>...]::\n> > -     Show the status of the submodules. This will print the SHA-1 of the\n> > -     currently checked out commit for each submodule, along with the\n> > +     Show the status of the submodules. This will print the SHA-1\n> > +     recorded in the superproject for each submodule, along with the\n> >       submodule path and the output of 'git describe' for the\n>\n> Am I mistaken to say that neither the old or the new description is\n> correct, depending on the use (or non-use) of the --cached option?\n>\n>         ... print the object name of the commit that is currently\n>         checked out, or the commit that is recorded in the\n>         superproject if `--cached` option is given, for each\n>         submodule, ...\n>\n> perhaps?\n"},{"id":"386895","messageId":"pull.470.v2.git.1574488468.gitgitgadget@gmail.com","threadId":"52320","inReplyTo":"pull.470.git.1574464285.gitgitgadget@gmail.com","subject":"[PATCH v2 0/1] doc: Document 'git submodule status --cached'","fromName":"Manish Goregaokar via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-11-23T05:54:27Z","receivedAt":"2019-11-23T05:54:34Z","isPatch":true,"sender":{"key":"manishearth@gmail.com","avatar":"https://gravatar.com/avatar/023027eb83ba0eeb1774e43360d71f411f5cd9aff19ce1c954bc0459b766217a?d=mp&s=160"},"body":"It's currently undocumented, and should be mentioned.\n\nI previously thought that git submodule status was displaying the behaviors\nof git submodule status --cached and was thus incorrectly documented, but\nthat wasn't actually the case: turns out that git submodule status just\ndoesn't work when not in the root directory.\n\nManish Goregaokar (1):\n  doc: Document 'git submodule status --cached'\n\n Documentation/git-submodule.txt | 3 +++\n 1 file changed, 3 insertions(+)\n\n\nbase-commit: 5fa0f5238b0cd46cfe7f6fa76c3f526ea98148d9\nPublished-As: https://github.com/gitgitgadget/git/releases/tag/pr-470%2FManishearth%2Fsubmodule-sha-v2\nFetch-It-Via: git fetch https://github.com/gitgitgadget/git pr-470/Manishearth/submodule-sha-v2\nPull-Request: https://github.com/gitgitgadget/git/pull/470\n\nRange-diff vs v1:\n\n 1:  0eabb27ba0 ! 1:  3168924c3c Documentation: Correct man page for the SHAs reported by 'submodule status'\n     @@ -1,11 +1,9 @@\n      Author: Manish Goregaokar <manishsmail@gmail.com>\n      \n     -    Documentation: Correct man page for the SHAs reported by 'submodule status'\n     +    doc: Document 'git submodule status --cached'\n      \n     -    'git submodule status' reports the SHAs expected by the parent project,\n     -    not the SHAs that are actually checked out in the submodule. Checking\n     -    out a new SHA in a submodule will not change the output of 'git\n     -    submodule status' until you 'git add' the submodule.\n     +    'git submodule status --cached' reports the SHAs expected by the parent project,\n     +    instead of the SHAs that are actually checked out in the submodule.\n      \n          Signed-off-by: Manish Goregaokar <manishsmail@gmail.com>\n      \n     @@ -13,13 +11,12 @@\n       --- a/Documentation/git-submodule.txt\n       +++ b/Documentation/git-submodule.txt\n      @@\n     - URL in `.gitmodules`.\n     - \n     - status [--cached] [--recursive] [--] [<path>...]::\n     --\tShow the status of the submodules. This will print the SHA-1 of the\n     --\tcurrently checked out commit for each submodule, along with the\n     -+\tShow the status of the submodules. This will print the SHA-1\n     -+\trecorded in the superproject for each submodule, along with the\n     - \tsubmodule path and the output of 'git describe' for the\n     - \tSHA-1. Each SHA-1 will possibly be prefixed with `-` if the submodule is\n     - \tnot initialized, `+` if the currently checked out submodule commit\n     + \tdoes not match the SHA-1 found in the index of the containing\n     + \trepository and `U` if the submodule has merge conflicts.\n     + +\n     ++If `--cached` is specified, this command will instead print the SHA-1\n     ++recorded in the superproject for each submodule.\n     +++\n     + If `--recursive` is specified, this command will recurse into nested\n     + submodules, and show their status as well.\n     + +\n\n-- \ngitgitgadget\n"},{"id":"386896","messageId":"3168924c3c6f12a293b25a00f333a55d4b8fa3a9.1574488468.git.gitgitgadget@gmail.com","threadId":"52320","inReplyTo":"pull.470.v2.git.1574488468.gitgitgadget@gmail.com","subject":"[PATCH v2 1/1] doc: Document 'git submodule status --cached'","fromName":"Manish Goregaokar via GitGitGadget","fromEmail":"gitgitgadget@gmail.com","sentAt":"2019-11-23T05:54:28Z","receivedAt":"2019-11-23T05:54:34Z","isPatch":true,"sender":{"key":"manishearth@gmail.com","avatar":"https://gravatar.com/avatar/023027eb83ba0eeb1774e43360d71f411f5cd9aff19ce1c954bc0459b766217a?d=mp&s=160"},"body":"From: Manish Goregaokar <manishsmail@gmail.com>\n\n'git submodule status --cached' reports the SHAs expected by the parent project,\ninstead of the SHAs that are actually checked out in the submodule.\n\nSigned-off-by: Manish Goregaokar <manishsmail@gmail.com>\n---\n Documentation/git-submodule.txt | 3 +++\n 1 file changed, 3 insertions(+)\n\ndiff --git a/Documentation/git-submodule.txt b/Documentation/git-submodule.txt\nindex 0ed5c24dc1..f05c2b92fb 100644\n--- a/Documentation/git-submodule.txt\n+++ b/Documentation/git-submodule.txt\n@@ -80,6 +80,9 @@ status [--cached] [--recursive] [--] [<path>...]::\n \tdoes not match the SHA-1 found in the index of the containing\n \trepository and `U` if the submodule has merge conflicts.\n +\n+If `--cached` is specified, this command will instead print the SHA-1\n+recorded in the superproject for each submodule.\n++\n If `--recursive` is specified, this command will recurse into nested\n submodules, and show their status as well.\n +\n-- \ngitgitgadget\n"}]}