git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Strangeness with git-add and nested repositories
@ 2016-04-27  8:31 Andrew J
  2016-04-27 16:08 ` Stefan Beller
  0 siblings, 1 reply; 10+ messages in thread
From: Andrew J @ 2016-04-27  8:31 UTC (permalink / raw)
  To: git

I've noticed some strangeness with git-add and nested repos.

This tar.gz has a reproduction script, parent repo, and nested repo
that exhibits the issue:
https://drive.google.com/uc?export=download&id=0Bwjufq6oAZMfcGVxZ2dlMElEVlE

If you extract the archive and do the following (on linux please, I
haven't even tried this on Windows):
cd git-add-bug
./bad-git-add.sh
(Examine the script before running, please)

It will echo what I'm encountering to the screen, so it should be
straightforward to follow, but I will summarize here:
If I run a git-add command where one or more of the files live in
nested repositories, like so (command is shortened here, includes more
files in the script):
git add -v -f --
src/chromium/src/third_party/libFuzzer/src/FuzzerInterface.h testfile
As confirmed by git-status, this results in testfile being added, but
FuzzerInterface.h not being added.
FuzzerInterface.h is inside of a nested repository
(src/chromium/src/third_party/libFuzzer/src/), while testfile is in
the current main repository.

On the other hand, the following command:
git add -v -f -- src/chromium/src/third_party/libFuzzer/src/FuzzerInterface.h
Results in FuzzerInterface.h being added, as confirmed by git-status.
Excluding testfile from the git-add command seems to do the trick.

My expectation:
Both testfile and FuzzerInterface.h should be added if they are
specified in the git-add command, regardless of whether they are
specified along with another file that doesn't happen to live in a
nested repository ("testfile" in this example).

If someone could help me understand what's going on here, I'd appreciate it.

Thanks,

Andrew

^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2016-04-29  2:55 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-04-27  8:31 Strangeness with git-add and nested repositories Andrew J
2016-04-27 16:08 ` Stefan Beller
2016-04-28  6:10   ` Andrew J
2016-04-28 16:35     ` Stefan Beller
2016-04-28 16:39   ` Junio C Hamano
2016-04-28 16:48     ` Junio C Hamano
2016-04-29  2:11       ` Andrew J
2016-04-28 16:54     ` Stefan Beller
2016-04-29  2:51     ` Junio C Hamano
2016-04-29  2:54       ` Junio C Hamano

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 NNTP newsgroup(s).