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

Re: [PATCH] Add missing test file for UTF-16.

From
Duy Nguyen <pclouds@gmail.com>
Date
Aug 6, 2013, 11:59 UTC
Message-ID
<CACsJy8ACqB5qRLFCerACEQrK8QXH+n=tAxdutAGT6JeijDvJUQ@mail.gmail.com>
In-Reply-To
<7vtxj4kry1.fsf@alter.siamese.dyndns.org>
On Mon, Aug 5, 2013 at 11:44 PM, Junio C Hamano <gitster@pobox.com> wrote:
Show 32 quoted lines
> Duy Nguyen <pclouds@gmail.com> writes:
>
>> On Sun, Aug 4, 2013 at 12:26 AM, brian m. carlson
>> <sandals@crustytoothpaste.net> wrote:
>>> The test file that the UTF-16 rejection test looks for is missing, but this went
>>> unnoticed because the test is expected to fail anyway; as a consequence, the
>>> test fails because the file containing the commit message is missing, and not
>>> because the test file contains a NUL byte.  Fix this by including a sample text
>>> file containing a commit message encoded in UTF-16.
>>
>> Tested-by: Duy Nguyen <pclouds@gmai.com>
>>
>> and sorry, my bad. I think we need your sign-off in this patch.
>
> I think 37576c14 (commit_tree(): refuse commit messages that contain
> NULs, 2011-12-15) that marked this test with "test_expect_failure" is
> broken with or without this fix.  It should be more like so:
>
> diff --git a/t/t3900-i18n-commit.sh b/t/t3900-i18n-commit.sh
> index 37ddabb..5e72d72 100755
> --- a/t/t3900-i18n-commit.sh
> +++ b/t/t3900-i18n-commit.sh
> @@ -34,9 +34,9 @@ test_expect_success 'no encoding header for base case' '
>         test z = "z$E"
>  '
>
> -test_expect_failure 'UTF-16 refused because of NULs' '
> +test_expect_success 'UTF-16 refused because of NULs' '
>         echo UTF-16 >F &&
> -       git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
> +       test_must_fail git commit -a -F "$TEST_DIRECTORY"/t3900/UTF-16.txt
>  '

The intention was "UTF-16 is not supported yet but we want to". But I don't think we (at least I) will put any effort on that front to allow NUL in commit message, so the patch, as in "we do not support UTF-16", is fine.

-- 
Duy
Previous: Junio C HamanoNext: Junio C Hamano
Message 5 of 6 in “Add missing test file for UTF-16.”
  1. Add missing test file for UTF-16.brian m. carlson, Aug 3, 2013
  2. Duy NguyenAug 4, 2013
  3. brian m. carlsonAug 4, 2013
  4. Junio C HamanoAug 5, 2013
  5. Duy NguyenAug 6, 2013
  6. Junio C HamanoAug 6, 2013

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.