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

Strangeness with git-add and nested repositories

From
AJAndrew J <andj2223@gmail.com>
Date
Apr 27, 2016, 08:31 UTC
Message-ID
<CAH6n4TdG9LQOPaaw_H6vuCgia0-4JXhPsSiAJPa5GtjfduQoSw@mail.gmail.com>
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
Next: Stefan Beller
Message 1 of 10 in “Strangeness with git-add and nested repositories”
  1. Andrew JApr 27, 2016
  2. Stefan BellerApr 27, 2016
  3. Andrew JApr 28, 2016
  4. Stefan BellerApr 28, 2016
  5. Junio C HamanoApr 28, 2016
  6. Junio C HamanoApr 28, 2016
  7. Andrew JApr 29, 2016
  8. Stefan BellerApr 28, 2016
  9. Junio C HamanoApr 29, 2016
  10. Junio C HamanoApr 29, 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.