Repository navigation
Add a feature where pressing e on a commit's header or message runs git history reword - #1461
Open
christarazi wants to merge 4 commits into
Open
christarazi wants to merge 4 commits into
christarazi wants to merge 4 commits into
Conversation
The log view skips the graph prefix itself before copying the rev from a commit line. Do it in the helper instead. See subsequent commit. Signed-off-by: Chris Tarazi <tarazichris@gmail.com>
Allow tests to skip on git older than 2.54, which added git history. See subsequent commit. Signed-off-by: Chris Tarazi <tarazichris@gmail.com>
Previously, pressing 'e' on a commit's header or message in the diff and log views reports "Nothing to edit". This commit makes it so that when the user presses 'e' on the commit's header or the message in the diff and log views, it runs `git history reword` on the selected commit instead. git history needs git 2.54, so check for it and report the requirement on older versions. Signed-off-by: Chris Tarazi <tarazichris@gmail.com>
git history rewrites the commit and its descendants, but the diff view keeps showing the old commit. Find the rewritten commit by its position from a branch tip and reload the diff view on it. Refresh the other displayed views too. Signed-off-by: Chris Tarazi <tarazichris@gmail.com>
christarazi
marked this pull request as ready for review
October 21, 2026 03:56
Author
|
This is really useful in my workflow so I figured I'd see if upstream would consider it. Open to feedback on it 🙂. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Add a feature where pressing
eon a commit's header or message in the diffand log views runs
git history rewordon the commit equivalent to arewordin an interactive rebase. Previously, if you press
e, the UI would report"Nothing to edit".
git historywas added in git 2.54 and is marked experimental. On olderversions, make tig report that rewording requires git 2.54 or newer.
git historyalso rewrites the commit's descendants, so after a rewordall displayed views are refreshed, and the diff view is reloaded on the
rewritten commit instead of the old one.
The first two commits are preparatory.
Testing, with git 2.55:
make test: 593 assertions in 158 tests passed (3 skipped)make test-address-sanitizer: 594 assertions in 159 tests passed (2 skipped)The new reword tests need git 2.54, so CI will likely skip all but
test/diff/reword-unsupported-test.