threads / discuss / 14498

gitk: Author/Committer name with special characters

Subject: gitk: Author/Committer name with special characters

## tl;dr

4 messages between Jul 16, 2008 and Jul 19, 2008.

replies: 3people: 2as markdown or json

Torsten Paul· Jul 16, 2008, 22:24 UTC · lore
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 {}
Paul Mackerras· Jul 16, 2008, 23:55 UTC · re: Torsten Paul · lore

Re: gitk: Author/Committer name with special characters

Torsten Paul writes:
Show 8 quoted lines
> 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.

Torsten Paul· Jul 17, 2008, 07:34 UTC · re: Paul Mackerras · lore

Re: gitk: Author/Committer name with special characters

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.
Torsten Paul· Jul 19, 2008, 15:16 UTC · re: Paul Mackerras · lore

Re: gitk: Author/Committer name with special characters

Paul Mackerras wrote:
Show 5 quoted lines
> 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

← back to recent threads