Skip to content

Use git history reword instead of git rebase -i for rewording non HEAD commits #5539

Description

@jaseemabid

Is your feature request related to a problem? Please describe.

I noticed that lazygit is using git rebase -i ... for rewording older commits; but git very recently shipped a core feature to make this slightly simpler.

See https://github.blog/open-source/git/highlights-from-git-2-54

git history reword opens your editor with the specified commit’s message and rewrites it in place, updating any branches that descend from that commit. Unlike git rebase, it doesn’t touch your working tree or index, and it can even operate in a bare repository.

Describe the solution you'd like

When you press r on an old commit, call git history reword HASH instead of what we do now if the installed git version is new enough.

Describe alternatives you've considered

N/A

Additional context

I'm a BIG fan of lazygit and use it way too much daily. I'm not a contributor to this project yet, but I can give it a try to implement this feature if @jesseduffield thinks it's worthwhile.

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions