Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Magit should respect commit encoding when getting subject from --pretty="format:* %s" #36

Closed
VitalyOstanin opened this issue Aug 3, 2010 · 2 comments
Labels
obsolete This issue has already been fixed
Milestone

Comments

@VitalyOstanin
Copy link

git log show correctly encoded subject only for predefined pretty format - oneline, full etc.

When pretty uses custom string such as "%s" it should also use "%e" (commit encoding), then do recoding from commit encoding to repo's logOutputEncoding (perhaps to utf8 first).

Or magit can use something like
git log --pretty=oneline | cut -d ' ' -f 2
leaving internal encodings to git.

How to reprocude:

$ locale
LANG=ru_RU.CP1251
LC_CTYPE="ru_RU.CP1251"
LC_NUMERIC="ru_RU.CP1251"
LC_TIME="ru_RU.CP1251"
LC_COLLATE="ru_RU.CP1251"
LC_MONETARY="ru_RU.CP1251"
LC_MESSAGES="ru_RU.CP1251"
LC_PAPER="ru_RU.CP1251"
LC_NAME="ru_RU.CP1251"
LC_ADDRESS="ru_RU.CP1251"
LC_TELEPHONE="ru_RU.CP1251"
LC_MEASUREMENT="ru_RU.CP1251"
LC_IDENTIFICATION="ru_RU.CP1251"
LC_ALL=

$ mkdir git-subject-bug

$ cd git-subject-bug

$ git init

Initialized empty Git repository in .../git-subject-bug/.git/

$ touch test

$ git add .

$ git config i18n.commitEncoding cp1251

$ git config i18n.logOutputEncoding cp1251

Do commit with non latin message

$ git commit -a -m "Тест"

$ export LANG=ru_RU.UTF-8

$ git config i18n.logOutputEncoding utf8

$ git config i18n.commitEncoding utf8

Run xterm with new locale settings

$ xterm

Readable output

$ git log --pretty=oneline

Broken encoding

$ git log --pretty="%H %s"

@tarsius
Copy link
Member

tarsius commented Apr 20, 2013

Is this still an issue?

@tarsius
Copy link
Member

tarsius commented Jun 23, 2013

Please reopen if this is still an issue.

@tarsius tarsius closed this as completed Jun 23, 2013
kenny-thomas pushed a commit to kenny-thomas/magit that referenced this issue Aug 22, 2017
Support XDG_CONFIG_HOME for ignore/config mode.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
obsolete This issue has already been fixed
Development

No branches or pull requests

2 participants