git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] pathspec: die on empty strings as pathspec

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 23, 2017, 20:59 UTC
Message-ID
<xmqqr2yactdx.fsf@gitster.mtv.corp.google.com>
In-Reply-To
<802ccd37-c09a-8343-63fe-a42c682a8311@web.de>
Torsten Bögershausen <tboegi@web.de> writes:
Show 31 quoted lines
> On 23/06/17 20:04, Junio C Hamano wrote:
>...
>> At this point in the test sequence, there is no modified path that
>> need to be further added before committing; the working tree is
>> empty except for .gitattributes which was just added to the index.
>> So we could instead pass no pathspec, but this is a conversion more
>> faithful to the original.
>>
>> Signed-off-by: Junio C Hamano <gitster@pobox.com>
>> ---
>>   t/t0027-auto-crlf.sh | 2 +-
>>   1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/t/t0027-auto-crlf.sh b/t/t0027-auto-crlf.sh
>> index 93725895a4..e41c9b3bb2 100755
>> --- a/t/t0027-auto-crlf.sh
>> +++ b/t/t0027-auto-crlf.sh
>> @@ -322,7 +322,7 @@ test_expect_success 'setup master' '
>>   	echo >.gitattributes &&
>>   	git checkout -b master &&
>>   	git add .gitattributes &&
>> -	git commit -m "add .gitattributes" "" &&
>> +	git commit -m "add .gitattributes" . &&
>
> Reading the context here, there shouldn't be a "pathspec" at all,
> as .gitattributes had been added just one line above.
>
> The line should have been from the very beginning:
> 	git commit -m "add .gitattributes"  &&
>
> # What do you think ?
See above ;-)

And to be more explicit, it is not a fault of your earlier change, either, that we didn't notice this problem since we started "warning".

We need to see if we can update our test framework to help us better; I really think the test framework could and should have helped us to notice this soon after we went into "keep behaving as before but warn" stage.

Previous: Torsten Bögershausen
Message 12 of 12 in “pathspec: die on empty strings as pathspec”
  1. pathspec: die on empty strings as pathspecEmily Xie, Jun 7, 2017
  2. Junio C HamanoJun 9, 2017
  3. Jeff KingJun 10, 2017
  4. Junio C HamanoJun 10, 2017
  5. Brandon WilliamsJun 9, 2017
  6. Junio C HamanoJun 10, 2017
  7. Emily XieJun 23, 2017
  8. Junio C HamanoJun 23, 2017
  9. Junio C HamanoJun 23, 2017
  10. Junio C HamanoJun 23, 2017
  11. Torsten BögershausenJun 23, 2017
  12. Junio C HamanoJun 23, 2017

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.