Re: [PATCH v5 0/4] history: add squash subcommand to fold a range
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Jun 26, 2026, 14:02 UTC
- Message-ID
- <xmqqh5mpcsc0.fsf@gitster.g>
- In-Reply-To
- <4654a3f1-bf79-4c3f-b121-16bb3ab25f07@gmail.com>
Phillip Wood <phillip.wood123@gmail.com> writes:
Show 12 quoted lines
> On 26/06/2026 10:57, Harald Nordgren wrote: >> On Fri, Jun 26, 2026 at 10:53 AM Phillip Wood <phillip.wood123@gmail.com> wrote:>> >> 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? > > '^/:base..:/tip' is not a range - everything after the first '/:' is > treated as a regular expression to search for.
This particular case you can do
HEAD^{/base}..HEAD^{/tip}(or even go "HEAD^{/tip}~43" and fancier other forms, the point being with matching {} pair, you can do more than what the lazy short-hand form can).
But I think your point still stands, I think, as
git history squash HEAD^{/base}..:/tip ^mainmay be something you would want to do to express additional constraints, like "I want this range squashed, but I should never ever touch what is already in main".