coily git pull --rebase drops local commits on force-pushed upstream #4

Open
opened 2026-05-23 20:53:56 +00:00 by coilysiren · 0 comments
Owner

Originally filed by @coilysiren on 2026-05-22T20:43:39Z - https://github.com/coilysiren/coily/issues/326

coily git pull --rebase silently dropped a local commit twice in one session, in two different repos (agentic-os, agentic-os-kai).

Both times the upstream main had been force-pushed (release-please rewriting history). Git's default --fork-point heuristic for rebase, when the upstream ref's reflog shows a rewrite, can decide a local commit is "already upstream" and drop it. The local commit became dangling - no error, no conflict, just gone from HEAD and the working tree. Recovered by hand via reflog each time.

Proposed fix: coily git pull should pass --no-fork-point when --rebase is in play, or detect a force-updated upstream and refuse to rebase without an explicit flag. Silent commit loss is the worst possible failure mode for a git wrapper.

_Originally filed by @coilysiren on 2026-05-22T20:43:39Z - [https://github.com/coilysiren/coily/issues/326](https://github.com/coilysiren/coily/issues/326)_ `coily git pull --rebase` silently dropped a local commit twice in one session, in two different repos (agentic-os, agentic-os-kai). Both times the upstream `main` had been force-pushed (release-please rewriting history). Git's default `--fork-point` heuristic for rebase, when the upstream ref's reflog shows a rewrite, can decide a local commit is "already upstream" and drop it. The local commit became dangling - no error, no conflict, just gone from `HEAD` and the working tree. Recovered by hand via reflog each time. Proposed fix: `coily git pull` should pass `--no-fork-point` when `--rebase` is in play, or detect a force-updated upstream and refuse to rebase without an explicit flag. Silent commit loss is the worst possible failure mode for a git wrapper.
Sign in to join this conversation.
No labels
P0
P1
P2
P3
P4
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
coilyco-bridge/coily#4
No description provided.