Skip to content

feat: show who last changed each line of a file, from its right-click menu, also as the file is in the working tree - #46

Merged
Lars- merged 1 commit into
mainfrom
feat/blame
Nov 15, 2026
Merged

Lars- merged 1 commit into
mainfrom
feat/blame

Conversation

@Lars-

@Lars- Lars- commented Nov 15, 2026

Copy link
Copy Markdown
Owner

What this changes

Right-click a file, in a commit or in your changes, and pick Blame: the centre shows the file with, beside each run of lines, the commit that last changed them (SHA, summary, author, date). Clicking a line shows its commit in the details panel and highlights every other line that commit changed. From your changes it is the file as it is now: lines you have not committed yet say so, and the blame follows your edits and new commits. From a commit it is the file in that commit. Renames are followed, as git blame does. A file a commit deleted only offers its history.

git blame --porcelain is read on a background thread (in git.git, sequencer.c with 7,094 lines takes under a second), so the window never waits. The thread-and-channel code of the file history is now shared with it, and showing something in the centre closes the rest in one place.

How it is tested

  • Core: blame_tells_which_commit_last_changed_each_line runs git blame through a rename, in the working tree (a new line has the null id), in an older commit, and for a file that commit does not have; parses_blame and rejects_what_it_does_not_know cover the parser.

  • App: blame_tells_which_commit_last_changed_each_line opens the blame from the changes and from a commit, clicks a line, sees a line written outside appear and then get its commit, closes with Escape, and finds no Blame for a deleted file. It fails without the reload of the working tree and without the check for deleted files.

  • Tried in the app on a small repository with a rename and on git.git.

  • cargo fmt --all, cargo clippy --workspace --all-targets -- -D warnings and cargo test --workspace pass

  • It adds as little code as the change needs, and removes what it makes unnecessary

  • Nothing in it comes from GitKraken or another closed-source client (see CONTRIBUTING.md)

… menu, also as the file is in the working tree
@Lars-
Lars- merged commit 2d9f273 into main Nov 15, 2026
7 checks passed
@Lars- Lars- mentioned this pull request Nov 15, 2026
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