# git-svn authors file and SVN users with ‘=’ in the username

5 messages from 2014-07-28 to 2014-07-29. Participants: David Braden, Jeff King.
Thread: https://gitlist.dev/t/37230

## David Braden, 2014-07-28 11:33

Subject: git-svn authors file and SVN users with ‘=’ in the username
Message-ID: <dc3fda62c3e94eba9d29fd4b34f2e7cc@EXCHLONDON2013.zoo.lan>
URL: https://gitlist.dev/e/dc3fda62c3e94eba9d29fd4b34f2e7cc%40EXCHLONDON2013.zoo.lan

```
I’m creating a git clone of a svn repository and am trying to set up an authors file to map between the svn users and our git usernames. The svn repository uses the full subject line of a ssl certificate for the user id and so it contains ‘=’ which causes the authors file to be parsed incorrectly as it splits on the first equals.

The code that does the parsing is:

# '<svn username> = real-name <email address>' mapping based on git-svnimport:
sub load_authors {
                open my $authors, '<', $_authors or die "Can't open $_authors $!\n";
                my $log = $cmd eq 'log';
                while (<$authors>) {
                                chomp;
                                next unless /^(.+?|\(no author\))\s*=\s*(.+?)\s*<(.+)>\s*$/;
                                my ($user, $name, $email) = ($1, $2, $3);
                                if ($log) {
                                                $Git::SVN::Log::rusers{"$name <$email>"} = $user;
                                } else {
                                                $users{$user} = [$name, $email];
                                }
                }
                close $authors or croak $!;
}


How can I work around this limitation?

Thanks

David
David Braden
Tel : 020 7485 7500 ext 3199 | Fax : 020 7485 7575

softwire
Sunday Times Best Small Companies - UK top 25 four years running
Web : www.softwire.com<http://www.softwire.com/> | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road, London N3 2SB

```

## Jeff King, 2014-07-28 20:07

Subject: Re: git-svn authors file and SVN users with ‘=’ in the username
Message-ID: <20140728200744.GA18098@peff.net>
URL: https://gitlist.dev/e/20140728200744.GA18098%40peff.net
In-Reply-To: <dc3fda62c3e94eba9d29fd4b34f2e7cc@EXCHLONDON2013.zoo.lan>

```
On Mon, Jul 28, 2014 at 11:33:23AM +0000, David Braden wrote:

> I’m creating a git clone of a svn repository and am trying to set up
> an authors file to map between the svn users and our git usernames.
> The svn repository uses the full subject line of a ssl certificate for
> the user id and so it contains ‘=’ which causes the authors file to be
> parsed incorrectly as it splits on the first equals.
> [...]
> How can I work around this limitation?

I have not tried it, but I suspect --authors-prog might work, as it
passes the name as an argument to the program.

-Peff

```

## David Braden, 2014-07-29 08:35

Subject: RE: git-svn authors file and SVN users with ‘=’ in the username
Message-ID: <49f272949fef4122b2eb83a7a242e366@EXCHLONDON2013.zoo.lan>
URL: https://gitlist.dev/e/49f272949fef4122b2eb83a7a242e366%40EXCHLONDON2013.zoo.lan
In-Reply-To: <20140728200744.GA18098@peff.net>

```
Yeah, the --authors-prog does work.  Is there a way to save the configuration though so you don't have to add it everytime time you rebase or dcommit?

Thanks

David



-----Original Message-----
From: Jeff King [mailto:peff@peff.net]
Sent: 28 July 2014 21:08
To: David Braden
Cc: git@vger.kernel.org
Subject: Re: git-svn authors file and SVN users with ‘=’ in the username

On Mon, Jul 28, 2014 at 11:33:23AM +0000, David Braden wrote:

> I’m creating a git clone of a svn repository and am trying to set up
> an authors file to map between the svn users and our git usernames.
> The svn repository uses the full subject line of a ssl certificate for
> the user id and so it contains ‘=’ which causes the authors file to be
> parsed incorrectly as it splits on the first equals.
> [...]
> How can I work around this limitation?

I have not tried it, but I suspect --authors-prog might work, as it passes the name as an argument to the program.

-Peff

David Braden
Tel : 020 7485 7500 ext 3199 | Fax : 020 7485 7575

softwire
Sunday Times Best Small Companies - UK top 25 four years running
Web : www.softwire.com<http://www.softwire.com/> | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road, London N3 2SB

```

## Jeff King, 2014-07-29 09:26

Subject: Re: git-svn authors file and SVN users with ‘=’ in the username
Message-ID: <20140729092637.GB13134@peff.net>
URL: https://gitlist.dev/e/20140729092637.GB13134%40peff.net
In-Reply-To: <49f272949fef4122b2eb83a7a242e366@EXCHLONDON2013.zoo.lan>

```
On Tue, Jul 29, 2014 at 08:35:26AM +0000, David Braden wrote:

> Yeah, the --authors-prog does work.  Is there a way to save the
> configuration though so you don't have to add it everytime time you
> rebase or dcommit?

I think that git-svn's config reader uses the command-line options as a
template, and automatically reads "--authors-prog" from
"svn.authorsprog". I didn't test it, though.

-Peff

```

## David Braden, 2014-07-29 09:32

Subject: RE: git-svn authors file and SVN users with ‘=’ in the username
Message-ID: <b81d706aa8bd42f391dcc26b4b7f7fbf@EXCHLONDON2013.zoo.lan>
URL: https://gitlist.dev/e/b81d706aa8bd42f391dcc26b4b7f7fbf%40EXCHLONDON2013.zoo.lan
In-Reply-To: <20140729092637.GB13134@peff.net>

```
Yeah, that works. Thank you very much

David


-----Original Message-----
From: Jeff King [mailto:peff@peff.net]
Sent: 29 July 2014 10:27
To: David Braden
Cc: git@vger.kernel.org
Subject: Re: git-svn authors file and SVN users with ‘=’ in the username

On Tue, Jul 29, 2014 at 08:35:26AM +0000, David Braden wrote:

> Yeah, the --authors-prog does work.  Is there a way to save the
> configuration though so you don't have to add it everytime time you
> rebase or dcommit?

I think that git-svn's config reader uses the command-line options as a template, and automatically reads "--authors-prog" from "svn.authorsprog". I didn't test it, though.

-Peff

David Braden
Tel : 020 7485 7500 ext 3199 | Fax : 020 7485 7575

softwire
Sunday Times Best Small Companies - UK top 25 four years running
Web : www.softwire.com<http://www.softwire.com/> | Addr : 325 Highgate Studios, 53-79 Highgate Road, London NW5 1TL
Softwire Technology Limited. Registered in England no. 3824658. Registered Office : 13 Station Road, London N3 2SB

```
