Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
- From
Harald Nordgren <haraldnordgren@gmail.com>
- Date
- Jun 26, 2026, 09:57 UTC
- Message-ID
- <CAHwyqnWXaG1HGunztVgUdWnVogqCHRbxh8pcS5fGA6f3mB-nEA@mail.gmail.com>
- In-Reply-To
- <d37e8f4f-d1f9-45aa-8c95-ebe676d54671@gmail.com>
On Fri, Jun 26, 2026 at 10:53 AM Phillip Wood <phillip.wood123@gmail.com> wrote:
Show 21 quoted lines
> > Hi Harald > > On 24/06/2026 22:54, Harald Nordgren via GitGitGadget wrote: > > Adds git history squash <revision-range> to fold a range of commits. > > It would be helpful to give a bit more detail here about the command so > that the reader has an overview of what is actually being implemented. > > - what does it do with fixup!, squash! and amend! commits? Can it use > the message from amend! commits to reword the commit? > - can the user reword the commit message? > - what happens if a merge commit inside the range has a parent outside > the range? > - what happens to branches that point to commits inside the range? > > I had a quick play and found that it accepts ranges that containing a > single commit (e.g. @^!) where there is nothing to squash. It also > accepts ranges that are not ancestors of HEAD (e.g. checkout master and > run "git history squash --dry-run origin/seen^2^!") without printing an > error message.
Good points, I will take a look at clarifying or giving an error (like in the case of ancestor not in history of HEAD).
Only accepting a single argument is quite limiting as one
> cannot say > > git history squash ^:/base :/tip
I don't understand why this is limiting? It thought it was clear that it should be one argument REF1..REF2 ? What does '^:/base :/tip' achieve that '^:/base..:/tip' cannot?
Harald