All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <junkio@cox.net>
To: Pavel Roskin <proski@gnu.org>
Cc: Paul Mackerras <paulus@samba.org>, git@vger.kernel.org
Subject: Re: [PATCH] gitk: UTF-8 support
Date: Sun, 27 Nov 2005 16:12:51 -0800	[thread overview]
Message-ID: <7vr7917hq4.fsf@assigned-by-dhcp.cox.net> (raw)
In-Reply-To: 20051124021231.nrg8448gk8w4owk8@webmail.spamcop.net

Pavel Roskin <proski@gnu.org> writes:

>> And as I suggested in another message (in the died-out thread
>> about gitweb), we could have i18n.commitEncoding in the
>> configuration to help gitk and gitweb.  I think that is the same
>> as your "other option".
>
> Yes.  Then my patch needs to be changed to set encoding to that setting and only
> if it's present.

The following patch on top of your patch has seen only very
light testing, but it seems to do the right thing for my
repository with utf-8 commit messages and another with euc-jp
commit messages.  For the latter, I needed to do:

	$ git-repo-config i18n.commitencoding euc-jp

-- >8 --
[PATCH] gitk: Use i18n.commitencoding configuration item.

Hardcoding "utf-8" in the script breaks projects that use local
encoding, so allow setting i18n.commitEncoding.

Signed-off-by: Junio C Hamano <junkio@cox.net>

---
diff --git a/gitk b/gitk
index b53a5c5..2242216 100755
--- a/gitk
+++ b/gitk
@@ -3669,7 +3669,14 @@ set datemode 0
 set boldnames 0
 set diffopts "-U 5 -p"
 set wrcomcmd "git-diff-tree --stdin -p --pretty"
-set gitencoding "utf-8"
+
+set gitencoding ""
+catch {
+    set gitencoding [exec git-repo-config --get i18n.commitencoding]
+}
+if {$gitencoding == ""} {
+	set gitencoding "utf-8"
+}
 
 set mainfont {Helvetica 9}
 set textfont {Courier 9}

  reply	other threads:[~2005-11-28  0:13 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-11-23  4:15 [PATCH] gitk: UTF-8 support Pavel Roskin
2005-11-24  0:47 ` Junio C Hamano
2005-11-24  1:11   ` Paul Mackerras
2005-11-24  4:53   ` Pavel Roskin
2005-11-24  6:23     ` Junio C Hamano
2005-11-24  7:12       ` Pavel Roskin
2005-11-28  0:12         ` Junio C Hamano [this message]
2005-11-28 21:55           ` Pavel Roskin

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=7vr7917hq4.fsf@assigned-by-dhcp.cox.net \
    --to=junkio@cox.net \
    --cc=git@vger.kernel.org \
    --cc=paulus@samba.org \
    --cc=proski@gnu.org \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.