straight.el icon indicating copy to clipboard operation
straight.el copied to clipboard

Repository management commands don't work with submodules

Open xendk opened this issue 7 years ago • 5 comments
trafficstars

Whenever I pull straight, I get this:

selection_222

Not hard to fix manually, but a bit annoying. Does look like straight doesn't play too well with submodules?

xendk avatar Feb 20 '18 15:02 xendk

Yes, looking at the merge handling it doesn't look like there's any code to account for submodules. It would be a very welcome addition.

raxod502 avatar Feb 20 '18 17:02 raxod502

I've never really used git submodules, so I'm not entirely sure what the best approach would be.

Would running git submodule update after merge if .gitmodules is present in the repository be an acceptable handling?

xendk avatar Feb 23 '18 20:02 xendk

Sorry, I don't have extensive experience with submodules either. However I think we would want to use flags

git submodule update --init --recursive

and you don't have to check if .gitmodules exists (the command is a no-op if it doesn't).

I think submodules have to be updated every time we perform a checkout or reset of any sort, honestly. It may therefore make sense to abstract the code into a function that can be called all over the place.

raxod502 avatar Feb 24 '18 00:02 raxod502

´´´ git submodule update --init --recursive ´´´

:+1:

and you don't have to check if .gitmodules exists (the command is a no-op if it doesn't).

Well, I think checking for a file to save a process invocation is worth it.

I think submodules have to be updated every time we perform a checkout or reset of any sort, honestly. It may therefore make sense to abstract the code into a function that can be called all over the place.

Agreed.

xendk avatar Feb 24 '18 14:02 xendk

Well, I think checking for a file to save a process invocation is worth it.

If you want to, I have no objections, but this is not performance-critical code since it's part of repository management. (On the contrary, anything that's run during startup would be very much subject to this sort of optimization.)

raxod502 avatar Feb 25 '18 06:02 raxod502