Nested submodule status bug
- From
- Damien Robert <damien.olivier.robert@gmail.com>
- Date
- Feb 26, 2020, 17:23 UTC
- Message-ID
- <20200226172338.unembhjhog36sqj7@mithrim>
- In-Reply-To
- <0123F1ED-C421-4C1F-896B-E54C9D345A34@gmail.com>
Dear git developers,
still about nested submodules, I stumbled upon the following very strange behaviour.
1) Make a baz submodule inside a bar submodule inside foo mkdir foo; cd foo; git init mkdir bar; cd bar; git init mkdir baz; cd baz; git init touch 1 git add 1 git commit -m 'first baz commit' cd .. git submodule add ./baz git commit -m "Add baz submodule" cd .. git submodule add ./bar git commit -m "Add bar submodule\n" git submodule absorbgitdirs cd bar touch 2
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) ~~~
While when not launched as an alias, `git -C baz status` give the correct result: On branch master nothing to commit, working tree clean
Note: I get the same bug when I use subs="! sh -c 'cd baz; git status'" The bug is only there if absorbgitdirs is used. Also I have to be in an intermediate submodule.
Best regards, Damien