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

Re: [PATCH 1/2] commit: reject invalid UTF-8 codepoints

From
Junio C Hamano <gitster@pobox.com>
Date
Jul 4, 2013, 00:47 UTC
Message-ID
<7vehbfcfsj.fsf@alter.siamese.dyndns.org>
In-Reply-To
<20130704001724.GQ862789@vauxhall.crustytoothpaste.net>
"brian m. carlson" <sandals@crustytoothpaste.net> writes:
> git format-patch --binary seems to produce the exact same output as
> without the --binary option.  Is there a different way I should be
> selecting the binary option?

These days --binary is a no-op option for format-patch (we used to default to showing "binary files differ" in diff and required the option to force generating binary patch), but the real issue is that you haven't told Git that these "invalid" files are binary files and not text X-<.

Perhaps add something like this temporarily to .git/info/attributes when running the command?

	$ cat >>.git/info/attributes <<\EOF
        t/t3900/UTF-8-invalid.txt	binary
        EOF

Another idea is _not_ to create these invalid files inside t3900/ but create them in the set-up part of the test script to the current directory, using "printf" to make sure the readers who read test know what exact byte sequence is written out in the test and is used, which might be a better option in the long run.

Thanks.
Previous: brian m. carlsonNext: Peter Krefting
Message 6 of 7 in “commit: reject invalid UTF-8 codepoints”
  1. 1/2 commit: reject invalid UTF-8 codepointsbrian m. carlson, Jun 29, 2013
  2. Junio C HamanoJun 30, 2013
  3. brian m. carlsonJun 30, 2013
  4. Junio C HamanoJun 30, 2013
  5. brian m. carlsonJul 4, 2013
  6. Junio C HamanoJul 4, 2013
  7. Peter KreftingJul 1, 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.