public inbox for git@vger.kernel.org
 help / color / mirror / Atom feed
From: Victoria Dye <vdye@github.com>
To: Junio C Hamano <gitster@pobox.com>,
	Deveshi Dwivedi <deveshigurgaon@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] t1006: fix %(rest) test for object names with whitespace
Date: Thu, 19 Feb 2026 12:23:57 -0800	[thread overview]
Message-ID: <d2bf79b3-4407-4fa0-ae2b-fcb3178f36f7@github.com> (raw)
In-Reply-To: <xmqqikbs4iod.fsf@gitster.g>

On 2/19/26 11:50 AM, Junio C Hamano wrote:
> 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.


  reply	other threads:[~2026-02-19 20:23 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-02-19 15:24 [PATCH] t1006: fix %(rest) test for object names with whitespace Deveshi Dwivedi
2026-02-19 19:50 ` Junio C Hamano
2026-02-19 20:23   ` Victoria Dye [this message]
2026-02-19 20:48     ` Junio C Hamano
2026-02-20  3:30       ` Junio C Hamano
2026-02-20 16:59         ` Deveshi Dwivedi

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=d2bf79b3-4407-4fa0-ae2b-fcb3178f36f7@github.com \
    --to=vdye@github.com \
    --cc=deveshigurgaon@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox