Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support fixup workflow #2019

Open
Mirko-von-Leipzig opened this issue Jan 22, 2024 · 4 comments
Open

Support fixup workflow #2019

Mirko-von-Leipzig opened this issue Jan 22, 2024 · 4 comments

Comments

@Mirko-von-Leipzig
Copy link

Mirko-von-Leipzig commented Jan 22, 2024

Is your feature request related to a problem? Please describe.
I'd love a shortcut for git commit --fixup <SHA> from within gitui. Here is an article describing a common use case for it, but I'll give a short summary.

What this does is create a new commit with fixup! <target <SHA> commit message>. You can then run git rebase -i --autosquash to squash the fixup commits into the target commits. This allows you to defer fixes/ammends to previous commits without messing with git history.

A nice use case is when a PR is under review. It let's you mark changes to existing commits without the reviewers losing track of what's been reviewed (as you would if you did git commit --amend or a rebase). Once the PR is approved you neaten the commit history using git rebase -i --autosquash.

Describe the solution you'd like
I'd like a new shortcut on the commit panel to trigger a git commit --fixup <SHA>. e.g. ctrl-f. This would bring up a view similar to the logs panel which would allow choosing the commit to fixup.

To be clear - this would only perform git commit --fixup <SHA> and not git rebase -i --autosquash. No rebase should be involved.

Describe alternatives you've considered
Current workflow is:

  1. Stage changes
  2. Find the commit in logs view, copy the commit hash
  3. Exit gitui
  4. Manually git commit --fixup <PASTE>
  5. Re-enter gitui, continue

Additional context
This was previously requested in #829 which was closed as completed - I think incorrectly as I commented.

I've created a new issue instead of attempting to resurrect that one.

@extrawurst
Copy link
Owner

@danriedl
Copy link

heck yeah, +1 for amend.

@wpcarro
Copy link

wpcarro commented Feb 3, 2024

Whatever Magit's doing in Emacs for its "instant fixup" appears to "just work" (IOW... DWIM)

btw - ty @extrawurst for making a sweet tool :)

@Chinchzilla
Copy link

+1 this is a feature I miss the most after coming from LazyGit

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants