Thread (15 messages) 15 messages, 6 authors, 2024-08-08

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

From: Phil Sainty <hidden>
Date: 2024-08-08 11:29:29

On Wed, Jun 20, 2018 at 1:55 PM Rafael Ascensão [off-list ref] wrote:
quoted
On Wed, Jun 20, 2018 at 5:39 AM Kevin Daudt [off-list ref] wrote:
quoted
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

quoted
[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/
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help