git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Fredrik Kuivinen <freku045@student.liu.se>
To: Junio C Hamano <junkio@cox.net>
Cc: Fredrik Kuivinen <freku045@student.liu.se>,
	git@vger.kernel.org,
	Johannes Schindelin <Johannes.Schindelin@gmx.de>,
	Ryan Anderson <ryan@michonline.com>
Subject: Re: [PATCH] git-blame: Make the output human readable
Date: Tue, 7 Mar 2006 17:34:27 +0100	[thread overview]
Message-ID: <20060307163427.GB4457@c165.ib.student.liu.se> (raw)
In-Reply-To: <7vveuseg2u.fsf@assigned-by-dhcp.cox.net>

On Sun, Mar 05, 2006 at 01:28:57PM -0800, Junio C Hamano wrote:
> Fredrik Kuivinen <freku045@student.liu.se> writes:
> 
> > I find the first format easier to read since everything is aligned (we
> > always output 15 characters for the committer's name padded with
> > spaces if necessary and the line numbers are padded appropriately). It
> > also takes up less space on screen since it doesn't use tabs.
> 
> Careful.  The convention for names is to encode them in UTF-8,
> so if you mean 15 "characters" that might be OK but if it can
> truncate in the middle of a multibyte sequence of UTF-8 encoded
> single character it is a no-no.
> 
> We are talking about "casual" aligning, so I would not bring up
> "proportional fonts", but even on a monospace terminal and
> line-printer output, there still is the issue of byte count not
> matching columns.  In an i18nized environment, aligning columns
> by counting bytes is a lost battle.
> 
> In any case, please make sure you do not chop a character in the
> middle at least [*1*].
> 

I hadn't thought of that. The code as it is now will occasionally do
the wrong thing when encountered with multibyte per code point
encodings. If we can assume that the name is in UTF-8 then the code
posted by "linux@horizon.com" to the list should do the trick.

However, can we assume that the name is in UTF-8? Do
i18n.commitencoding only apply to the commit message, or is it
intended to apply to the author/committer information too?

I am beginning to think that it might be best to, by default, store
the author, committer and commit messages in UTF-8. And then
automatically convert from/to the users locale on input/output. (I
just read the old "Rss produced by git is not valid xml?" thread where
this issue was discussed quite a bit. However, I didn't see the 'store
in UTF-8 by default and convert from/to users locale' method anywhere
in that thread.)

- Fredrik

  reply	other threads:[~2006-03-07 16:34 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-05 11:03 [PATCH] git-blame: Make the output human readable Fredrik Kuivinen
2006-03-05 12:10 ` Junio C Hamano
2006-03-05 12:38   ` Fredrik Kuivinen
2006-03-05 14:23     ` Johannes Schindelin
2006-03-05 21:28     ` Junio C Hamano
2006-03-07 16:34       ` Fredrik Kuivinen [this message]
2006-03-05 22:46     ` [PATCH] blame: avoid -lm by not using log() Junio C Hamano
2006-03-05 23:36       ` Johannes Schindelin
2006-03-05 22:48     ` [PATCH] blame and annotate: show localtime with timezone Junio C Hamano
2006-03-05 14:11   ` [PATCH] git-blame: Make the output human readable Johannes Schindelin
  -- strict thread matches above, loose matches on Subject: below --
2006-03-06 19:33 linux
2006-03-08 14:32 ` Sergey Vlasov
2006-03-08 18:04   ` linux
2006-03-08 18:30     ` Sergey Vlasov
2006-03-08 19:06       ` linux

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=20060307163427.GB4457@c165.ib.student.liu.se \
    --to=freku045@student.liu.se \
    --cc=Johannes.Schindelin@gmx.de \
    --cc=git@vger.kernel.org \
    --cc=junkio@cox.net \
    --cc=ryan@michonline.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
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;
as well as URLs for NNTP newsgroup(s).