From: Yuri <yuri@rawbw•com>
To: Git Mailing List <git@vger•kernel.org>
Subject: 'git diff' command doesn't honor utf8 symbol boundaries, and doesn't use actual terminal width
Date: Fri, 24 Jan 2014 19:34:36 -0800 [thread overview]
Message-ID: <52E330CC.10400@rawbw.com> (raw)
The fragment of 'git diff' output looks like this:
- <translation>Ошибка: адрес %1 содержит запрещенные символы.
Пожалуйста, перепро�
+ <translation>Ошибка: адрес %1 содержит запрещённые символы.
Пожалуйста, перепро�
Two issues here:
1. Cyrilic text in utf8 got truncated not at utf8 boundary, causing this
garbage symbol in the end
2. Truncation is done at somewhat ~70% of the actual screen width. git
could go all the way to the whole screen with, but it didn't. Shrinking
terminal width causes the output truncation limit to shrink in the same
proportion. So some bad decision about truncation size is made somewhere
in 'git diff' command.
Suggested behavior:
1. git should respect utf8, and in case of truncation it should add …
symbol.
2. truncation algorithm should read current terminal width and truncate
at width-1 length to allow for the above-mentioned symbol
Yuri
next reply other threads:[~2014-01-25 3:34 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-01-25 3:34 Yuri [this message]
2014-01-25 4:02 ` 'git diff' command doesn't honor utf8 symbol boundaries, and doesn't use actual terminal width Duy Nguyen
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=52E330CC.10400@rawbw.com \
--to=yuri@rawbw$(echo .)com \
--cc=git@vger$(echo .)kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox