Re: [PATCH] worktree: allow "-" short-hand for @{-1} in add command

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Jordan DE GEA <jordan.de-gea@xxxxxxxxxxxxxxxx> writes:

>>> +test_expect_success '"add" using shorthand - fails when no previous branch' '
>>> +	test_must_fail git worktree add existing -
>>> +'
>> 
>> Just an observation, but the error message we would see here might
>> be interesting.
>
> Of course, that’s useful to be sure of the error, I will do in next preroll.

That was not what I meant.  The exit status being non-zero is what
we primarily care about.  The exact phrasing of the error message is
much less important and in general we shouldn't enforce "the error
message must remain so" in the test.

If you observe the error message from this test, e.g. by running it
with "-v", I suspect that you would see the message would complain
about "@{-1}".

I just wanted to make sure that you saw it and thought about its
ramifications.

It is perfectly fine by me (others might disagree, though) if your
conclusion after thinking about it is "Even though the user may be
surprised to get complaints for "@{-1}" that she never gave to the
command (she gave "-"), because we clearly document that "-" is a
mere synonym/short-hand for @{-1}, it is OK".  I still want to see
that behaviour justified in the proposed commit log message.

And that is why I said it "might be interesting".


--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]