git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Damien Robert <damien.olivier.robert@gmail.com>
To: Philippe Blain <levraiphilippeblain@gmail.com>
Cc: git@vger.kernel.org
Subject: Nested submodule status bug
Date: Wed, 26 Feb 2020 18:23:38 +0100	[thread overview]
Message-ID: <20200226172338.unembhjhog36sqj7@mithrim> (raw)
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

  parent reply	other threads:[~2020-02-26 17:23 UTC|newest]

Thread overview: 13+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-02-14 22:42 Nested submodule checkout Damien Robert
2020-02-17  4:51 ` Philippe Blain
2020-02-18 17:08   ` Damien Robert
2020-02-19  4:19     ` Philippe Blain
2020-02-26 17:23   ` Damien Robert [this message]
2020-02-27 10:05     ` Nested submodule status bug Damien Robert
2020-02-27 10:43       ` Spurious GIT_DIR set when in a worktree [was Re: Nested submodule status bug] Damien Robert
2020-02-27 15:50         ` GIT_DIR in aliases [Re: " Damien Robert
2020-02-28 19:02           ` Jeff King
2020-02-28 20:22             ` Junio C Hamano
2020-03-03 22:44             ` Damien Robert
2020-02-29  1:42           ` Philippe Blain
2020-03-03 21:56             ` Damien Robert

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200226172338.unembhjhog36sqj7@mithrim \
    --to=damien.olivier.robert@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=levraiphilippeblain@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).