Re: [PATCH] history: squash the commits not in the upstream by default
- From
Patrick Steinhardt <ps@pks.im>
- Date
- Dec 1, 2026, 15:47 UTC
- Message-ID
- <aw7sH9-JCd43kCDX@pks.im>
- In-Reply-To
- <pull.2463.git.git.1795633401382.gitgitgadget@gmail.com>
On Wed, Nov 25, 2026 at 07:03:21PM +0000, Harald Nordgren via GitGitGadget wrote:
Show 11 quoted lines
> From: Harald Nordgren <haraldnordgren@gmail.com>
>
> "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 6fd039c984 (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.Yes, but isn't that a good thing? I wonder whether it becomes too magical when we start to assume the user's intention like this, and users may have a hard time to recover from such an operation. So honestly, I'm not sure that just doing something and hoping that this is what the user wants is sensible and I'd rather prefer to keep the status quo.
I am of course open to have my opinion changed in case there are good arguments for it.
Thanks!
Patrick