Re: [PATCH 3/3] stash: reject stash name starting with a dash.

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

 



Jeff King <peff@xxxxxxxx> writes:

> On Tue, Aug 18, 2009 at 11:38:43PM +0200, Matthieu Moy wrote:
>
>> This avoids typos like 'git stash save --invalid-option', particularly
>> nasty since one can omit the 'save' subcommand. The syntax
>> 'git stash save -- "-name starting with dash" still allows such stash name.
>
> Aside from the documentation and usage lines, this one is actually
> independent of the other two, and I think makes sense regardless of what
> happens.

Yes, and I'd rather see it near 'maint' even if we were to (mind you, we
won't) reject all changes in 'next' on this program.

>> +test_expect_success 'stash --invalid-option' '
>> +       echo bar5 > file &&
>> +       echo bar6 > file2 &&
>> +       git add file2 &&
>> +       ! git stash --invalid-option &&
>> +       test bar5,bar6 = $(cat file),$(cat file2) &&
>> +       git stash -- -message-starting-with-dash &&
>> +       test bar,bar2 = $(cat file),$(cat file2)
>> +'
>
> Should this actually be "git stash save --invalid-option", since it is
> really testing the actual save option parsing, and not the behavior to
> automatically push options to "git stash save"?

It would be ideal if

	git stash save --invalid-option

failed, while

	git stash --invalid-option should be trapped

and/or

	git stash "--invalid-option should be trapped"

are accepted as valid quickie ways to name a WIP stash before attending to
an unrelated emergency.
--
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]