git/list[1] front-page[2] threads[3] people[4] search[5] about
wed 2026-10-07 16:51 UTC

Re: [PATCH] t1006: fix %(rest) test for object names with whitespace

From
Victoria Dye <vdye@github.com>
Date
Feb 19, 2026, 20:23 UTC
Message-ID
<d2bf79b3-4407-4fa0-ae2b-fcb3178f36f7@github.com>
In-Reply-To
<xmqqikbs4iod.fsf@gitster.g>
On 2/19/26 11:50 AM, Junio C Hamano wrote:
Show 30 quoted lines
> I am not sure if this particular FIXME has much value, but ...
> 
>> diff --git a/t/t1006-cat-file.sh b/t/t1006-cat-file.sh
>> index 0eee3bb878..cac88acf65 100755
>> --- a/t/t1006-cat-file.sh
>> +++ b/t/t1006-cat-file.sh
>> @@ -194,18 +194,11 @@ $content"
>>   	test_cmp expect actual
>>       '
>>   
>> -    # FIXME: %(rest) is incompatible with object names that include whitespace,
>> -    # e.g. HEAD:path/to/a/file with spaces. Use the resolved OID as input to
>> -    # test this instead of the raw object name.
>> -    if echo "$object_name" | grep -q " "; then
>> -	test_rest=test_expect_failure
>> -    else
>> -	test_rest=test_expect_success
>> -    fi
>> -
>> -    $test_rest '--batch-check with %(rest)' '
>> +    # Use the resolved OID so %(rest) parsing is independent of whitespace
>> +    # in object names (e.g. HEAD:path with spaces).
>> +    test_expect_success '--batch-check with %(rest)' '
>>   	echo "$type this is some extra content" >expect &&
>> -	echo "$object_name    this is some extra content" |
>> +	echo "$oid    this is some extra content" |
> 
> ... I somehow doubt that this is what 9fd38038 (t1006: update
> 'run_tests' to test generic object specifiers, 2025-06-02) meant by
> that comment.

That FIXME was intended to call out the behavior of %(rest) in cat-file itself as something that we may eventually want to fix. The comment is only here because this test happens to demonstrate that behavior. For that reason, I'm also not sure I see the value of this patch; it's removing some visibility to a quirk of cat-file without fixing the underlying issue.

Previous: Junio C HamanoNext: Junio C Hamano
Message 3 of 6 in “t1006: fix %(rest) test for object names with whitespace”
  1. t1006: fix %(rest) test for object names with whitespaceDeveshi Dwivedi, Feb 19, 2026
  2. Junio C HamanoFeb 19, 2026
  3. Victoria DyeFeb 19, 2026
  4. Junio C HamanoFeb 19, 2026
  5. Junio C HamanoFeb 20, 2026
  6. Deveshi DwivediFeb 20, 2026

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.