Skip to content

history: squash the commits not in the upstream by default - #2463

Draft
HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:history-squash-default-upstream
Draft

HaraldNordgren wants to merge 1 commit into
git:masterfrom
HaraldNordgren:history-squash-default-upstream

Conversation

@HaraldNordgren

Copy link
Copy Markdown
Contributor

Make git history squash with no range default to the commits on the current branch that are not in its upstream, like git rebase does.

"git history squash" with no arguments refuses to run and asks for a
revision range, even though the commits to squash are usually the ones
on the current branch that its upstream does not have.

The subcommand added in 6fd039c (history: add skeleton for squash
subcommand, 2026-09-08) started out on the list as "git rebase --squash
[<upstream>]", which folded "@{upstream}..HEAD" when given no argument.
It moved to "git history" to take any range, and that default was lost
in the move.

Squash the commits since the branch forked off its upstream, so this
keeps working after a fetch brings in new upstream commits.

Signed-off-by: Harald Nordgren <haraldnordgren@gmail.com>
@HaraldNordgren
HaraldNordgren force-pushed the history-squash-default-upstream branch from 9f786f1 to 793fff9 Compare October 22, 2026 21:33

This branch has not been deployed

No deployments
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