Re: git-submodule is missing --dissociate option
Stefan Bellerwrites: >> As far as I am aware this can be worked around with 'git repack -a' >> and manual removal of the objects/info/alternates file afterward. >> Though I don't know if this results in a less speedy clone than >> dissociate would. > > That is an interesting workaround! It's not just "workaround", but actually is an implementation of that exact option, no?
Re: git-submodule is missing --dissociate option
Ævar Arnfjörð Bjarmasonwrites: > On Mon, Apr 30, 2018 at 1:30 PM, Casey Fitzpatrick wrote: >> It also seems to be missing "--progress", and I imagine others. >> Perhaps submodule add/update should be reworked to automatically >> accept all the options that clone would? > > --progress is not missing, but I see that it isn't documented. It was > added in 72c5f88311 ("clone: pass --progress decision to recursive > submodules", 2016-09-22). What you're suggesting makes sense, but as > shown in that commit it's not easy for it to happen automatically, > there's a lot of boilerplate involved. > > But since you're interested you can see how to add new options with > that patch, it should be easy for anyone not experienced with the > codebase, it's all just boilerplate + adding a test. I think it is going in the right direction overall, but a few corner cases may need special attention. "add" may be adding a new module that locally originates, in which case "clone" is not relevant. Similarly, for "update"options for "clone" are not relevant unless it is the very initial one.
Re: git-submodule is missing --dissociate option
Sure, I'll take a crack at it and submit a patch. On Mon, Apr 30, 2018 at 2:19 PM, Stefan Bellerwrote: > On Mon, Apr 30, 2018 at 1:29 AM, Casey Fitzpatrick wrote: >> This seems to be a hole in the git feature set. I believe it is fairly >> easily worked around, but it would be best to provide the option for >> ease of use (and maybe performance?). >> >> git clone has both a --reference feature and a --dissociate option, >> with dissociate allowing for a reference to *only* speed up network >> transfers rather than have the resulting clone rely upon the reference >> always being there (creates an independent repo). > > With the advent of git-worktree, I claim that --reference without further > --dissociate is dangerous, such that the combination of these two are > not the best UX, you could wish for. > >> But git submodule only allows for --reference, so there isn't a an >> option to make a speedy independent submodule clone in one shot: >> https://git-scm.com/docs/git-submodule >> I checked the latest online documentation (currently at 2.16.3) and >> the documentation in the latest sources (almost 2.18): >> https://github.com/git/git/blob/next/Documentation/git-submodule.txt >> >> As far as I am aware this can be worked around with 'git repack -a' >> and manual removal of the objects/info/alternates file afterward. >> Though I don't know if this results in a less speedy clone than >> dissociate would. > > That is an interesting workaround! > I agree we should have the --dissociate option available for submodules. > Care to implement it? > > Thanks, > Stefan
Re: git-submodule is missing --dissociate option
On Mon, Apr 30, 2018 at 1:29 AM, Casey Fitzpatrickwrote: > This seems to be a hole in the git feature set. I believe it is fairly > easily worked around, but it would be best to provide the option for > ease of use (and maybe performance?). > > git clone has both a --reference feature and a --dissociate option, > with dissociate allowing for a reference to *only* speed up network > transfers rather than have the resulting clone rely upon the reference > always being there (creates an independent repo). With the advent of git-worktree, I claim that --reference without further --dissociate is dangerous, such that the combination of these two are not the best UX, you could wish for. > But git submodule only allows for --reference, so there isn't a an > option to make a speedy independent submodule clone in one shot: > https://git-scm.com/docs/git-submodule > I checked the latest online documentation (currently at 2.16.3) and > the documentation in the latest sources (almost 2.18): > https://github.com/git/git/blob/next/Documentation/git-submodule.txt > > As far as I am aware this can be worked around with 'git repack -a' > and manual removal of the objects/info/alternates file afterward. > Though I don't know if this results in a less speedy clone than > dissociate would. That is an interesting workaround! I agree we should have the --dissociate option available for submodules. Care to implement it? Thanks, Stefan
Re: git-submodule is missing --dissociate option
On Mon, Apr 30, 2018 at 1:30 PM, Casey Fitzpatrickwrote: > It also seems to be missing "--progress", and I imagine others. > Perhaps submodule add/update should be reworked to automatically > accept all the options that clone would? --progress is not missing, but I see that it isn't documented. It was added in 72c5f88311 ("clone: pass --progress decision to recursive submodules", 2016-09-22). What you're suggesting makes sense, but as shown in that commit it's not easy for it to happen automatically, there's a lot of boilerplate involved. But since you're interested you can see how to add new options with that patch, it should be easy for anyone not experienced with the codebase, it's all just boilerplate + adding a test. > On Mon, Apr 30, 2018 at 4:29 AM, Casey Fitzpatrick wrote: >> This seems to be a hole in the git feature set. I believe it is fairly >> easily worked around, but it would be best to provide the option for >> ease of use (and maybe performance?). >> >> git clone has both a --reference feature and a --dissociate option, >> with dissociate allowing for a reference to *only* speed up network >> transfers rather than have the resulting clone rely upon the reference >> always being there (creates an independent repo). >> But git submodule only allows for --reference, so there isn't a an >> option to make a speedy independent submodule clone in one shot: >> https://git-scm.com/docs/git-submodule >> I checked the latest online documentation (currently at 2.16.3) and >> the documentation in the latest sources (almost 2.18): >> https://github.com/git/git/blob/next/Documentation/git-submodule.txt >> >> As far as I am aware this can be worked around with 'git repack -a' >> and manual removal of the objects/info/alternates file afterward. >> Though I don't know if this results in a less speedy clone than >> dissociate would.
Re: git-submodule is missing --dissociate option
It also seems to be missing "--progress", and I imagine others. Perhaps submodule add/update should be reworked to automatically accept all the options that clone would? On Mon, Apr 30, 2018 at 4:29 AM, Casey Fitzpatrickwrote: > This seems to be a hole in the git feature set. I believe it is fairly > easily worked around, but it would be best to provide the option for > ease of use (and maybe performance?). > > git clone has both a --reference feature and a --dissociate option, > with dissociate allowing for a reference to *only* speed up network > transfers rather than have the resulting clone rely upon the reference > always being there (creates an independent repo). > But git submodule only allows for --reference, so there isn't a an > option to make a speedy independent submodule clone in one shot: > https://git-scm.com/docs/git-submodule > I checked the latest online documentation (currently at 2.16.3) and > the documentation in the latest sources (almost 2.18): > https://github.com/git/git/blob/next/Documentation/git-submodule.txt > > As far as I am aware this can be worked around with 'git repack -a' > and manual removal of the objects/info/alternates file afterward. > Though I don't know if this results in a less speedy clone than > dissociate would.
git-submodule is missing --dissociate option
This seems to be a hole in the git feature set. I believe it is fairly easily worked around, but it would be best to provide the option for ease of use (and maybe performance?). git clone has both a --reference feature and a --dissociate option, with dissociate allowing for a reference to *only* speed up network transfers rather than have the resulting clone rely upon the reference always being there (creates an independent repo). But git submodule only allows for --reference, so there isn't a an option to make a speedy independent submodule clone in one shot: https://git-scm.com/docs/git-submodule I checked the latest online documentation (currently at 2.16.3) and the documentation in the latest sources (almost 2.18): https://github.com/git/git/blob/next/Documentation/git-submodule.txt As far as I am aware this can be worked around with 'git repack -a' and manual removal of the objects/info/alternates file afterward. Though I don't know if this results in a less speedy clone than dissociate would.