{"thread":{"id":"10352","subject":"git-svn help for authorsfile","startedAt":"2007-10-18T06:26:30Z","lastAt":"2007-10-18T22:53:37Z","messageCount":2,"participants":["Dongsheng Song","Sam Vilain"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"56363","messageId":"4b3406f0710172326y29c73a79x648ef98208adba78@mail.gmail.com","threadId":"10352","inReplyTo":null,"subject":"git-svn help for authorsfile","fromName":"Dongsheng Song","fromEmail":"dongsheng.song@gmail.com","sentAt":"2007-10-18T06:26:30Z","receivedAt":"2007-10-18T06:26:30Z","isPatch":false,"sender":{"key":"dongsheng.song@gmail.com","avatar":null},"body":"In general, all svn projects share the same authorsfile, e.g.\n\n[svn]\nauthorsfile=/path/to/authorsfile\n\n[svn-remote \"project-a\"]\n   url = http://server.org/svn\n   branches = branches/*/project-a:refs/remotes/project-a/branches/*\n   tags = tags/*/project-a:refs/remotes/project-a/tags/*\n   trunk = trunk/project-a:refs/remotes/project-a/trunk\n\n[svn-remote \"project-b\"]\n   url = http://server.org/svn\n   branches = branches/*/project-b:refs/remotes/project-b/branches/*\n   tags = tags/*/project-b:refs/remotes/project-b/tags/*\n   trunk = trunk/project-b:refs/remotes/project-b/trunk\n\nBut if  project-a and project-b has same svn id, map to different\nuser/email, how do I do?\n\nCan we move authorsfile from svn to svn-remote section ?\n\nThanks for some help,\n\n---\nDongsheng\n"},{"id":"56441","messageId":"4717E3F1.8020805@vilain.net","threadId":"10352","inReplyTo":"4b3406f0710172326y29c73a79x648ef98208adba78@mail.gmail.com","subject":"Re: git-svn help for authorsfile","fromName":"Sam Vilain","fromEmail":"sam@vilain.net","sentAt":"2007-10-18T22:53:37Z","receivedAt":"2007-10-18T22:53:37Z","isPatch":false,"sender":{"key":"sam@vilain.net","avatar":"https://gravatar.com/avatar/8fc840ca854dbf6f7065b4335e3b934951c1dca3b11db688e95e471901f8f4a8?d=mp&s=160"},"body":"Dongsheng Song wrote:\n> In general, all svn projects share the same authorsfile, e.g.\n> \n> [svn]\n> authorsfile=/path/to/authorsfile\n> \n> [svn-remote \"project-a\"]\n>    url = http://server.org/svn\n>    branches = branches/*/project-a:refs/remotes/project-a/branches/*\n>    tags = tags/*/project-a:refs/remotes/project-a/tags/*\n>    trunk = trunk/project-a:refs/remotes/project-a/trunk\n> \n> [svn-remote \"project-b\"]\n>    url = http://server.org/svn\n>    branches = branches/*/project-b:refs/remotes/project-b/branches/*\n>    tags = tags/*/project-b:refs/remotes/project-b/tags/*\n>    trunk = trunk/project-b:refs/remotes/project-b/trunk\n> \n> But if  project-a and project-b has same svn id, map to different\n> user/email, how do I do?\n> \n> Can we move authorsfile from svn to svn-remote section ?\n\nDongsheng,\n\nIf you come up with a patch that allows this, then I'm sure it can be\nconsidered; below is what I imagine it would minimally require.  However,\nI haven't tested this at all so please treat with caution.\n\nSubject: [PATCH] git-svn: allow per-remote authors map\n\nAllow the authors map to be overridden on a per-remote basis.\n---\n git-svn.perl |   14 +++++++++-----\n 1 files changed, 9 insertions(+), 5 deletions(-)\n\ndiff --git a/git-svn.perl b/git-svn.perl\nindex c015ea8..47f524d 100755\n--- a/git-svn.perl\n+++ b/git-svn.perl\n@@ -5,7 +5,7 @@ use warnings;\n use strict;\n use vars qw/\t$AUTHOR $VERSION\n \t\t$sha1 $sha1_short $_revision\n-\t\t$_q $_authors %users/;\n+\t\t$_q %users/;\n $AUTHOR = 'Eric Wong <normalperson@yhbt.net>';\n $VERSION = '@@GIT_VERSION@@';\n \n@@ -65,7 +65,7 @@ my %remote_opts = ( 'username=s' => \\$Git::SVN::Prompt::_username,\n                     'config-dir=s' => \\$Git::SVN::Ra::config_dir,\n                     'no-auth-cache' => \\$Git::SVN::Prompt::_no_auth_cache );\n my %fc_opts = ( 'follow-parent|follow!' => \\$Git::SVN::_follow_parent,\n-\t\t'authors-file|A=s' => \\$_authors,\n+\t\t'authors-file|A=s' => \\$Git::SVN::_authors,\n \t\t'repack:i' => \\$Git::SVN::_repack,\n \t\t'noMetadata' => \\$Git::SVN::_no_metadata,\n \t\t'useSvmProps' => \\$Git::SVN::_use_svm_props,\n@@ -142,7 +142,7 @@ my %cmd = (\n \t\t\t  'oneline' => \\$Git::SVN::Log::oneline,\n \t\t\t  'show-commit' => \\$Git::SVN::Log::show_commit,\n \t\t\t  'non-recursive' => \\$Git::SVN::Log::non_recursive,\n-\t\t\t  'authors-file|A=s' => \\$_authors,\n+\t\t\t  'authors-file|A=s' => \\$Git::SVN::authors,\n \t\t\t  'color' => \\$Git::SVN::Log::color,\n \t\t\t  'pager=s' => \\$Git::SVN::Log::pager,\n \t\t\t} ],\n@@ -187,7 +187,6 @@ exit 1 if (!$rv && $cmd && $cmd ne 'log');\n usage(0) if $_help;\n version() if $_version;\n usage(1) unless defined $cmd;\n-load_authors() if $_authors;\n \n # make sure we're always running\n unless ($cmd =~ /(?:clone|init|multi-init)$/) {\n@@ -748,6 +747,7 @@ sub file_to_s {\n \n # '<svn username> = real-name <email address>' mapping based on git-svnimport:\n sub load_authors {\n+\tmy $_authors = shift;\n \topen my $authors, '<', $_authors or die \"Can't open $_authors $!\\n\";\n \tmy $log = $cmd eq 'log';\n \twhile (<$authors>) {\n@@ -891,7 +891,7 @@ package Git::SVN;\n use strict;\n use warnings;\n use vars qw/$default_repo_id $default_ref_id $_no_metadata $_follow_parent\n-            $_repack $_repack_flags $_use_svm_props $_head\n+            $_repack $_repack_flags $_use_svm_props $_head $_authors\n             $_use_svnsync_props $no_reuse_existing $_minimize_url/;\n use Carp qw/croak/;\n use File::Path qw/mkpath/;\n@@ -993,6 +993,8 @@ sub fetch_all {\n \t$remotes ||= read_all_remotes();\n \tmy $remote = $remotes->{$repo_id} or\n \t             die \"[svn-remote \\\"$repo_id\\\"] unknown\\n\";\n+\tmy $authors = $remote->{authors} || $_authors;\n+\tload_authors($authors) if $authors;\n \tmy $fetch = $remote->{fetch};\n \tmy $url = $remote->{url} or die \"svn-remote.$repo_id.url not defined\\n\";\n \tmy (@gs, @globs);\n@@ -1050,6 +1052,8 @@ sub read_all_remotes {\n \t\t\t\tdie \"The '*' glob character must be the last \",\n \t\t\t\t    \"character of '$g'\\n\";\n \t\t\t}\n+\t\t} elsif (m!^(.+)\\.authors=\\s*(.*)\\s*$!) {\n+\t\t\t$r->{$1}->{authors} = $2;\n \t\t}\n \t}\n \t$r;\n-- \n1.5.3.2.3.g2f2dcc-dirty\n"}]}