git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [BUG] git gui and my ö
@ 2007-04-23 11:32 Uwe Kleine-König
  2007-04-24  5:39 ` Shawn O. Pearce
  0 siblings, 1 reply; 5+ messages in thread
From: Uwe Kleine-König @ 2007-04-23 11:32 UTC (permalink / raw)
  To: Git Mailing List

Hello,

when I try to amend a commit with git gui that is properly signed-off by
me and hit "Commit", I get 

	commit-tree failed:

	<sha1 sum>
	Warning: commit message does not conform to UTF-8.
	You may ...

The commit was done with git-commit, I have 

	zeisberg@cassiopeia:~$ set | grep -E '^L(ANG|C_)'
	LANG=en_US.UTF-8
	LC_CTYPE=en_US.UTF-8

and the ö is properly displayed in the commit message text box before
hitting Commit.  When I remove the ö, I can commit (and re-amend on the
cmdline).

I'm using:

	zeisberg@cassiopeia:~/gsrc/linux-2.6$ git version
	git version 1.5.1.1.190.g74474
	zeisberg@cassiopeia:~/gsrc/linux-2.6$ git gui version
	git-gui version 0.6.5.10.g845d3

I don't know tcl/tk very well, so for now you only get a report and no
patch :-(

Best regards
Uwe

-- 
Uwe Kleine-König

http://www.google.com/search?q=5%2B7

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] git gui and my ö
  2007-04-23 11:32 [BUG] git gui and my ö Uwe Kleine-König
@ 2007-04-24  5:39 ` Shawn O. Pearce
  2007-04-24  6:16   ` Shawn O. Pearce
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-24  5:39 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Git Mailing List

Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
> 	commit-tree failed:
> 
> 	<sha1 sum>
> 	Warning: commit message does not conform to UTF-8.
> 	You may ...
> 
> The commit was done with git-commit, I have 
> 
> 	zeisberg@cassiopeia:~$ set | grep -E '^L(ANG|C_)'
> 	LANG=en_US.UTF-8
> 	LC_CTYPE=en_US.UTF-8

What does your git-config think is the value of i18n.commitencoding?
If its unset git-gui assumes utf-8 as the encoding.  Hmm...

This particular code is around line 1287 of git-gui:

   1287     # -- Build the message.
   1288     #
   1289     set msg_p [gitdir COMMIT_EDITMSG]
   1290     set msg_wt [open $msg_p w]
   1291     if {[catch {set enc $repo_config(i18n.commitencoding)}]} {
   1292         set enc utf-8
   1293     }
   1294     fconfigure $msg_wt -encoding $enc -translation binary
   1295     puts -nonewline $msg_wt $msg
   1296     close $msg_wt

We should be writing the commit message (here $msg) out to a
temporary file ($msg_p / $msg_t), using a UTF-8 encoding ($enc).
Apparently that's not what's happening here.  I wonder if the Tk
text widget is feeding me UTF-8, and the way I have configured the
file channel Tcl is than mangling things futher... *sigh*

Anyone reading this a better Tcl guru than I?


I'll try to take a look at this tomorrow.  I'll have to figure out
how to get your proper name into git-gui first.  :-)

I had thought I had most of git-gui i8n safe, but apparently not.
Thanks for the bug report!

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] git gui and my ö
  2007-04-24  5:39 ` Shawn O. Pearce
@ 2007-04-24  6:16   ` Shawn O. Pearce
  2007-04-24  8:57     ` Uwe Kleine-König
  0 siblings, 1 reply; 5+ messages in thread
From: Shawn O. Pearce @ 2007-04-24  6:16 UTC (permalink / raw)
  To: Uwe Kleine-König; +Cc: Git Mailing List

"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
> > 	commit-tree failed:
> > 	Warning: commit message does not conform to UTF-8.

This was starting to bug me, so I went off and found it.  OK, well
the encoding error anyway.  git-gui incorrectly claimed commit-tree
failed when it didn't.  But besides the point, this is the bad line:

>    1294     fconfigure $msg_wt -encoding $enc -translation binary

I have had trouble in the past with trying to use that magic
-encoding flag on fconfigure to get Tcl's file channels to perform
encoding work for me.  Seems it doesn't work right or something...
so other parts of git-gui (e.g. the filename handling parts)
perform the convertfrom/convertto logic on their own... but the
commit message handling parts didn't.

They do now (git gui 0.6.5-11-gf20db5f).

Can you please test my current master branch and see if that fixes
things for you?  repo.or.cz, git-gui.git...

If it does, I'm probably going to tag that as 0.6.6 and let Junio
cut 1.5.2 with that release.

