emerge-gitclone: Rework to simply clone scripts + submodules into ~core - #25
Merged
Merged
Conversation
There was a problem hiding this comment.
🔵 Needs a closer look
Shallow cloning does not reliably resolve abbreviated dev-build revisions.
Pull request overview
Reworks emerge-gitclone to shallow-clone scripts and submodules into /home/core/scripts, with optional revision overrides.
Changes:
- Replaces separate repository handling with one scripts clone.
- Adds recursive shallow submodule initialization.
- Adds
--revisionsupport.
File summaries
| File | Summary |
|---|---|
emerge-gitclone |
Implements the new clone location, submodule handling, cleanup, and revision override. |
Review finding: abbreviated dev-build revisions may fail with shallow git clone --revision; full commit IDs or a fallback checkout path are needed.
Review details
Suppressed comments (1)
emerge-gitclone:51
- The dev-build path still reduces
releaseto the abbreviated-g<checksum>value (the example in the comment is only 8 hex digits), but this now passes that abbreviation directly togit clone --revision. Unlike the old full clone followed by local checkout, a revision-only clone has no local object database from which to resolve an arbitrary short SHA, so non-tagged dev builds can fail with an unknown revision/unadvertised object. Resolve and pass a full commit ID (or retain a fetch/checkout path for abbreviated dev-build revisions) before using this shallow clone mode.
"--revision", ref,
- Files reviewed: 1/1 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
The portage-stable and coreos-overlay repositories got absorbed into scripts a long time ago. Now portage-stable is being replaced by a gentoo repo submodule. This script now simply does a shallow single branch clone of scripts and any submodules. This will succeed, even if there are no submodules. Storing scripts under /var/lib/portage was weird, so it is now cloned under ~core instead, with the Portage configuration pointing at the repositories within this location. It is now expected that this script is called as the core user rather than root. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
This is useful for testing. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
git clone --revision requires a full SHA, so if a Flatcar dev build has a -g suffix, we need to resolve the SHA using the GitHub API first. Signed-off-by: James Le Cuirot <jlecuirot@microsoft.com>
chewi
force-pushed
the
chewi/gentoo-repo
branch
from
September 17, 2026 14:26
5a689f2 to
4ac45aa
Compare
t-lo
approved these changes
Sep 18, 2026
t-lo
left a comment
Member
There was a problem hiding this comment.
LGTM, thank you for the fast turnaround!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
The portage-stable and coreos-overlay repositories got absorbed into scripts a long time ago. Now portage-stable is being replaced by a gentoo repo submodule. This script now simply does a shallow single branch clone of scripts and any submodules. This will succeed, even if there are no submodules.
Storing scripts under /var/lib/portage was weird, so it is now cloned under ~core instead, with the Portage configuration pointing at the repositories within this location. It is now expected that this script is called as the core user rather than root.
This also adds an option to override the git revision, which is useful for testing.