diff options
author | Alexey Shumkin <Alex.Crezoff@gmail.com> | 2013-06-26 14:19:50 +0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2013-06-26 22:40:31 +0400 |
commit | ecaee8050cec23eb4cf082512e907e3e52c20b57 (patch) | |
tree | 94a99119bc202b87f00f55b640f971f6306bd69e /t/t6006-rev-list-format.sh | |
parent | de6029a2d7734a93a9e27b9c4471862a47dd8123 (diff) |
pretty: --format output should honor logOutputEncoding
One can set an alias
$ git config [--global] alias.lg "log --graph --pretty=format:'%Cred%h%Creset
-%C(yellow)%d%Creset %s %Cgreen(%cd) %C(bold blue)<%an>%Creset'
--abbrev-commit --date=local"
to see the log as a pretty tree (like *gitk* but in a terminal).
However, log messages written in an encoding i18n.commitEncoding which differs
from terminal encoding are shown corrupted even when i18n.logOutputEncoding
and terminal encoding are the same (e.g. log messages committed on a Cygwin box
with Windows-1251 encoding seen on a Linux box with a UTF-8 encoding and vice versa).
To simplify an example we can say the following two commands are expected
to give the same output to a terminal:
$ git log --oneline --no-color
$ git log --pretty=format:'%h %s'
However, the former pays attention to i18n.logOutputEncoding
configuration, while the latter does not when it formats "%s".
The same corruption is true for
$ git diff --submodule=log
and
$ git rev-list --pretty=format:%s HEAD
and
$ git reset --hard
This patch makes pretty --format honor logOutputEncoding when it formats
log message.
Signed-off-by: Alexey Shumkin <Alex.Crezoff@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6006-rev-list-format.sh')
-rwxr-xr-x | t/t6006-rev-list-format.sh | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/t/t6006-rev-list-format.sh b/t/t6006-rev-list-format.sh index c66a07f8da..380c85bf12 100755 --- a/t/t6006-rev-list-format.sh +++ b/t/t6006-rev-list-format.sh @@ -141,7 +141,7 @@ commit $head1 iso-8859-1 EOF -test_format failure subject %s <<EOF +test_format subject %s <<EOF commit $head2 $changed commit $head1 @@ -153,7 +153,7 @@ commit $head2 commit $head1 EOF -test_format failure raw-body %B <<EOF +test_format raw-body %B <<EOF commit $head2 $changed @@ -247,7 +247,7 @@ commit $head1 iso-8859-1 EOF -test_format failure complex-subject %s <<EOF +test_format complex-subject %s <<EOF commit $head3 Test printing of complex bodies commit $head2 @@ -256,7 +256,7 @@ commit $head1 $added EOF -test_format failure complex-body %b <<EOF +test_format complex-body %b <<EOF commit $head3 This commit message is much longer than the others, and it will be encoded in iso8859-1. We should therefore |