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

Re: Nested submodule status bug

From
DRDamien Robert <damien.olivier.robert@gmail.com>
Date
Feb 27, 2020, 10:05 UTC
Message-ID
<20200227100557.ydouc4n3jphzbits@feanor>
In-Reply-To
<20200226172338.unembhjhog36sqj7@mithrim>
From Damien Robert, Wed 26 Feb 2020 at 18:23:41 (+0100) :
Show 15 quoted lines
> 2) Now add the following alias:
>   subs="! git -C baz status"
> 
> 3) And run it
>   git subs
> 
> To get:
> ~~~
> On branch master
> Untracked files:
>   (use "git add <file>..." to include in what will be committed)
> 	../2
> 
> nothing added to commit but untracked files present (use "git add" to track)
> ~~~
Ok, so using GIT_TRACE and GIT_TRACE_STATUS and doing some debugging I
understand the cause of the bug. When using the alias,
the GIT_DIR environment is set to the bar module:
    GIT_DIR=/tmp/test/foo/.git/modules/bar
and is exported.

That's explain why in `baz` the status report the status of the `bar` directory.

Previous: Damien RobertNext: Damien Robert
Message 6 of 13 in “Nested submodule checkout”
  1. Damien RobertFeb 14, 2020
  2. Philippe BlainFeb 17, 2020
  3. Damien RobertFeb 18, 2020
  4. Philippe BlainFeb 19, 2020
  5. Nested submodule status bugDamien Robert, Feb 26, 2020
  6. Damien RobertFeb 27, 2020
  7. Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug]Damien Robert, Feb 27, 2020
  8. GIT_DIR in aliases [Re: Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug]Damien Robert, Feb 27, 2020
  9. Jeff KingFeb 28, 2020
  10. Junio C HamanoFeb 28, 2020
  11. Damien RobertMar 3, 2020
  12. Philippe BlainFeb 29, 2020
  13. Damien RobertMar 3, 2020

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.