git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH v7 5/7] submodule: correct output of submodule log format

From
Stefan Beller <sbeller@google.com>
Date
Aug 18, 2016, 18:25 UTC
Message-ID
<CAGZ79kZdXXe7QwgtK8ZNHS+aKDx5vOc9rvETP9zo+ZCTCX10oQ@mail.gmail.com>
In-Reply-To
<20160818005131.31600-6-jacob.e.keller@intel.com>
On Wed, Aug 17, 2016 at 5:51 PM, Jacob Keller <jacob.e.keller@intel.com> wrote:
Show 22 quoted lines
> From: Jacob Keller <jacob.keller@gmail.com>
>
> The submodule log diff output incorrectly states that the submodule is
> "not checked out" in cases where it wants to say the submodule is "not
> initialized". Change the wording to reflect the actual check being
> performed.
>
> Signed-off-by: Jacob Keller <jacob.keller@gmail.com>
> ---
>  submodule.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/submodule.c b/submodule.c
> index 1b5cdfb7e784..e1a51b7506ff 100644
> --- a/submodule.c
> +++ b/submodule.c
> @@ -348,7 +348,7 @@ void show_submodule_summary(FILE *f, const char *path,
>         if (is_null_sha1(two))
>                 message = "(submodule deleted)";
>         else if (add_submodule_odb(path))
> -               message = "(not checked out)";
> +               message = "(not initialized)";
I think "not checked" out is actually correct here.
    $ git clone https://gerrit.googlesource.com/gerrit
    $ cd gerrit
    $ git submodule update --init
      ...
    $ git diff cc82b24..5222e66 plugins/
    Submodule plugins/cookbook-plugin 2d40ee2..69b8f9f:
     > Organize imports
    $ rm -rf plugins/cookbook-plugin/
    $ git diff cc82b24..5222e66 plugins/
    Submodule plugins/cookbook-plugin 2d40ee2...69b8f9f (not checked out)
    $

Mind that by "rm -rf" of the working dir I create the "not checked out, but initialized state and even cloned state".

So as a long term TODO:
    I guess we could teach `add_submodule_odb` to operate
    inside its git directory instead of its working directory, to have
    it working whenever we have the object database (no matter if
    checked out or not). Although this may collide with the plan of a
    different refs backend? I dunno.
add_submodule_odb is used in a variety of places:
    show_submodule_header
    submodule_needs_pushing
    push_submodule
    is_submodule_commit_present
    merge_submodule

And all of them seem to not require a checkout, but the presence of objects is fine.

Previous: Jacob KellerNext: Jacob Keller
Message 18 of 24 in “implement inline submodule diff format”
  1. 0/7 implement inline submodule diff formatJacob Keller, Aug 18, 2016
  2. 1/7 diff.c: remove output_prefix_length fieldJacob Keller, Aug 18, 2016
  3. 6/7 submodule: refactor show_submodule_summary with helper functionJacob Keller, Aug 18, 2016
  4. David AguilarAug 18, 2016
  5. Jacob KellerAug 18, 2016
  6. Stefan BellerAug 18, 2016
  7. Jacob KellerAug 18, 2016
  8. Stefan BellerAug 18, 2016
  9. Jacob KellerAug 18, 2016
  10. Junio C HamanoAug 18, 2016
  11. Jacob KellerAug 18, 2016
  12. 7/7 diff: teach diff to display submodule difference with an inline diffJacob Keller, Aug 18, 2016
  13. Stefan BellerAug 18, 2016
  14. Jacob KellerAug 18, 2016
  15. 3/7 diff: prepare for additional submodule formatsJacob Keller, Aug 18, 2016
  16. Stefan BellerAug 18, 2016
  17. 5/7 submodule: correct output of submodule log formatJacob Keller, Aug 18, 2016
  18. Stefan BellerAug 18, 2016
  19. Jacob KellerAug 18, 2016
  20. 4/7 submodule: allow do_submodule_path to work if given gitdir directlyJacob Keller, Aug 18, 2016
  21. Junio C HamanoAug 18, 2016
  22. Jacob KellerAug 18, 2016
  23. Stefan BellerAug 18, 2016
  24. 2/7 graph: add support for --line-prefix on all graph-aware outputJacob Keller, Aug 18, 2016

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.