Sublime Forum

What does it mean `Update all Initialized submodules`

#1

Consider something like this:

In that repo I’ve already initialized all submodules (git submodule update --init --recursive) and updated few of them manually, as you can see all these outdated one will contain a lot of staged files… so i’d like to update (git submodule update -- mysubmodule) all of them at once… I see there is this context menu action called update all initialized submodules (git submodule foreach git submodule update) so I assume that would do the trick but it won’t.

So… could you please explain what is this Update all initialized submodules action doing?

Also, I’d like to know something… let’s say for instance i open this submodule showcase … as you can see there is many staged files so If I click there sublime_merge will become unresponsive and it’ll just freeze so I’ll need to kill the SM process… problem is when I open again the focus will still be there so it’ll become frozen & unresponsive again, is there any way to overcome this easily?

Anyway, to be honest I feel pretty confused about the submodule actions overall… hopefully someone could provide some links/explanation about it :slight_smile:

Thanks in advance.

0 Likes

#2

In addition to my previous question I’m trying to learn more about the basics reading http://manpages.ubuntu.com/manpages/trusty/man1/git-submodule.1.html

One additional question… if you try to initialize all submodules it may happen the process becoming stuck because expecting user intervention… ie: it may happen the command getting stuck because it’s asking Store key in cache? (y/n) … so i assume it’ll wait forever, right?

0 Likes

#3

If you click on the little “console tick” next to the branch name in the top middle of the application you can check exactly which command was run and it’s output. The “Update all Initialized Submodules” runs git submodule foreach git submodule update.

As for command line interaction, we spawn git without a tty and special flags to prevent those kinds of interactions (or provide gui equivalents of them).

1 Like

#4

@bschaaf Thanks for the answer, yeah, that’s really handy … About preventing those kinds of interactions, dunno if I’ve explained on my previous threads but it may happen that SM will hang when a git command such as git clone --recurse-submodules hangs… I’ve experienced that today (because it was hanging when asking about storing the key cache)… so basically SM would also hang. Which lead me to wonder if it was possible to kill the current in merge but I didn’t see any “cancel” command. On the other hand, i guess if you close the tab you kill the spawned git process, right?

In any case, coming back to the main topic, i knew the command spawned was git submodule foreach git submodule update … so what is this doing? Did you see the screenshots above? I’d expect this one to update all submodules… but it won’t… so I’m confused.

Thanks.

0 Likes

#5

What output do you get for update all? git submodule foreach git submodule update essentially runs git submodule update for each submodule.

0 Likes

#6

Please take a look to this video, as you can see the submodules haven’t been updated at all… i don’t understand what git submodule foreach git submodule update have been doing there be honest… While if I update one single submodule individually (look at this one)… it’ll work, it gets updated succesfully. So, could you please clarify? Thanks.

0 Likes

#7

I am also confused by this command. In my understanding “Update all initialized submodules” should run

git submodule update

instead of

git submodule foreach git submodule update

Since the first command will result in the same state as right clicking each submodule and do a “Update submodule” (aka checkout the submodules revision commit in the parent repo where we are currently).

Do I missunderstand the git command? Or is it a flaw in SM?

0 Likes

#8

These commands are different. See https://stackoverflow.com/questions/1030169/easy-way-to-pull-latest-of-all-git-submodules

Although I think SM might be able to update to the —recursive flag

0 Likes

#9

Here’s the git submodule subcommands official doc references:

Something I can see in the foreach subcommand is they use quoting

ie: git submodule foreach 'echo $sm_pathgit rev-parse HEAD'

I’m not a git expert by any means… but is the command used by SM using the correct syntax?

0 Likes

#10

We’ve got a fix for this in the works. In the meantime in Submodule Selection.sublime-menu all the "foreach": true can be changed to "recursive": true for the desired behaviour.

3 Likes

#11

Ok… so this was unintended behaviour afterall… Thanks to confirm it, when I test the new version I’ll accept & close this thread. Tyvm!

