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

Re: Adding nested repository with slash adds files instead of gitlink

From
PSPhil Sainty <phil@catalyst.net.nz>
Date
Aug 8, 2024, 11:20 UTC
Message-ID
<s5wr0azfeh9.fsf@catalyst.net.nz>
In-Reply-To
<CACsJy8CW1=Ea984s8J0Y6y4B6qJKZMdsXVFRQc8YcuoQNfXEqw@mail.gmail.com>
Show 13 quoted lines
> On Wed, Jun 20, 2018 at 1:55 PM Rafael Ascensão <rafa.almas@gmail.com> wrote:
> > On Wed, Jun 20, 2018 at 5:39 AM Kevin Daudt <me@ikke.info> wrote:
> > > What this is about that when doing `git add path/` (with trailing /),
> >
> > This is what I was referring to. If you search for 'Fake Submodules',
> > you'll see that some people were/are intentionally using this instead of
> > subtrees or submodules. Unfortunately the original article [1] seems to
> > be dead, but searching url in the mailing list archives leads to some
> > additional discussion on the subject [2,3].
>
> Abusing a long standing bug does not make it a feature. I'm not
> opposed to having a new option to keep that behavior, but it should
> not be the default. If you use it that way, you're on your own.
Was such an option ever worked on?

(I.e. a way to git-add some sub-directory 'foo' which contains another repository, and have git-add act as if foo/.git didn't exist -- simply adding the (other) contents of foo to the containing repo's index.)

I haven't spotted anything in the git-add man page for v2.34, nor in the release notes for subsequent git versions.

The old behaviour was a genuinely useful ability which I've used a great in the past, and if there's any convenient way to achieve the same thing nowadays, I've failed to find it. (One can temporarily move the nested .git directory elsewhere, run git-add, and then move the .git directory back again; but that's frustratingly cumbersome by comparison).

If I haven't missed some existing solution, could a new git-add option for restoring this ability be implemented?

-Phil
> > [1]:http://debuggable.com/posts/git-fake-submodules:4b563ee4-f3cc-4061-967e-0e48cbdd56cb
> > [2]:https://public-inbox.org/git/xmqqy47o6q71.fsf@gitster.mtv.corp.google.com/
> > [3]:https://public-inbox.org/git/CAGZ79kZofg3jS+g0weTdco+PGo_p-_Hd-NScZ=q2UfB7tF2GPA@mail.gmail.com/
Previous: Rafael AscensãoNext: Junio C Hamano
Message 17 of 22 in “Adding nested repository with slash adds files instead of gitlink”
  1. Heiko VoigtJun 18, 2018
  2. Duy NguyenJun 18, 2018
  3. Brandon WilliamsJun 18, 2018
  4. Heiko VoigtJun 19, 2018
  5. Duy NguyenJun 19, 2018
  6. Junio C HamanoJun 19, 2018
  7. Duy NguyenJun 19, 2018
  8. Duy NguyenJun 19, 2018
  9. Duy NguyenJun 19, 2018
  10. Kevin DaudtJun 18, 2018
  11. Heiko VoigtJun 19, 2018
  12. Rafael AscensãoJun 19, 2018
  13. Kevin DaudtJun 20, 2018
  14. Rafael AscensãoJun 20, 2018
  15. Duy NguyenJun 20, 2018
  16. Rafael AscensãoJun 20, 2018
  17. Phil SaintyAug 8, 2024
  18. Junio C HamanoAug 8, 2024
  19. Johannes SchindelinAug 13, 2024
  20. Junio C HamanoAug 13, 2024
  21. Phil SaintyAug 13, 2024
  22. Johannes SchindelinAug 14, 2024

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.