Skip to content

feat(tracked): write the create-time base refs - #19

Merged
lstocchi merged 1 commit into
redhat-developer:mainfrom
lstocchi:create-time
Nov 27, 2026
Merged

lstocchi merged 1 commit into
redhat-developer:mainfrom
lstocchi:create-time

Conversation

@lstocchi

Copy link
Copy Markdown
Collaborator

The driver that turns a scan into a base commit. write_base_refs groups the mappings by repository, refuses a label a foreign ref already uses (rolling back the refs this run created), and calls write_repo_base per repository. write_repo_base builds one fast-import stream:

  • a persistent check-ignore session answers each directory's children in one batch, with the parent tree's tracked-prefix guard and exact-path exemption;
  • carry-forward keeps paths the walk could not see (unreadable or oversized entries, failed filters, nested repositories, remaining host-incompatible names) from becoming deletions;
  • unrepresentable HEAD names are re-emitted with their raw bytes when git accepts them on this host, and reported otherwise;
  • the byte budget is charged by stream_file/hash_object_route; a typed BudgetExceeded aborts before done, while per-path filter failures are carried forward and grouped per driver.

Notes for the ignored, never-in-tree and portability classes collapse to counts.

Unit tests cover the auto-eol hard-link split and five crafted NUL names that must not abort the base.

Assisted-by: Claude Code: GLM 5.3
Assisted-by: Claude Code: Opus 5.5

The driver that turns a scan into a base commit. `write_base_refs` groups
the mappings by repository, refuses a label a foreign ref already uses
(rolling back the refs this run created), and calls `write_repo_base`
per repository. `write_repo_base` builds one fast-import stream:

- a persistent check-ignore session answers each directory's children in
  one batch, with the parent tree's tracked-prefix guard and exact-path
  exemption;
- carry-forward keeps paths the walk could not see (unreadable or
  oversized entries, failed filters, nested repositories, remaining
  host-incompatible names) from becoming deletions;
- unrepresentable HEAD names are re-emitted with their raw bytes when git
  accepts them on this host, and reported otherwise;
- the byte budget is charged by `stream_file`/`hash_object_route`; a
  typed `BudgetExceeded` aborts before `done`, while per-path filter
  failures are carried forward and grouped per driver.

Notes for the ignored, never-in-tree and portability classes collapse to
counts.

Unit tests cover the auto-eol hard-link split and five crafted NUL names
that must not abort the base.

Assisted-by: Claude Code: GLM 5.3
Assisted-by: Claude Code: Opus 5.5
Signed-off-by: Luca Stocchi <lstocchi@redhat.com>
@lstocchi
lstocchi merged commit 2ad2df1 into redhat-developer:main Nov 27, 2026
4 checks passed
@lstocchi
lstocchi deleted the create-time branch November 27, 2026 11:27
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