-- 
Shawn.

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] git gui and my ö
  2007-04-24  6:16   ` Shawn O. Pearce
@ 2007-04-24  8:57     ` Uwe Kleine-König
  0 siblings, 0 replies; 5+ messages in thread
From: Uwe Kleine-König @ 2007-04-24  8:57 UTC (permalink / raw)
  To: Shawn O. Pearce; +Cc: Git Mailing List

Hello Shawn,

Shawn O. Pearce wrote:
> "Shawn O. Pearce" <spearce@spearce.org> wrote:
> > Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
> > > 	commit-tree failed:
> > > 	Warning: commit message does not conform to UTF-8.
> 
> This was starting to bug me, so I went off and found it.  OK, well
> the encoding error anyway.  git-gui incorrectly claimed commit-tree
> failed when it didn't.  But besides the point, this is the bad line:
> 
> >    1294     fconfigure $msg_wt -encoding $enc -translation binary
> 
> I have had trouble in the past with trying to use that magic
> -encoding flag on fconfigure to get Tcl's file channels to perform
> encoding work for me.  Seems it doesn't work right or something...
> so other parts of git-gui (e.g. the filename handling parts)
> perform the convertfrom/convertto logic on their own... but the
> commit message handling parts didn't.
> 
> They do now (git gui 0.6.5-11-gf20db5f).
> 
> Can you please test my current master branch and see if that fixes
> things for you?  repo.or.cz, git-gui.git...
Works fine.  I pulled in your changes[1] and it worked with one test
case.  (I amended the merge and added a sign-off. ;-)

Best regards and thanks
Uwe

[1] Thanks to gitster in #git to explain how to do it.  It's as easy as:

	git pull -s subtree git://.../git-gui.git master

-- 
Uwe Kleine-König

http://www.google.com/search?q=gravity+on+earth%3D

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [BUG] git gui and my ö
@ 2007-04-25 22:48 Brett Schwarz
  0 siblings, 0 replies; 5+ messages in thread
From: Brett Schwarz @ 2007-04-25 22:48 UTC (permalink / raw)
  To: Shawn O. Pearce, Uwe Kleine-König; +Cc: Git Mailing List

sorry for the bad formatting, stupid web email....

If you specify "-translation binary", it will actually set the -encoding to binary as well. From the man page http://tcl.activestate.com/man/tcl8.4/TclCmd/fconfigure.htm#M11

"binary
No end-of-line translations are performed.  This is nearly identical to
lf mode, except that in addition binary mode also sets the
end-of-file character to the empty string (which disables it) and sets the
encoding to binary (which disables encoding filtering).  See the
description of -eofchar and -encoding for more information."
Note also that Tcl stores strings internally as UTF-8. You might be working too hard (I'm not sure, I haven't looked at the code).

HTH,
    --brett


----- Original Message ----
From: Shawn O. Pearce <spearce@spearce.org>
To: Uwe Kleine-König <ukleinek@informatik.uni-freiburg.de>
Cc: Git Mailing List <git@vger.kernel.org>
Sent: Monday, April 23, 2007 11:16:52 PM
Subject: Re: [BUG] git gui and my ö

"Shawn O. Pearce" <spearce@spearce.org> wrote:
> Uwe Kleine-K??nig <ukleinek@informatik.uni-freiburg.de> wrote:
> >     commit-tree failed:
> >     Warning: commit message does not conform to UTF-8.

This was starting to bug me, so I went off and found it.  OK, well
the encoding error anyway.  git-gui incorrectly claimed commit-tree
failed when it didn't.  But besides the point, this is the bad line:

>    1294     fconfigure $msg_wt -encoding $enc -translation binary

I have had trouble in the past with trying to use that magic
-encoding flag on fconfigure to get Tcl's file channels to perform
encoding work for me.  Seems it doesn't work right or something...
so other parts of git-gui (e.g. the filename handling parts)
perform the convertfrom/convertto logic on their own... but the
commit message handling parts didn't.

They do now (git gui 0.6.5-11-gf20db5f).

Can you please test my current master branch and see if that fixes
things for you?  repo.or.cz, git-gui.git...

If it does, I'm probably going to tag that as 0.6.6 and let Junio
cut 1.5.2 with that release.

-- 
Shawn.
-
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html




__________________________________________________
Do You Yahoo!?
Tired of spam?  Yahoo! Mail has the best spam protection around 
http://mail.yahoo.com 

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2007-04-25 22:55 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-04-23 11:32 [BUG] git gui and my ö Uwe Kleine-König
2007-04-24  5:39 ` Shawn O. Pearce
2007-04-24  6:16   ` Shawn O. Pearce
2007-04-24  8:57     ` Uwe Kleine-König
  -- strict thread matches above, loose matches on Subject: below --
2007-04-25 22:48 Brett Schwarz

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).