# [PATCH] git-p4: remove tabs from usermap file

2 messages from 2009-02-27 to 2009-02-27. Participants: Pete Wyckoff, Simon Hausmann.
Thread: https://gitlist.dev/t/18047

## Pete Wyckoff, 2009-02-27 18:53

Subject: [PATCH] git-p4: remove tabs from usermap file
Message-ID: <20090227185359.GA18102@padd.com>
URL: https://gitlist.dev/e/20090227185359.GA18102%40padd.com

```
Some users have tabs in their names, oddly enough.  This
causes problems when loading the usercache from disk,
as split separates the fields on the wrong tabs.  When
fast-import's parse_ident() tries to parse the committer
field, it is unhappy about the unbalanced <..> angle brackets.

It is easy enough to convert the tabs to single spaces.

Signed-off-by: Pete Wyckoff <pw@padd.com>
---
Here's another random little fix.  We have a user
Firstname\tLastname who checked something in recently and
broke my git-p4 conversion.

I need to send the other acked patch to Junio; will wait
and give him two if you ack this one.

 contrib/fast-import/git-p4 |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
index 3832f60..342529d 100755
--- a/contrib/fast-import/git-p4
+++ b/contrib/fast-import/git-p4
@@ -1142,7 +1142,7 @@ class P4Sync(Command):
 
         s = ''
         for (key, val) in self.users.items():
-            s += "%s\t%s\n" % (key, val)
+	    s += "%s\t%s\n" % (key.expandtabs(1), val.expandtabs(1))
 
         open(self.getUserCacheFilename(), "wb").write(s)
         self.userMapFromPerforceServer = True
-- 
1.6.0.6

```

## Simon Hausmann, 2009-02-27 20:50

Subject: Re: [PATCH] git-p4: remove tabs from usermap file
Message-ID: <200902272150.55132.simon@lst.de>
URL: https://gitlist.dev/e/200902272150.55132.simon%40lst.de
In-Reply-To: <20090227185359.GA18102@padd.com>

```
On Friday 27 February 2009 19:53:59 Pete Wyckoff wrote:
> Some users have tabs in their names, oddly enough.  This
> causes problems when loading the usercache from disk,
> as split separates the fields on the wrong tabs.  When
> fast-import's parse_ident() tries to parse the committer
> field, it is unhappy about the unbalanced <..> angle brackets.
>
> It is easy enough to convert the tabs to single spaces.
>
> Signed-off-by: Pete Wyckoff <pw@padd.com>
> ---
> Here's another random little fix.  We have a user
> Firstname\tLastname who checked something in recently and
> broke my git-p4 conversion.
>
> I need to send the other acked patch to Junio; will wait
> and give him two if you ack this one.

Looks good to me :-)

Acked-by: Simon Hausmann <simon@lst.de>


Thanks,
Simon

>  contrib/fast-import/git-p4 |    2 +-
>  1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/contrib/fast-import/git-p4 b/contrib/fast-import/git-p4
> index 3832f60..342529d 100755
> --- a/contrib/fast-import/git-p4
> +++ b/contrib/fast-import/git-p4
> @@ -1142,7 +1142,7 @@ class P4Sync(Command):
>
>          s = ''
>          for (key, val) in self.users.items():
> -            s += "%s\t%s\n" % (key, val)
> +	    s += "%s\t%s\n" % (key.expandtabs(1), val.expandtabs(1))
>
>          open(self.getUserCacheFilename(), "wb").write(s)
>          self.userMapFromPerforceServer = True

```
