Skip to content

Rewrite commit messages with libgit2 and fix review findings - #2

Merged
atabits merged 5 commits into
mainfrom
fix/review-findings
Oct 11, 2026
Merged

atabits merged 5 commits into
mainfrom
fix/review-findings

Conversation

@atabits

@atabits atabits commented Oct 11, 2026

Copy link
Copy Markdown
Owner

Replaces git filter-branch with a libgit2-based rewrite and fixes the issues found in the code review.

Data safety

  • The editor now works with the full commit message: body and trailers (Signed-off-by:, Co-authored-by:) are no longer lost.
  • Moved refs are backed up under refs/commit-rewriter/backup/. Confirm deletes the backups, Cancel restores the refs and reports every failure. A new rewrite is refused while one is unconfirmed, and an unconfirmed rewrite is offered for confirm/rollback when the repository is opened.
  • Fixed crash on Apply after the commit list was reloaded.

Rewrite engine

  • Only descendants of the target commit are recreated; trees, authors and committers (with timestamps) are preserved. Progress is real.
  • Messages are passed verbatim (no shell quoting or echo escapes).
  • Annotated and lightweight tags and detached HEAD are updated; remote-tracking refs are never touched.
  • Default scope is the current branch only.
  • No dependency on the git CLI or sh anymore.

Other fixes

  • "Load more" visibility is exact; refresh keeps loaded pages.
  • Search highlighting no longer panics on non-ASCII text; Clear logs works.
  • Background messages use log levels, so the Important/Errors filters work.
  • Removed dead code (operations::rewrite_commit, GitRepository trait, unused message variants).

Tests, CI, build

  • Integration tests on temporary repositories (14 cases: body preservation, scopes, tags, merges, root, detached HEAD, rollback, confirm, pending rewrite, pagination).
  • Clippy with -D warnings in CI, builds use --locked, Cargo.lock is committed.
  • eframe 0.28 → 0.36, git2 0.19 → 0.21, rfd 0.14 → 0.17 (no GTK needed on Linux), rust-version = 1.95.
  • README: correct links, requirements and description of backups.

- edit the full commit message, body and trailers are no longer dropped
- rewrite only descendants of the target commit, preserving trees,
  authors and committers, with real progress
- back up moved refs under refs/commit-rewriter/backup/: confirm deletes
  the backups, rollback restores refs and reports failures
- refuse a new rewrite while a previous one is unconfirmed, and offer to
  confirm or roll it back when the repository is opened
- update annotated and lightweight tags and detached HEAD, never touch
  remote-tracking refs
- default to rewriting the current branch only
- fix crash on Apply after the commit list was reloaded
- fix "Load more" visibility and keep loaded pages on refresh
- fix search highlighting panic on non-ASCII text and the Clear logs button
- use log levels for background task messages, drop dead code
- add integration tests on temporary repositories
- upgrade eframe to 0.36, git2 to 0.21, rfd to 0.17 (no GTK on Linux)
- set rust-version and commit Cargo.lock
- header with repository, branch and rewrite scope, commits list in the
  middle, message editor and activity log at the bottom
- single-line commit rows with hash, summary, author and date, search
  matches highlighted and long text truncated
- preview as a modal dialog with before/after messages and updated refs
- shared theme with accent color for light and dark system themes
- keyboard focus ring on commit rows, editor height capped
- Reset button and Apply enabled only for a changed message
- open the folder dialog asynchronously so the window keeps responding
- show the home directory as ~ in paths
@atabits
atabits merged commit ba95d3c into main Oct 11, 2026
4 checks passed
@atabits
atabits deleted the fix/review-findings branch October 11, 2026 11:31
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