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

Re: Possible regression in git-rev-list --header

From
Junio C Hamano <junkio@cox.net>
Date
Dec 31, 2006, 01:45 UTC
Message-ID
<7v64bsj0s4.fsf@assigned-by-dhcp.cox.net>
In-Reply-To
<Pine.LNX.4.63.0612310211300.25709@wbgn013.biozentrum.uni-wuerzburg.de>
Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:
Show 10 quoted lines
> On Sat, 30 Dec 2006, Junio C Hamano wrote:
>
>> Another thing.  I think it would make sense to remove "encoding" header 
>> after pretty_print_commit successfully re-codes the buffer.  An 
>> alternative is to rewrite "encoding" header to show which encoding the 
>> log now uses (and omit it if it is UTF-8).
>
> I think it would be wrong. Sure, the output may be encoded differently, 
> but the _original_ commit was not. And this is the information I want 
> to see when I look at the raw commit.

When you want to see the raw commit, you would not ask for it to re-code, so "removal after successfully re-codes" would not kick in (if you _really_ want to look at the raw commit, I guess cat-file can help, but let's not go there). Re-coding the message but still showing what the original encoding was does not sound making much sense to me.

I've pushed this out after a small rework.
The rule is:
 - if you ask for re-coding (either by i18n.* configuration or
   an explicit --encoding option from the command line), and if
   re-coding successfully does its job, you do not see
   "encoding" header;
 - if the buffer cannot successfully be re-coded, no re-coding
   is done, and the caller can inspect "encoding" header.
 - if you do not ask for re-coding, "encoding" header is left as
   is, so is the commit log message.  The caller can deal with
   any re-coding itself.
Previous: Johannes SchindelinNext: Marco Costalba
Message 7 of 26 in “Possible regression in git-rev-list --header”
  1. Marco CostalbaDec 30, 2006
  2. Jakub NarebskiDec 30, 2006
  3. Johannes SchindelinDec 30, 2006
  4. Junio C HamanoDec 30, 2006
  5. Junio C HamanoDec 30, 2006
  6. Johannes SchindelinDec 31, 2006
  7. Junio C HamanoDec 31, 2006
  8. Marco CostalbaDec 31, 2006
  9. Johannes SchindelinDec 31, 2006
  10. Marco CostalbaDec 31, 2006
  11. Junio C HamanoJan 1, 2007
  12. Johannes SchindelinJan 2, 2007
  13. Junio C HamanoJan 2, 2007
  14. Johannes SchindelinJan 2, 2007
  15. Marco CostalbaJan 2, 2007
  16. Marco CostalbaJan 3, 2007
  17. Junio C HamanoJan 3, 2007
  18. Lars HjemliJan 3, 2007
  19. Marco CostalbaJan 3, 2007
  20. Lars HjemliJan 3, 2007
  21. Andreas EricssonJan 4, 2007
  22. Andreas EricssonJan 4, 2007
  23. Lars HjemliJan 3, 2007
  24. Johannes SchindelinDec 31, 2006
  25. Move commit reencoding parameter parsing to revision.cJunio C Hamano, Dec 30, 2006
  26. Johannes SchindelinDec 31, 2006

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.