{"thread":{"id":"35729","subject":"'git diff' command doesn't honor utf8 symbol boundaries, and doesn't use actual terminal width","startedAt":"2014-01-25T03:34:36Z","lastAt":"2014-01-25T04:02:12Z","messageCount":2,"participants":["Yuri","Duy Nguyen"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"233740","messageId":"52E330CC.10400@rawbw.com","threadId":"35729","inReplyTo":null,"subject":"'git diff' command doesn't honor utf8 symbol boundaries, and doesn't use actual terminal width","fromName":"Yuri","fromEmail":"yuri@rawbw.com","sentAt":"2014-01-25T03:34:36Z","receivedAt":"2014-01-25T03:34:36Z","isPatch":false,"sender":{"key":"yuri@rawbw.com","avatar":null},"body":"The fragment of 'git diff' output looks like this:\n- <translation>Ошибка: адрес %1 содержит запрещенные символы. \nПожалуйста, перепро�\n+ <translation>Ошибка: адрес %1 содержит запрещённые символы. \nПожалуйста, перепро�\n\nTwo issues here:\n1. Cyrilic text in utf8 got truncated not at utf8 boundary, causing this \ngarbage symbol in the end\n2. Truncation is done at somewhat ~70% of the actual screen width. git \ncould go all the way to the whole screen with, but it didn't. Shrinking \nterminal width causes the output truncation limit to shrink in the same \nproportion. So some bad decision about truncation size is made somewhere \nin 'git diff' command.\n\nSuggested behavior:\n1. git should respect utf8, and in case of truncation it should add … \nsymbol.\n2. truncation algorithm should read current terminal width and truncate \nat width-1 length to allow for the above-mentioned symbol\n\nYuri\n"},{"id":"233742","messageId":"CACsJy8Cgz+18F85408vKL-pBHPOLjxJjsbTF+pL4D2k=DbU0-g@mail.gmail.com","threadId":"35729","inReplyTo":"52E330CC.10400@rawbw.com","subject":"Re: 'git diff' command doesn't honor utf8 symbol boundaries, and doesn't use actual terminal width","fromName":"Duy Nguyen","fromEmail":"pclouds@gmail.com","sentAt":"2014-01-25T04:02:12Z","receivedAt":"2014-01-25T04:02:12Z","isPatch":false,"sender":{"key":"pclouds@gmail.com","avatar":"https://avatars.githubusercontent.com/u/720?v=4"},"body":"On Sat, Jan 25, 2014 at 10:34 AM, Yuri <yuri@rawbw.com> wrote:\n> The fragment of 'git diff' output looks like this:\n> - <translation>Ошибка: адрес %1 содержит запрещенные символы. Пожалуйста,\n> перепро�\n> + <translation>Ошибка: адрес %1 содержит запрещённые символы. Пожалуйста,\n> перепро�\n>\n> Two issues here:\n> 1. Cyrilic text in utf8 got truncated not at utf8 boundary, causing this\n> garbage symbol in the end\n> 2. Truncation is done at somewhat ~70% of the actual screen width. git could\n> go all the way to the whole screen with, but it didn't. Shrinking terminal\n> width causes the output truncation limit to shrink in the same proportion.\n> So some bad decision about truncation size is made somewhere in 'git diff'\n> command.\n>\n> Suggested behavior:\n> 1. git should respect utf8, and in case of truncation it should add …\n> symbol.\n> 2. truncation algorithm should read current terminal width and truncate at\n> width-1 length to allow for the above-mentioned symbol\n\nI don't think git diff truncates its output (it does truncate @@\nlines, but not the real diff). Perhaps your pager did that?\n-- \nDuy\n"}]}