Skip to content

feat: support force fetch - #14

Merged
Jamie-Cui merged 1 commit into
mainfrom
agent/support-force-fetch
Aug 19, 2026
Merged

feat: support force fetch#14
Jamie-Cui merged 1 commit into
mainfrom
agent/support-force-fetch

Conversation

@Jamie-Cui

Copy link
Copy Markdown
Owner

Summary

  • add git-overleaf-overwrite-local as the destructive counterpart to remote overwrite
  • preserve the previous committed HEAD with a safety ref, then replace the current branch, index, and worktree from the downloaded Overleaf snapshot
  • route Magit fetch -f / --force through the new command while keeping ordinary fetch non-destructive
  • clear pending pull metadata only after a successful local overwrite
  • document the workflow in English and Chinese and add command, Git-state, async, and Magit regression coverage

Why

Ordinary git-overleaf-fetch intentionally updates only the hidden remote snapshot ref. Users also need an explicit remote-wins recovery path corresponding to force-push, especially when abandoning local divergence or a pending conflicted pull.

User impact

The new interactive command always asks for confirmation. It discards staged, unstaged, and non-ignored untracked changes, preserves ignored files, rejects detached HEAD, and keeps the previous committed HEAD reachable under refs/git-overleaf/backups/ when local backups are enabled.

Validation

  • make test — 105/105 ERT tests passed
  • make — byte compilation passed
  • batch load smoke test for git-overleaf and git-overleaf-magit passed
  • live Emacs byte compilation of the changed package files passed without project warnings
  • git diff --check passed

@Jamie-Cui
Jamie-Cui marked this pull request as ready for review August 19, 2026 04:44
@Jamie-Cui
Jamie-Cui merged commit 04576f1 into main Aug 19, 2026
6 of 7 checks passed
@Jamie-Cui
Jamie-Cui deleted the agent/support-force-fetch branch August 19, 2026 04:44
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