Fix: Update git submodules during package upgrades #1252
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Fix: Update git submodules during package upgrades
Fixes #238
Problem
Straight.el runs
git submodule update --init --recursive
during initial clone but doesn't update submodules during package upgrades. When upstream repositories update submodule pointers, local submodules remain at old commits, causing repositories to appear dirty.This addresses issue #238. Related issues include #502 and external reports like kaushalmodi/ox-hugo#346 where users encounter persistent submodule conflicts during upgrades.
Example
The
gptel
package uses a test submodule. After upstream updates the submodule pointer, doom upgrade prompts:Solution
Add
git submodule update --init --recursive
after merges instraight-vc-git--merge-from-remote-raw
when.gitmodules
exists.Implementation
Testing
Tested with both existing and new submodules:
Existing submodule scenario:
New submodule scenario:
Fix successfully prevents submodule pointer mismatches for both scenarios.
No impact on repositories without submodules.