Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

project manager: update button does not update git submodules #222

Open
andr-ew opened this issue May 21, 2023 · 1 comment
Open

project manager: update button does not update git submodules #222

andr-ew opened this issue May 21, 2023 · 1 comment

Comments

@andr-ew
Copy link

andr-ew commented May 21, 2023

here's a little test repo, I did the initial install via the REPL, and files in the base repo & the sub-module are both pulled correctly & print a version message:

submodule version: 1
base repo version: 1

after install, I pushed commits to both repos to have them print twos, then hit the update button for the script in the project manager, confirming that only the base repo pulled the new commits, submodule remained unchanged:

submodule version: 1
base repo version: 2

deleting & reinstalling the project got em both up to date:

submodule version: 2
base repo version: 2

previously, I was just distributing each version of my submodule'd scripts in .zip files as a workaround, but that caused some weirdness with the new norns.community, so @tehn proposed fixing the root cause here

tysm for taking a look ! hopefully there's not something obvious I'm missing. since submodules are more of an opt-in feature of git I didn't necessarily expect submodule pulls to be a feature but it certainly would be helpful!

@catfact
Copy link
Collaborator

catfact commented May 23, 2023

submodules are not uncommon, but on the other hand: deleting and reinstalling is not such an onerous workaround, is it? we are just talking about a few KB of lua files here.

anyways, what we would really like is to issue the go-git equivalent of git submodule update --init --recursive. right?

as a breadcrumb: go-git did add support for submodule management, quite a bit after the basic feature set (and i think after the initial release of norns fwiw.)
https://github.com/go-git/go-git/blob/master/submodule.go#L220

i do not personally understand the go-git model (or go for that matter) well enough to know how to get a list of therse Submodule objects out of the git worktree object. it seems doable: not as convenient as adding options to the w.Pull() invocation here, but likely not all that difficult to add either...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants