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

Re: Should the --encoding argument to log/show commands make any guarantees about their output?

From
Junio C Hamano <gitster@pobox.com>
Date
Jun 17, 2015, 20:02 UTC
Message-ID
<xmqqzj3y5cji.fsf@gitster.dls.corp.google.com>
In-Reply-To
<20150617184607.GA28455@peff.net>
Jeff King <peff@peff.net> writes:
Show 11 quoted lines
> I would vote for a documentation change, perhaps like:
>
> Subject: docs: clarify that --encoding can produce invalid sequences
>
> In the common case that the commit encoding matches the
> output encoding, we do not touch the buffer at all, which
> makes things much more efficient. But it might be unclear to
> a consumer that we will pass through bogus sequences.
>
> Signed-off-by: Jeff King <peff@peff.net>
> ---
Sounds like a sensible thing to do.
Show 19 quoted lines
>  Documentation/pretty-options.txt | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
>
> diff --git a/Documentation/pretty-options.txt b/Documentation/pretty-options.txt
> index 74aa01a..642af6e 100644
> --- a/Documentation/pretty-options.txt
> +++ b/Documentation/pretty-options.txt
> @@ -37,7 +37,10 @@ people using 80-column terminals.
>  	in their encoding header; this option can be used to tell the
>  	command to re-code the commit log message in the encoding
>  	preferred by the user.  For non plumbing commands this
> -	defaults to UTF-8.
> +	defaults to UTF-8. Note that if an object claims to be encoded
> +	in `X` and we are outputting in `X`, we will output the object
> +	verbatim; this means that invalid sequences in the original
> +	commit may be copied to the output.
>  
>  --notes[=<ref>]::
>  	Show the notes (see linkgit:git-notes[1]) that annotate the
Previous: Jeff KingNext: Torsten Bögershausen
Message 8 of 9 in “Should the --encoding argument to log/show commands make any guarantees about their output?”
  1. Jan-Philip GehrckeJun 15, 2015
  2. Torsten BögershausenJun 15, 2015
  3. Jan-Philip GehrckeJun 16, 2015
  4. Torsten BögershausenJun 16, 2015
  5. Junio C HamanoJun 17, 2015
  6. Jan-Philip GehrckeJun 17, 2015
  7. Jeff KingJun 17, 2015
  8. Junio C HamanoJun 17, 2015
  9. Torsten BögershausenJun 17, 2015

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.