Artifact 5525162132deafa203e331f4600abe2be35b1b2a0b7a4abd09e31a2616940783:
- File
src/git_import.zig
— part of check-in
[4d7a22b93c]
at
2026-08-02 19:52:18
on branch sub-manifest
— import-git: decide branch membership from the commit graph
fast-export emits each commit once, under whichever ref reached it first, so that header was provenance and not branch. A single-branch repository imported with ZERO branches; multi-head repositories were scrambled in proportion to merge activity, which at sqlite scale read as 7,421 leaves on master under repo-state §7.2's same-branch leaf test. Issue #26.
labelBranches claims the primary's first-parent chain, then each head shallowest tip first, then inherits; emitBranchControls writes one control per segment root. Two things the plan did not anticipate: objects are folded to check-ins by hash first, because two git commits can translate to one byte-identical check-in and §5.2 allows one branch tag per rid; and controls are emitted deepest-first, because §5.3's timestamp skip would otherwise let an ancestor's propagation win over a root whose commit shares its second.
source_ref is deleted rather than demoted -- after the change it had no readers. makeBranchControl now composes the §6.2 pair through artifact.composeCommitTags instead of a lone *branch card.
Content was never affected: artifacts, parent links and tip content were always correct. Only derived branch state was wrong, which is why a full benchmark ran clean through it. Repairing an existing imported store means re-importing; check-in hashes survive, since branch state lives in separate controls.
Two pre-existing expectations were rewritten, deliberately: both demanded two active branch tags on one rid, which §5.2 forbids, and were unsatisfiable rather than merely stale.
Verified: fmt, test 3281/3281, gate, e2e 716/716, git-import-e2e 11/11, dst 6x1000. Shapes A/B/C match git branch exactly, 11/11 tip parity. (user: dmestas, size: 1541) [annotate] [blame] [check-ins using]
const implementation = @import("git_import_impl.zig"); pub const TreeStore = implementation.TreeStore; pub const TreeFormat = implementation.TreeFormat; pub const RootView = implementation.RootView; pub const TreeCommand = implementation.TreeCommand; pub const BuildResult = implementation.BuildResult; pub const TreeError = implementation.TreeError; pub const LoadedBytes = implementation.LoadedBytes; pub const TreeStoreError = implementation.TreeStoreError; pub const Attribution = implementation.Attribution; pub const UserOptions = implementation.UserOptions; pub const SubmanifestChoice = implementation.SubmanifestChoice; pub const WorkCounters = implementation.WorkCounters; pub const ResolvedOptions = implementation.ResolvedOptions; pub const resolveOptions = implementation.resolveOptions; pub const analyzeSubmanifestK = implementation.analyzeSubmanifestK; pub const modeFromGit = implementation.modeFromGit; pub const CommitMarkState = implementation.CommitMarkState; pub const FinalizeOptions = implementation.FinalizeOptions; pub const FinalizedRef = implementation.FinalizedRef; pub const FinalizedRefs = implementation.FinalizedRefs; pub const RefCollision = implementation.RefCollision; pub const BranchHead = implementation.BranchHead; pub const BranchLabel = implementation.BranchLabel; pub const labelBranches = implementation.labelBranches; /// Production imports always use the incremental tree writer. pub const Importer = implementation.Importer(implementation.IncrementalTreePolicy, implementation.NoopObserver);