Re: [PATCH v2] allow "-" as short-hand for "@{-1}" in "branch -d"
- From
Rubén Justo <rjusto@gmail.com>
- Date
- Aug 16, 2022, 21:27 UTC
- Message-ID
- <4707eba3-bcfa-24ef-ca6d-a23d6a64ee6d@gmail.com>
- In-Reply-To
- <xmqqo7wkt3w7.fsf@gitster.g>
On 8/16/22 8:55 PM, Junio C Hamano wrote:
Show 8 quoted lines
> >> From: rjusto <rjusto@gmail.com> > > Documentation/SubmittingPatches: > > Also notice that a real name is used in the `Signed-off-by` > trailer. Please don't hide your real name. >
Fixed.
Show 6 quoted lines
>> - branch: allow "-" as a short-hand for "previous branch"
>> + allow "-" as short-hand for "@{-1}" in "branch -d"
>
> The "branch:" prefix is lost here, which is not an improvement. The
> "<area>:" prefix is what makes it easier to locate a particular
> change in "git shortlog --no-merges v2.37.0..v2.38.0".Just want to reduce the confusion, as Johannes suggested, that could apply to the whole command. But ok, I've put it back.
Show 5 quoted lines
> > As to the implementation, there is nothing to complain about, but as > we already discussed during the reivew of the first iteration, I am > not sure if the goal is sound in the first place. >
Sorry, I don't want to be annoying, I just think the effort is worth of it.
The change rounds the workflow: "checkout/merge/branch -d" and does not introduce any new confusion or new circumstance. The commands that already support the substitution doesn't support it in all combinations, complex use cases can (probably, should) use the @{-1} syntax and definitely those uses are not the candidates to use the short-hands.
> Thanks. >
Thank you.
Rubén.