git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* gitk: Author/Committer name with special characters
@ 2008-07-16 22:24 Torsten Paul
  2008-07-16 23:55 ` Paul Mackerras
  0 siblings, 1 reply; 4+ messages in thread
From: Torsten Paul @ 2008-07-16 22:24 UTC (permalink / raw)
  To: git; +Cc: Paul Mackerras

Hi!

I'm tracking a subversion repository which is running on
a windows machine with git-svn. The user names look like
DOMAIN\username and that's giving a strange display in
gitk as the backslash sequence is evaluated.

I'm not sure if I found the correct place to prevent this,
so I'd like to ask if the following change would be the
correct thing to prepare as patch...

ciao,
   Torsten.


diff --git a/gitk-git/gitk b/gitk-git/gitk
index fddcb45..f114fa2 100644
--- a/gitk-git/gitk
+++ b/gitk-git/gitk
@@ -1510,10 +1510,10 @@ proc parsecommit {id contents listed} {
         set tag [lindex $line 0]
         if {$tag == "author"} {
             set audate [lindex $line end-1]
-           set auname [lrange $line 1 end-2]
+           set auname [join [lrange [split $line] 1 end-2]]
         } elseif {$tag == "committer"} {
             set comdate [lindex $line end-1]
-           set comname [lrange $line 1 end-2]
+           set comname [join [lrange [split $line] 1 end-2]]
         }
      }
      set headline {}

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

* Re: gitk: Author/Committer name with special characters
  2008-07-16 22:24 gitk: Author/Committer name with special characters Torsten Paul
@ 2008-07-16 23:55 ` Paul Mackerras
  2008-07-17  7:34   ` Torsten Paul
  2008-07-19 15:16   ` Torsten Paul
  0 siblings, 2 replies; 4+ messages in thread
From: Paul Mackerras @ 2008-07-16 23:55 UTC (permalink / raw)
  To: Torsten Paul; +Cc: git

Torsten Paul writes:

> I'm tracking a subversion repository which is running on
> a windows machine with git-svn. The user names look like
> DOMAIN\username and that's giving a strange display in
> gitk as the backslash sequence is evaluated.
> 
> I'm not sure if I found the correct place to prevent this,
> so I'd like to ask if the following change would be the
> correct thing to prepare as patch...

Something like that, I think, but to be sure I'd like to see the
actual author and committer lines that are causing the problem.  Could
you send me the output of "git cat-file commit" on one of the
problematic commits?

Thanks,
Paul.

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

* Re: gitk: Author/Committer name with special characters
  2008-07-16 23:55 ` Paul Mackerras
@ 2008-07-17  7:34   ` Torsten Paul
  2008-07-19 15:16   ` Torsten Paul
  1 sibling, 0 replies; 4+ messages in thread
From: Torsten Paul @ 2008-07-17  7:34 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

Paul Mackerras wrote:
 > Something like that, I think, but to be sure I'd like to see the
 > actual author and committer lines that are causing the problem.  Could
 > you send me the output of "git cat-file commit" on one of the
 > problematic commits?
 >
The header of the commits look like this:

tree 2eaf317290917660c03dc977d5eae180b39420e0
parent e99bf1c38540300c501dbe776de28eed6a2250cd
author DOM\paul <DOM\paul@28e39a90-19ad-e645-8baa-5c9ab2323746> 1216216768 +0000
committer DOM\paul <DOM\paul@28e39a90-19ad-e645-8baa-5c9ab2323746> 1216216768 +0000

With my name it's just not displaying the backslash, but with names
starting with a 't' or even better 'n' it get's more interresting
as they are shown as tab or newline. And that looks very funny in
the commit list view.

ciao,
   Torsten.

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

* Re: gitk: Author/Committer name with special characters
  2008-07-16 23:55 ` Paul Mackerras
  2008-07-17  7:34   ` Torsten Paul
@ 2008-07-19 15:16   ` Torsten Paul
  1 sibling, 0 replies; 4+ messages in thread
From: Torsten Paul @ 2008-07-19 15:16 UTC (permalink / raw)
  To: Paul Mackerras; +Cc: git

Paul Mackerras wrote:
> Something like that, I think, but to be sure I'd like to see the
> actual author and committer lines that are causing the problem.  Could
> you send me the output of "git cat-file commit" on one of the
> problematic commits?
> 
I've created a small script that creates a minimal repo that shows
the problem...

ciao,
   Torsten.


#!/bin/bash

#
# Script to generate git commit messages that
# contain windows style user names. This kind of
# names are generated when using git-svn with a
# svn-repo that uses NTLM authentification.
#

EXT="@23e39a30-19ad-a625-8bac-5c9ab2323746"

do_commit () {
         F=test.txt
         echo "test$1" > "$F"
         git add "$F"

         M="<$2$EXT>"

         GIT_AUTHOR_NAME="$2" \
         GIT_AUTHOR_EMAIL="$M" \
         GIT_COMMITTER_NAME="$2" \
         GIT_COMMITTER_EMAIL="$M" \
         git commit -m "commit $1"
}

DIR=`mktemp -d /tmp/gitk-test.XXXXXXXXXX` || exit 1
trap "rm -rf \"$DIR\"" EXIT
cd $DIR || exit 2

git init
do_commit 1 "paul"
do_commit 2 "WIN\paul"
do_commit 3 "WIN\test"
do_commit 4 "WIN\nobody"
do_commit 5 "WIN\paul"
do_commit 6 "paul"
gitk

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

end of thread, other threads:[~2008-07-19 15:17 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2008-07-16 22:24 gitk: Author/Committer name with special characters Torsten Paul
2008-07-16 23:55 ` Paul Mackerras
2008-07-17  7:34   ` Torsten Paul
2008-07-19 15:16   ` Torsten Paul

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