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

Re: Recoding of {git,cg}-log output

From
Petr Baudis <pasky@suse.cz>
Date
Feb 27, 2006, 01:26 UTC
Message-ID
<20060227012656.GX31278@pasky.or.cz>
In-Reply-To
<44024384.4060406@people.pl>

Dear diary, on Mon, Feb 27, 2006 at 01:10:44AM CET, I got a letter where Krzysiek Pawlik <krzysiek.pawlik@people.pl> said that...

Show 9 quoted lines
> 
> First: a little "why": having /usr/bin/vim as PAGER allows to enter
> UTF-8 commit messages quite easily, the problem is when git-log (or
> cg-log) is run in terminal that's not UTF-8. In my case: terminal is
> ISO-8859-2 and:
> 
> nelchael@nelchael ~$ cat ~/.vimrc | grep gitci
> au BufRead /tmp/gitci* setlocal textwidth=75 fileencoding=utf-8
> encoding=utf-8 fileencodings=utf-8,default
Wouldn't it be enough to also set termencoding?
Show 11 quoted lines
> So... having {git,cg}-log recode the log entires when displaying is
> quite useful. Two patches attached:
> 
>  a. git-log-recode.patch - uses iconv to recode the log output to
> GIT_LOG_RECODE encoding
>  b. cg-log-recode.patch - the same, but for cogito
> 
> With this patches it's possible to write UTF-8 commit messages and see
> them ok in non-UTF-8 terminal in log by having GIT_LOG_RECODE=iso-8859-2.
> 
> Comments?

Not opposed in principle. But it would be much more sensible to have something like $GIT_META_ENCODING (defaulting probably to utf8), recode to whatever is your current locale, have the appropriate setting in the configfile, ...

-- 
				Petr "Pasky" Baudis
Stuff: http://pasky.or.cz/
Of the 3 great composers Mozart tells us what it's like to be human,
Beethoven tells us what it's like to be Beethoven and Bach tells us
what it's like to be the universe.  -- Douglas Adams
Previous: Krzysiek Pawlik
Message 4 of 4 in “Recoding of {git,cg}-log output”
  1. Krzysiek PawlikFeb 27, 2006
  2. Johannes SchindelinFeb 27, 2006
  3. Krzysiek PawlikFeb 27, 2006
  4. Petr BaudisFeb 27, 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.