fix(dist-git): use first-parent for snapshot-time commit resolution#192
Open
Tonisal-byte wants to merge 2 commits into
Open
fix(dist-git): use first-parent for snapshot-time commit resolution#192Tonisal-byte wants to merge 2 commits into
Tonisal-byte wants to merge 2 commits into
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
This PR adjusts dist-git snapshot commit resolution so timestamp-based upstream commit selection stays on the target branch’s first-parent history, avoiding side-branch commits that synthetic history generation cannot reach.
Changes:
- Adds
--first-parenttogit rev-listinGetCommitHashBeforeDate. - Expands the inline comment to explain why first-parent traversal is required for snapshot-time resolution.
dmcilvaney
approved these changes
May 14, 2026
3d453db to
5b8f6eb
Compare
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.
Problem
GetCommitHashBeforeDate walks all parents when resolving the upstream commit
via snapshot time. This can resolve to a commit from a merged-in side branch
(e.g. an f44 commit merged into f43), causing "import-commit not found"
errors during synthetic history generation because the first-parent walk
can't reach the import-commit from a side-branch commit.
Fix
Add --first-parent to the git rev-list command so the resolved commit is
always on the target branch's mainline. The merge commit that incorporated
the side branch is the correct anchor — it has the same tree content and
sits on the first-parent chain where the synthetic history walk expects it.