0 Likes

#12

Should be fixed in build 2005

0 Likes

#13

Great, with 2005 it works as expected, thank you very much!

0 Likes

#14

@bschaaf Awesome, i’ve already tried and this is what I’ve got

  • I can see the spawned git command now has changed as you pointed out before… even so, what do you think about this error ?

Please let me know if that’s intended so i can validate&close this one

Btw, let abuse a little bit this thread so i don’t need open indivial little issues… consider it some sort of feedback/questions:

  • You can see in the above video the below menu items are not doing anything:

is there anything i need to configure to make them work?

  • When loading a huge repo such as qt’s, chromium, etc… i can see you’ll write the “Loading repo_name…” message on the console, that’s great and all… but at the same time is quite confusing as you don’t really know when the spawned “loading_repo” thread has finished or not… some sort of spinner/icon would be great… i mean, i can see there is “refresh”… which it’s helpful, even so :confused:
  • When specifying the git binary (system/bundle) there is something fishy going on as it’s not working properly on windows, when using full path it works ok though.
  • These tabs…

, is there any way to make them invisible? They’re useless when the commit has dozens if not hundreds of files

Anyway, I’ll stop here, as this thread was opened just to tackle the submodule issue… Overall I think Sublime Merge is a hell of amazing tool and I love it :slight_smile:

0 Likes

#15

@bschaaf Please ignore my “issue” about the edit menu entries not doing anything… it was just me being clumsy as I didn’t realize you need to set the editor path in the preferences, credits to @OdatNurd for helping out! :slight_smile:

0 Likes

#16

What are you looking for in a finished loading indicator? The only things that load asynchronously when opening a repo are the commit history and working tree diffs. We have a loading indicator for the working tree in the top entry of the commit history, while I wouldn’t expect the commit history loading to affect most application usage.

Could you post more details about the fishy git binary on windows? Preferably in another thread so we’re not overloading this one.

I don’t think the file tabs can be disabled, no.

0 Likes

#17

Ok, I’ve closed the repo and reopened again and now the “Loading changes” indicator in the top entry of the commit history works ok… and after this is done the submodules will updated properly. Reason why I’d commented upon this is because for some reason before nothing would happen for quite a while ~40s/50s… no indicator, nothing… so i was wondering what it was going on behind the curtains and the only clue i had was the log text. Plus… after the commit history was loaded and also the tags… the submodules wouldn’t show up neither… Really strange, anyway, closing that repo and reopening again it seems “fixed” this “slow” behaviour.

Sure thing, I’ll find the time today to give a proper reproduction about it in a different thread

Alright… but do you understand why I’ve brought this to the table? Think about it… if a certain commit is canonical/small (good practice, i know) displaying all the file tabs makes sense. Otherwise when commit is big displaying those tabs is pretty much useless/waste of area… I mean, i’d understand if you’d provide a menu entry to “reveal”… or maybe “open file in a new tab”… but… how am i suposse to find the tab of file? Said otherwise, I don’t see the point of that feature… looks beautiful aesthetically speaking but i don’t understand which type of value is adding… if you ask me i’d say none.

Anyway, I won’t go more offtopic in this thread… if you could pls clarify about my previous question about the previous “failing” issue when updating all submodules I’ll just validate answer and move on.

Thank you very much sir :slight_smile:

0 Likes

#18

If the submodule updating is also failing on the command line (which it should be, that’s how we’re updating the submodules), then that’s an issue with your repo.

0 Likes

#19

Mmm… I understand, makes sense so I guess I’ll validate that as answer… although to be honest, I find quite difficult to believe this repo https://code.qt.io/cgit/qt/qt5.git/ which is the one I’ve been trying to run is broken… Thanks anyway.

Ps. This is strange… I wanted to validate your answer but I don’t see any button to do so…has this feature got removed from the forums? :confused:

0 Likes

#20

I’m not aware of any changes to the forums.

1 Like