{"thread":{"id":"3466","subject":"[PATCH 2/4] Convert executable flag","startedAt":"2006-02-26T05:03:35Z","lastAt":"2006-03-02T09:20:11Z","messageCount":12,"participants":["Karl Hasselström","Andreas Ericsson","Junio C Hamano","Jon Loeliger"],"isPatch":true,"patchVersion":1,"patchTotal":4},"messages":[{"id":"16742","messageId":"20060226050335.24860.95155.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":null,"subject":"[PATCH 0/4] some git-svnimport improvements","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-26T05:03:35Z","receivedAt":"2006-02-26T05:03:35Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"This patch series teaches git-svnimport about the svn:executable and\nsvn:ignore Subversion properties (try to guess from their names what\nthey do!), and lets the user specify a file with username -> Full Name\n<email@address> mappings.\n\nI vaguely recall some discussion some time ago about the format of\nthis kind of username mapping file, but I ended up just picking the\nsimplest format I could think of since that was the boring part.\n"},{"id":"16743","messageId":"20060226051124.24860.29160.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"20060226050335.24860.95155.stgit@backpacker.hemma.treskal.com","subject":"[PATCH 1/4] Mention -r in usage summary","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-26T05:11:24Z","receivedAt":"2006-02-26T05:11:24Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"I added the -r option to git-svnimport some time ago, but forgot to\nupdate the usage summary in the documentation.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/git-svnimport.txt |    8 ++++----\n 1 files changed, 4 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex 5c543d5..b5c7721 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -10,10 +10,10 @@ git-svnimport - Import a SVN repository \n SYNOPSIS\n --------\n 'git-svnimport' [ -o <branch-for-HEAD> ] [ -h ] [ -v ] [ -d | -D ]\n-\t\t\t[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]\n-\t\t\t[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]\n-\t\t\t[ -s start_chg ] [ -m ] [ -M regex ]\n-\t\t\t<SVN_repository_URL> [ <path> ]\n+\t\t[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]\n+\t\t[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]\n+\t\t[ -s start_chg ] [ -m ] [ -r ] [ -M regex ]\n+\t\t<SVN_repository_URL> [ <path> ]\n \n \n DESCRIPTION\n"},{"id":"16741","messageId":"20060226051126.24860.61044.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"20060226050335.24860.95155.stgit@backpacker.hemma.treskal.com","subject":"[PATCH 2/4] Convert executable flag","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-26T05:11:27Z","receivedAt":"2006-02-26T05:11:27Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Convert the svn:executable property to file mode 755 when converting\nan SVN repository to GIT.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n git-svnimport.perl |   20 +++++++++++++-------\n 1 files changed, 13 insertions(+), 7 deletions(-)\n\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex ee2940f..6603b96 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -112,16 +112,22 @@ sub file {\n \t\t    DIR => File::Spec->tmpdir(), UNLINK => 1);\n \n \tprint \"... $rev $path ...\\n\" if $opt_v;\n-\tmy $pool = SVN::Pool->new();\n-\teval { $self->{'svn'}->get_file($path,$rev,$fh,$pool); };\n-\t$pool->clear;\n+\tmy (undef, $properties);\n+\teval { (undef, $properties)\n+\t\t   = $self->{'svn'}->get_file($path,$rev,$fh); };\n \tif($@) {\n \t\treturn undef if $@ =~ /Attempted to get checksum/;\n \t\tdie $@;\n \t}\n+\tmy $mode;\n+\tif (exists $properties->{'svn:executable'}) {\n+\t\t$mode = '0755';\n+\t} else {\n+\t\t$mode = '0644';\n+\t}\n \tclose ($fh);\n \n-\treturn $name;\n+\treturn ($name, $mode);\n }\n \n package main;\n@@ -296,7 +302,7 @@ sub get_file($$$) {\n \tmy $svnpath = revert_split_path($branch,$path);\n \n \t# now get it\n-\tmy $name;\n+\tmy ($name,$mode);\n \tif($opt_d) {\n \t\tmy($req,$res);\n \n@@ -316,8 +322,9 @@ sub get_file($$$) {\n \t\t\treturn undef if $res->code == 301; # directory?\n \t\t\tdie $res->status_line.\" at $url\\n\";\n \t\t}\n+\t\t$mode = '0644'; # can't obtain mode via direct http request?\n \t} else {\n-\t\t$name = $svn->file(\"$svnpath\",$rev);\n+\t\t($name,$mode) = $svn->file(\"$svnpath\",$rev);\n \t\treturn undef unless defined $name;\n \t}\n \n@@ -331,7 +338,6 @@ sub get_file($$$) {\n \tchomp $sha;\n \tclose $F;\n \tunlink $name;\n-\tmy $mode = \"0644\"; # SV does not seem to store any file modes\n \treturn [$mode, $sha, $path];\n }\n \n"},{"id":"16745","messageId":"20060226051129.24860.25274.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"20060226050335.24860.95155.stgit@backpacker.hemma.treskal.com","subject":"[PATCH 3/4] Convert the svn:ignore property","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-26T05:11:29Z","receivedAt":"2006-02-26T05:11:29Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Put the value of the svn:ignore property in a regular file when\nconverting a Subversion repository to GIT. The Subversion and GIT\nignore syntaxes are similar enough that it often just works to set the\nfilename to .gitignore and do nothing else.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/git-svnimport.txt |    8 +++++\n git-svnimport.perl              |   60 +++++++++++++++++++++++++++++++++++++--\n 2 files changed, 64 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex b5c7721..c95ff84 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -13,7 +13,7 @@ SYNOPSIS\n \t\t[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]\n \t\t[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]\n \t\t[ -s start_chg ] [ -m ] [ -r ] [ -M regex ]\n-\t\t<SVN_repository_URL> [ <path> ]\n+\t\t[ -I <ignorefile_name> ] <SVN_repository_URL> [ <path> ]\n \n \n DESCRIPTION\n@@ -65,6 +65,12 @@ When importing incrementally, you might \n \tPrepend 'rX: ' to commit messages, where X is the imported\n \tsubversion revision.\n \n+-I <ignorefile_name>::\n+\tImport the svn:ignore directory property to files with this\n+\tname in each directory. (The Subversion and GIT ignore\n+\tsyntaxes are similar enough that using the Subversion patterns\n+\tdirectly with \"-I .gitignore\" will almost always just work.)\n+\n -m::\n \tAttempt to detect merges based on the commit message. This option\n \twill enable default regexes that try to capture the name source\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 6603b96..0dd9fab 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -29,19 +29,21 @@ die \"Need SVN:Core 1.2.1 or better\" if $\n $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n-our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,$opt_b,$opt_r,$opt_s,$opt_l,$opt_d,$opt_D);\n+our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,\n+    $opt_b,$opt_r,$opt_I,$opt_s,$opt_l,$opt_d,$opt_D);\n \n sub usage() {\n \tprint STDERR <<END;\n Usage: ${\\basename $0}     # fetch/update GIT from SVN\n        [-o branch-for-HEAD] [-h] [-v] [-l max_rev]\n        [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]\n-       [-d|-D] [-i] [-u] [-r] [-s start_chg] [-m] [-M regex] [SVN_URL]\n+       [-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg]\n+       [-m] [-M regex] [SVN_URL]\n END\n \texit(1);\n }\n \n-getopts(\"b:C:dDhil:mM:o:rs:t:T:uv\") or usage();\n+getopts(\"b:C:dDhiI:l:mM:o:rs:t:T:uv\") or usage();\n usage if $opt_h;\n \n my $tag_name = $opt_t || \"tags\";\n@@ -130,6 +132,24 @@ sub file {\n \treturn ($name, $mode);\n }\n \n+sub ignore {\n+\tmy($self,$path,$rev) = @_;\n+\n+\tprint \"... $rev $path ...\\n\" if $opt_v;\n+\tmy (undef,undef,$properties)\n+\t    = $self->{'svn'}->get_dir($path,$rev,undef);\n+\tif (exists $properties->{'svn:ignore'}) {\n+\t\tmy ($fh, $name) = tempfile('gitsvn.XXXXXX',\n+\t\t\t\t\t   DIR => File::Spec->tmpdir(),\n+\t\t\t\t\t   UNLINK => 1);\n+\t\tprint $fh $properties->{'svn:ignore'};\n+\t\tclose($fh);\n+\t\treturn $name;\n+\t} else {\n+\t\treturn undef;\n+\t}\n+}\n+\n package main;\n use URI;\n \n@@ -341,6 +361,34 @@ sub get_file($$$) {\n \treturn [$mode, $sha, $path];\n }\n \n+sub get_ignore($$$$$) {\n+\tmy($new,$old,$rev,$branch,$path) = @_;\n+\n+\treturn unless $opt_I;\n+\tmy $svnpath = revert_split_path($branch,$path);\n+\tmy $name = $svn->ignore(\"$svnpath\",$rev);\n+\tif ($path eq '/') {\n+\t\t$path = $opt_I;\n+\t} else {\n+\t\t$path = File::Spec->catfile($path,$opt_I);\n+\t}\n+\tif (defined $name) {\n+\t\tmy $pid = open(my $F, '-|');\n+\t\tdie $! unless defined $pid;\n+\t\tif (!$pid) {\n+\t\t\texec(\"git-hash-object\", \"-w\", $name)\n+\t\t\t    or die \"Cannot create object: $!\\n\";\n+\t\t}\n+\t\tmy $sha = <$F>;\n+\t\tchomp $sha;\n+\t\tclose $F;\n+\t\tunlink $name;\n+\t\tpush(@$new,['0644',$sha,$path]);\n+\t} else {\n+\t\tpush(@$old,$path);\n+\t}\n+}\n+\n sub split_path($$) {\n \tmy($rev,$path) = @_;\n \tmy $branch;\n@@ -546,6 +594,9 @@ sub commit {\n \t\t\t\t\t\tmy $opath = $action->[3];\n \t\t\t\t\t\tprint STDERR \"$revision: $branch: could not fetch '$opath'\\n\";\n \t\t\t\t\t}\n+\t\t\t\t} elsif ($node_kind eq $SVN::Node::dir) {\n+\t\t\t\t\tget_ignore(\\@new, \\@old, $revision,\n+\t\t\t\t\t\t   $branch,$path);\n \t\t\t\t}\n \t\t\t} elsif ($action->[0] eq \"D\") {\n \t\t\t\tpush(@old,$path);\n@@ -554,6 +605,9 @@ sub commit {\n \t\t\t\tif ($node_kind eq $SVN::Node::file) {\n \t\t\t\t\tmy $f = get_file($revision,$branch,$path);\n \t\t\t\t\tpush(@new,$f) if $f;\n+\t\t\t\t} elsif ($node_kind eq $SVN::Node::dir) {\n+\t\t\t\t\tget_ignore(\\@new, \\@old, $revision,\n+\t\t\t\t\t\t   $branch,$path);\n \t\t\t\t}\n \t\t\t} else {\n \t\t\t\tdie \"$revision: unknown action '\".$action->[0].\"' for $path\\n\";\n"},{"id":"16744","messageId":"20060226051131.24860.15804.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"20060226050335.24860.95155.stgit@backpacker.hemma.treskal.com","subject":"[PATCH 4/4] Read author names and emails from a file","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-26T05:11:31Z","receivedAt":"2006-02-26T05:11:31Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"Read a file with lines on the form\n\n  username User's Full Name <email@addres.org>\n\nand use \"User's Full Name <email@addres.org>\" as the GIT author and\ncommitter for Subversion commits made by \"username\". If encountering a\ncommit made by a user not in the list, abort.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/git-svnimport.txt |   13 ++++++++++++-\n git-svnimport.perl              |   23 ++++++++++++++++++++---\n 2 files changed, 32 insertions(+), 4 deletions(-)\n\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex c95ff84..e0e3a5d 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -13,7 +13,8 @@ SYNOPSIS\n \t\t[ -C <GIT_repository> ] [ -i ] [ -u ] [-l limit_rev]\n \t\t[ -b branch_subdir ] [ -T trunk_subdir ] [ -t tag_subdir ]\n \t\t[ -s start_chg ] [ -m ] [ -r ] [ -M regex ]\n-\t\t[ -I <ignorefile_name> ] <SVN_repository_URL> [ <path> ]\n+\t\t[ -I <ignorefile_name> ] [ -A <author_file> ]\n+\t\t<SVN_repository_URL> [ <path> ]\n \n \n DESCRIPTION\n@@ -71,6 +72,16 @@ When importing incrementally, you might \n \tsyntaxes are similar enough that using the Subversion patterns\n \tdirectly with \"-I .gitignore\" will almost always just work.)\n \n+-A <author_file>::\n+\tRead a file with lines on the form\n+\n+\t  username User's Full Name <email@addres.org>\n+\n+\tand use \"User's Full Name <email@addres.org>\" as the GIT\n+\tauthor and committer for Subversion commits made by\n+\t\"username\". If encountering a commit made by a user not in the\n+\tlist, abort.\n+\n -m::\n \tAttempt to detect merges based on the commit message. This option\n \twill enable default regexes that try to capture the name source\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 0dd9fab..75ce8e0 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -30,7 +30,7 @@ $SIG{'PIPE'}=\"IGNORE\";\n $ENV{'TZ'}=\"UTC\";\n \n our($opt_h,$opt_o,$opt_v,$opt_u,$opt_C,$opt_i,$opt_m,$opt_M,$opt_t,$opt_T,\n-    $opt_b,$opt_r,$opt_I,$opt_s,$opt_l,$opt_d,$opt_D);\n+    $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D);\n \n sub usage() {\n \tprint STDERR <<END;\n@@ -38,12 +38,12 @@ Usage: ${\\basename $0}     # fetch/updat\n        [-o branch-for-HEAD] [-h] [-v] [-l max_rev]\n        [-C GIT_repository] [-t tagname] [-T trunkname] [-b branchname]\n        [-d|-D] [-i] [-u] [-r] [-I ignorefilename] [-s start_chg]\n-       [-m] [-M regex] [SVN_URL]\n+       [-m] [-M regex] [-A author_file] [SVN_URL]\n END\n \texit(1);\n }\n \n-getopts(\"b:C:dDhiI:l:mM:o:rs:t:T:uv\") or usage();\n+getopts(\"A:b:C:dDhiI:l:mM:o:rs:t:T:uv\") or usage();\n usage if $opt_h;\n \n my $tag_name = $opt_t || \"tags\";\n@@ -68,6 +68,19 @@ if ($opt_M) {\n \tpush (@mergerx, qr/$opt_M/);\n }\n \n+our %users = ();\n+if ($opt_A) {\n+\tdie \"Cannot open $opt_A\\n\" unless -f $opt_A;\n+\topen(my $authors,$opt_A);\n+\twhile(<$authors>) {\n+\t\tchomp;\n+\t\tnext unless /^(\\S+)\\s+(.+?)\\s+<(\\S+)>$/;\n+\t\t(my $user,my $name,my $email) = ($1,$2,$3);\n+\t\t$users{$user} = [$name,$email];\n+\t}\n+\tclose($authors);\n+}\n+\n select(STDERR); $|=1; select(STDOUT);\n \n \n@@ -485,6 +498,10 @@ sub commit {\n \n \tif (not defined $author) {\n \t\t$author_name = $author_email = \"unknown\";\n+\t} elsif ($opt_A) {\n+\t\tdie \"User $author is not listed in $opt_A\\n\"\n+\t\t    unless exists $users{$author};\n+\t\t($author_name,$author_email) = @{$users{$author}};\n \t} elsif ($author =~ /^(.*?)\\s+<(.*)>$/) {\n \t\t($author_name, $author_email) = ($1, $2);\n \t} else {\n"},{"id":"16751","messageId":"440195D4.7080905@op5.se","threadId":"3466","inReplyTo":"20060226051131.24860.15804.stgit@backpacker.hemma.treskal.com","subject":"Re: [PATCH 4/4] Read author names and emails from a file","fromName":"Andreas Ericsson","fromEmail":"ae@op5.se","sentAt":"2006-02-26T11:49:40Z","receivedAt":"2006-02-26T11:49:40Z","isPatch":true,"sender":{"key":"ae@op5.se","avatar":"https://gravatar.com/avatar/426e89595c75a8f5252dd0c989e5fabe5bcac616e68557427ad9aef6b0ca342a?d=mp&s=160"},"body":"Karl Hasselström wrote:\n> Read a file with lines on the form\n> \n>   username User's Full Name <email@addres.org>\n> \n> and use \"User's Full Name <email@addres.org>\" as the GIT author and\n> committer for Subversion commits made by \"username\". If encountering a\n> commit made by a user not in the list, abort.\n> \n\nThis is a good thing, but wouldn't it be better to use the same format \nas that of cvsimport's -A flag? Also, I imagine one would like to save \nthose files within the .git directory for incremental importing, also \nlike cvsimport does.\n\n-- \nAndreas Ericsson                   andreas.ericsson@op5.se\nOP5 AB                             www.op5.se\nTel: +46 8-230225                  Fax: +46 8-230231\n"},{"id":"16796","messageId":"7vbqwt1h9r.fsf@assigned-by-dhcp.cox.net","threadId":"3466","inReplyTo":"440195D4.7080905@op5.se","subject":"Re: [PATCH 4/4] Read author names and emails from a file","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2006-02-27T05:51:12Z","receivedAt":"2006-02-27T05:51:12Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Andreas Ericsson <ae@op5.se> writes:\n\n> Karl Hasselström wrote:\n>> Read a file with lines on the form\n>>   username User's Full Name <email@addres.org>\n>> and use \"User's Full Name <email@addres.org>\" as the GIT author and\n>> committer for Subversion commits made by \"username\". If encountering a\n>> commit made by a user not in the list, abort.\n>\n> This is a good thing, but wouldn't it be better to use the same format\n> as that of cvsimport's -A flag?\n\nIf both CVS and SVN have their own native format to express\nthings like this, and if the format they use are different, then\nthat is a valid reason for git-{cvs,svn}import to use different\nfile format.\n\nBut if that is not the case, I tend to agree that it might be\neasier for users if we had just one format.  I do not think,\nhowever, any single project is likely to have to deal with both\nCVS and SVN upstream, importing into the same git repository, so\nreusing the mapping file would not be an issue, but having to\nlearn how to write the mapping just once is a good thing.\n\nI do not offhand recall if SVN has its own native format; if it\nhas, it may be better to use that, instead of matching what\ngit-cvsimport does, since I do not think of a reason why the\nversion with an equal sign is preferrable over the version with\na space.  If the version with '=' were the CVS native format\nthen that might be a reason to prefer it, but if I recall\ncorrectly that is not the case. so...\n"},{"id":"16857","messageId":"20060227230013.GA3466@diana.vm.bytemark.co.uk","threadId":"3466","inReplyTo":"7vbqwt1h9r.fsf@assigned-by-dhcp.cox.net","subject":"Re: [PATCH 4/4] Read author names and emails from a file","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-27T23:00:13Z","receivedAt":"2006-02-27T23:00:13Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-02-26 21:51:12 -0800, Junio C Hamano wrote:\n\n> Andreas Ericsson <ae@op5.se> writes:\n>\n> > This is a good thing, but wouldn't it be better to use the same\n> > format as that of cvsimport's -A flag?\n>\n> If both CVS and SVN have their own native format to express things\n> like this, and if the format they use are different, then that is a\n> valid reason for git-{cvs,svn}import to use different file format.\n>\n> But if that is not the case, I tend to agree that it might be easier\n> for users if we had just one format. I do not think, however, any\n> single project is likely to have to deal with both CVS and SVN\n> upstream, importing into the same git repository, so reusing the\n> mapping file would not be an issue, but having to learn how to write\n> the mapping just once is a good thing.\n>\n> I do not offhand recall if SVN has its own native format; if it has,\n> it may be better to use that, instead of matching what git-cvsimport\n> does, since I do not think of a reason why the version with an equal\n> sign is preferrable over the version with a space. If the version\n> with '=' were the CVS native format then that might be a reason to\n> prefer it, but if I recall correctly that is not the case. so...\n\nI don't know of any SVN native format for this, so it seems silly to\nuse a different format than git-cvsimport. I've also made a patch that\nsaves the author information, again just like git-cvsimport.\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"},{"id":"16859","messageId":"20060227230814.12298.63006.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"440195D4.7080905@op5.se","subject":"[PATCH 1/2] Let git-svnimport's author file use same syntax as git-cvsimport's","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-27T23:08:15Z","receivedAt":"2006-02-27T23:08:15Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"git-cvsimport uses a username => Full Name <email@addr.es> mapping\nfile with this syntax:\n\n  kha=Karl Hasselström <kha@treskal.com>\n\nSince there is no reason to use another format for git-svnimport, use\nthe same format.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/git-svnimport.txt |    4 ++--\n git-svnimport.perl              |    2 +-\n 2 files changed, 3 insertions(+), 3 deletions(-)\n\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex e0e3a5d..912a808 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -75,9 +75,9 @@ When importing incrementally, you might \n -A <author_file>::\n \tRead a file with lines on the form\n \n-\t  username User's Full Name <email@addres.org>\n+\t  username = User's Full Name <email@addr.es>\n \n-\tand use \"User's Full Name <email@addres.org>\" as the GIT\n+\tand use \"User's Full Name <email@addr.es>\" as the GIT\n \tauthor and committer for Subversion commits made by\n \t\"username\". If encountering a commit made by a user not in the\n \tlist, abort.\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 75ce8e0..86837ed 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -74,7 +74,7 @@ if ($opt_A) {\n \topen(my $authors,$opt_A);\n \twhile(<$authors>) {\n \t\tchomp;\n-\t\tnext unless /^(\\S+)\\s+(.+?)\\s+<(\\S+)>$/;\n+\t\tnext unless /^(\\S+?)\\s*=\\s*(.+?)\\s*<(.+)>\\s*$/;\n \t\t(my $user,my $name,my $email) = ($1,$2,$3);\n \t\t$users{$user} = [$name,$email];\n \t}\n"},{"id":"16858","messageId":"20060227230817.12298.79184.stgit@backpacker.hemma.treskal.com","threadId":"3466","inReplyTo":"440195D4.7080905@op5.se","subject":"[PATCH 2/2] Save username -> Full Name <email@addr.es> map file","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-02-27T23:08:19Z","receivedAt":"2006-02-27T23:08:19Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"When the user specifies a username -> Full Name <email@addr.es> map\nfile with the -A option, save a copy of that file as\n$git_dir/svn-authors. When running git-svnimport with an existing GIT\ndirectory, use $git_dir/svn-authors (if it exists) unless a file was\nexplicitly specified with -A.\n\nSigned-off-by: Karl Hasselström <kha@treskal.com>\n\n---\n\n Documentation/git-svnimport.txt |    5 +++++\n git-svnimport.perl              |   25 ++++++++++++++++++++-----\n 2 files changed, 25 insertions(+), 5 deletions(-)\n\ndiff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\nindex 912a808..a158813 100644\n--- a/Documentation/git-svnimport.txt\n+++ b/Documentation/git-svnimport.txt\n@@ -82,6 +82,11 @@ When importing incrementally, you might \n \t\"username\". If encountering a commit made by a user not in the\n \tlist, abort.\n \n+\tFor convenience, this data is saved to $GIT_DIR/svn-authors\n+\teach time the -A option is provided, and read from that same\n+\tfile each time git-svnimport is run with an existing GIT\n+\trepository without -A.\n+\n -m::\n \tAttempt to detect merges based on the commit message. This option\n \twill enable default regexes that try to capture the name source\ndiff --git a/git-svnimport.perl b/git-svnimport.perl\nindex 86837ed..639aa41 100755\n--- a/git-svnimport.perl\n+++ b/git-svnimport.perl\n@@ -13,6 +13,7 @@\n use strict;\n use warnings;\n use Getopt::Std;\n+use File::Copy;\n use File::Spec;\n use File::Temp qw(tempfile);\n use File::Path qw(mkpath);\n@@ -68,10 +69,16 @@ if ($opt_M) {\n \tpush (@mergerx, qr/$opt_M/);\n }\n \n+# Absolutize filename now, since we will have chdir'ed by the time we\n+# get around to opening it.\n+$opt_A = File::Spec->rel2abs($opt_A) if $opt_A;\n+\n our %users = ();\n-if ($opt_A) {\n-\tdie \"Cannot open $opt_A\\n\" unless -f $opt_A;\n-\topen(my $authors,$opt_A);\n+our $users_file = undef;\n+sub read_users($) {\n+\t$users_file = File::Spec->rel2abs(@_);\n+\tdie \"Cannot open $users_file\\n\" unless -f $users_file;\n+\topen(my $authors,$users_file);\n \twhile(<$authors>) {\n \t\tchomp;\n \t\tnext unless /^(\\S+?)\\s*=\\s*(.+?)\\s*<(.+)>\\s*$/;\n@@ -302,6 +309,14 @@ EOM\n -d $git_dir\n \tor die \"Could not create git subdir ($git_dir).\\n\";\n \n+my $default_authors = \"$git_dir/svn-authors\";\n+if ($opt_A) {\n+\tread_users($opt_A);\n+\tcopy($opt_A,$default_authors) or die \"Copy failed: $!\";\n+} else {\n+\tread_users($default_authors) if -f $default_authors;\n+}\n+\n open BRANCHES,\">>\", \"$git_dir/svn2git\";\n \n sub node_kind($$$) {\n@@ -498,8 +513,8 @@ sub commit {\n \n \tif (not defined $author) {\n \t\t$author_name = $author_email = \"unknown\";\n-\t} elsif ($opt_A) {\n-\t\tdie \"User $author is not listed in $opt_A\\n\"\n+\t} elsif (defined $users_file) {\n+\t\tdie \"User $author is not listed in $users_file\\n\"\n \t\t    unless exists $users{$author};\n \t\t($author_name,$author_email) = @{$users{$author}};\n \t} elsif ($author =~ /^(.*?)\\s+<(.*)>$/) {\n"},{"id":"16978","messageId":"1141247993.12729.42.camel@cashmere.sps.mot.com","threadId":"3466","inReplyTo":"20060227230814.12298.63006.stgit@backpacker.hemma.treskal.com","subject":"Re: [PATCH 1/2] Let git-svnimport's author file use same syntax as git-cvsimport's","fromName":"Jon Loeliger","fromEmail":"jdl@freescale.com","sentAt":"2006-03-01T21:19:53Z","receivedAt":"2006-03-01T21:19:53Z","isPatch":true,"sender":{"key":"jdl@jdl.com","avatar":"https://gravatar.com/avatar/75ce9a10b151acd2c28ec4ab2136dba7b2ff1634530bd04b155981a749d08a64?d=mp&s=160"},"body":"On Mon, 2006-02-27 at 17:08, Karl Hasselström wrote:\n\n> diff --git a/Documentation/git-svnimport.txt b/Documentation/git-svnimport.txt\n> index e0e3a5d..912a808 100644\n> --- a/Documentation/git-svnimport.txt\n> +++ b/Documentation/git-svnimport.txt\n> @@ -75,9 +75,9 @@ When importing incrementally, you might \n>  -A <author_file>::\n>  \tRead a file with lines on the form\n>  \n> -\t  username User's Full Name <email@addres.org>\n> +\t  username = User's Full Name <email@addr.es>\n>  \n> -\tand use \"User's Full Name <email@addres.org>\" as the GIT\n> +\tand use \"User's Full Name <email@addr.es>\" as the GIT\n>  \tauthor and committer for Subversion commits made by\n>  \t\"username\". If encountering a commit made by a user not in the\n>  \tlist, abort.\n\nActually, I believe that \"example.com\" was reserved\nspecifically for instances such as this.\n\nSee:\n    http://www.faqs.org/rfcs/rfc2606.html\n\njdl\n"},{"id":"17023","messageId":"20060302092011.GA25041@diana.vm.bytemark.co.uk","threadId":"3466","inReplyTo":"1141247993.12729.42.camel@cashmere.sps.mot.com","subject":"Re: [PATCH 1/2] Let git-svnimport's author file use same syntax as git-cvsimport's","fromName":"Karl Hasselström","fromEmail":"kha@treskal.com","sentAt":"2006-03-02T09:20:11Z","receivedAt":"2006-03-02T09:20:11Z","isPatch":true,"sender":{"key":"kha@treskal.com","avatar":"https://gravatar.com/avatar/f0120c734b5279b345075a28521e1ac66acb20c9913ffe9bf6ae97e53f7f3f13?d=mp&s=160"},"body":"On 2006-03-01 15:19:53 -0600, Jon Loeliger wrote:\n\n> On Mon, 2006-02-27 at 17:08, Karl Hasselström wrote:\n>\n> >  \tRead a file with lines on the form\n> >\n> > -\t  username User's Full Name <email@addres.org>\n> > +\t  username = User's Full Name <email@addr.es>\n> >\n> > -\tand use \"User's Full Name <email@addres.org>\" as the GIT\n> > +\tand use \"User's Full Name <email@addr.es>\" as the GIT\n> >  \tauthor and committer for Subversion commits made by\n> >  \t\"username\". If encountering a commit made by a user not in the\n> >  \tlist, abort.\n>\n> Actually, I believe that \"example.com\" was reserved specifically for\n> instances such as this.\n\nYes, I know. But email.address@example.com is much longer then\nemail@addr.es, and not half as funny. :-)\n\n-- \nKarl Hasselström, kha@treskal.com\n      www.treskal.com/kalle\n"}]}