Skip to content

Fix: autosquash command (r f) bug is fixed.#1880

Open
swnakamura wants to merge 2 commits intoNeogitOrg:masterfrom
swnakamura:feat/fix-autosquash
Open

Fix: autosquash command (r f) bug is fixed.#1880
swnakamura wants to merge 2 commits intoNeogitOrg:masterfrom
swnakamura:feat/fix-autosquash

Conversation

@swnakamura
Copy link
Contributor

@swnakamura swnakamura commented Dec 17, 2025

When r f is pressed, obtain the parent of currently specified commit as new base and run a interactive (autosquashing) rebase onto the commit.
Currently, there's a bug that deletes the rebased commits (#1620). This PR fixes it.

Obtain new base as the parent of currently specified commit, and run
a interactive (autosquashing) rebase onto the commit.
base,
util.deduplicate(util.merge(popup:get_arguments(), { "--autosquash", "--keep-empty" }))
)
git.rebase.rebase_interactive(base, args)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is it even necessary to bring up the interactive editor view for this?

I think it would be even more convenient if this used the git.rebase.instantly path (similar to instant fixup).

Copy link
Contributor Author

@swnakamura swnakamura Feb 24, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for the comment.
According to loqusion, Magit runs git … rebase -i --root --autosquash --keep-empty --autostash when running r f, so I implemented it in the way that shows an interactive view with autostash.

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.

2 participants