8000 fix(gitstore): push through system git, not go-git's slow PushContext by kvaps · Pull Request #258 · aenix-io/aeman · GitHub
[go: up one dir, main page]

Skip to content

fix(gitstore): push through system git, not go-git's slow PushContext - #258

Merged
kvaps merged 1 commit into
mainfrom
fix/push-via-system-git
Sep 28, 2026
Merged

kvaps merged 1 commit into
mainfrom
fix/push-via-system-git

Conversation

@kvaps
@kvaps kvaps commented Sep 28, 2026
Copy link
Copy Markdown
Member

go-git's PushContext negotiates by walking the whole object graph. On a real board the clone stays shallow but still accumulates well over a hundred thousand objects, and the push never finishes inside the sync's deadline (in practice, not at all), so commits sit in the clone and the board shows them saved-but-not-pushed for many minutes. The system git pushes the same delta in about two seconds.

The sync now pushes an on-disk store over an HTTP(S) remote through the system git binary: fast-forward only, so a diverged remote is rejected rather than overwritten, with the token handed to git through an env-fed credential helper so it never appears in the process arguments. The tracking ref is marked on success so the board reads the commits as pushed at once. An in-memory store or a custom test transport keeps the go-git push. Rejection versus unreachable is still decided by the follow-up fetch.

The runtime image already carries git (added for the repack in v0.41.2), so there is no image change.

Adds behavior-matrix row G80 and a gitstore test that pushes through the system git to a bare local remote and confirms the tracking ref is marked.

go-git's push walks the whole object graph to negotiate, and on a real
board (a shallow clone that has still accumulated ~150k objects) it never
finishes inside the sync's deadline, so commits sit local and the board
shows them unpushed for many minutes. The system git pushes the same in
about two seconds. The sync now pushes an on-disk store over an HTTP(S)
remote through git (fast-forward, token via an env-fed credential helper
so it is never in argv) and marks the tracking ref; an in-memory store or
a custom test transport keeps the go-git push. Reject and unreachable are
still classified by the follow-up fetch.

Signed-off-by: Andrei Kvapil <kvapss@gmail.com>
@kvaps
kvaps marked this pull request as ready for review September 28, 2026 08:06
@kvaps
kvaps merged commit d95da64 into main Sep 28, 2026
1 of 2 checks passed
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

0