# gitk: Author/Committer name with special characters

4 messages from 2008-07-16 to 2008-07-19. Participants: Torsten Paul, Paul Mackerras.
Thread: https://gitlist.dev/t/14498

## Torsten Paul, 2008-07-16 22:24

Subject: gitk: Author/Committer name with special characters
Message-ID: <487E7525.7000708@gmx.de>
URL: https://gitlist.dev/e/487E7525.7000708%40gmx.de

```
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, 2008-07-16 23:55

Subject: Re: gitk: Author/Committer name with special characters
Message-ID: <18558.35423.933860.915622@cargo.ozlabs.ibm.com>
URL: https://gitlist.dev/e/18558.35423.933860.915622%40cargo.ozlabs.ibm.com
In-Reply-To: <487E7525.7000708@gmx.de>

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

```

## Torsten Paul, 2008-07-17 07:34

Subject: Re: gitk: Author/Committer name with special characters
Message-ID: <487EF619.3000805@gmx.de>
URL: https://gitlist.dev/e/487EF619.3000805%40gmx.de
In-Reply-To: <18558.35423.933860.915622@cargo.ozlabs.ibm.com>

```
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, 2008-07-19 15:16

Subject: Re: gitk: Author/Committer name with special characters
Message-ID: <48820534.7080806@gmx.de>
URL: https://gitlist.dev/e/48820534.7080806%40gmx.de
In-Reply-To: <18558.35423.933860.915622@cargo.ozlabs.ibm.com>

```
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

```
