Skip to content

fix(api): preserve full parent list in GitLogEntry - #48

Open
XChen446 wants to merge 1 commit into
spoiledcat:mainfrom
VRChatCN-Kipfel:fix/gitlog-parents
Open

XChen446 wants to merge 1 commit into
spoiledcat:mainfrom
VRChatCN-Kipfel:fix/gitlog-parents

Conversation

@XChen446

Copy link
Copy Markdown

Problem

\LogEntryOutputProcessor\ only keeps the first two parents (\mergeA/\mergeB): the parent edge is lost entirely for every single-parent commit (the fields are only assigned when there are 2+ parents), and octopus merges beyond the second parent are dropped. This breaks commit-graph reconstruction from \GitLogEntry\ (missing first-parent edges, missing octopus branches).

Verified on a full 5394-commit log dump: 3535 single-parent commits all produced empty parent fields.

Changes

  • \GitLogEntry: add a \parents\ list carrying the full parent chain in git order; constructor backfills from \mergeA/\mergeB\ when \parents\ is null, so existing call sites keep working unchanged. New read-only \Parents\ property.
  • \LogEntryOutputProcessor: collect all parent hashes during parsing instead of capping at two. \mergeA/\mergeB\ semantics are unchanged (first two parents for merges), so UI code checking \MergeA\ for merge detection is unaffected.
  • Tests: single-parent commit (parents length 1, mergeA/B empty) and 3-parent octopus merge (all 3 parents preserved, mergeA/B = first two).

Impact

No breaking changes: binary-compatible field addition, optional constructor parameter, existing assertions (\AssertEqual) untouched.

LogEntryOutputProcessor only kept the first two parents (mergeA/mergeB)
and dropped the parent edge for every single-parent commit, which breaks
commit graph reconstruction (lost first-parent edges and octopus merge
branches beyond the second parent).

- GitLogEntry: add parents list carrying the full parent chain in git
  order; constructor backfills from mergeA/mergeB when parents is null
  for backwards compatibility; expose read-only Parents property.
- LogEntryOutputProcessor: collect all parent hashes during parsing.
- Tests: single-parent and 3-parent octopus merge parsing.
@XChen446
XChen446 marked this pull request as ready for review August 24, 2026 09:36
XChen446 added a commit to VRChatCN-Kipfel/git-for-unity that referenced this pull request Aug 30, 2026
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.

1 participant