Skip to content

Fix submodule always building from HEAD instead of recorded commit#415

Merged
chrisbra merged 2 commits intovim:masterfrom
mattn:fix/submodule-update-remote
Mar 22, 2026
Merged

Fix submodule always building from HEAD instead of recorded commit#415
chrisbra merged 2 commits intovim:masterfrom
mattn:fix/submodule-update-remote

Conversation

@mattn
Copy link
Copy Markdown
Member

@mattn mattn commented Mar 21, 2026

I noticed that builds produced by CI did not match the tagged version. The root cause turned out to be that after git submodule update --init --depth 20 correctly checks out the commit pinned by the superproject, the subsequent git submodule update --remote immediately overwrites it with whatever is at the tip of the remote tracking branch. This means every build was effectively building from vim HEAD rather than the version the tag intended to release.

This commit removes the git submodule update --remote line so that the submodule stays at the exact commit the superproject records.

Remove `git submodule update --remote` which overwrites the submodule
checkout with the latest remote HEAD, ignoring the commit recorded in
the superproject.

I noticed that builds produced by CI did not match the tagged version.
The root cause turned out to be that after `git submodule update --init
--depth 20` correctly checks out the commit pinned by the superproject,
the subsequent `git submodule update --remote` immediately overwrites it
with whatever is at the tip of the remote tracking branch. This means
every build was effectively building from vim HEAD rather than the
version the tag intended to release.
@mattn
Copy link
Copy Markdown
Member Author

mattn commented Mar 21, 2026

How I found this: vim --version reports the version from version.h in the source tree, but the Windows executable version info (file properties) is set from the tag name via MAJOR/MINOR/PATCHLEVEL in appveyor.bat. When git submodule update --remote pulls in a newer commit than the tag intended, these two versions diverge — that discrepancy is what led me to investigate.

@chrisbra
Copy link
Copy Markdown
Member

Thanks. I have noticed this a few times, but was not sure what caused this.

@chrisbra chrisbra merged commit 5568320 into vim:master Mar 22, 2026
1 check passed
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

Successfully merging this pull request may close these issues.

2 participants