git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: working with a large repository and git svn

From
Ramkumar Ramachandra <artagnon@gmail.com>
Date
Jan 14, 2011, 08:05 UTC
Message-ID
<20110114080554.GA1735@kytes>
In-Reply-To
<AANLkTikCvjDqUpL-=srVKcMQx+NM6bV7FabmJ+4sPqD7@mail.gmail.com>
Hi Joe,
Joe Corneli writes:
Show 5 quoted lines
> > I think the state of the art is currently git2svn
> 
> Thanks, that did indeed work, though, for the record it uses committer
> name and email in the log that it generates, not author name and
> email, but no worries!

That should be easy enough to fix with something like this (warning: untested). A more elegant solution would actually use some sort of user-configurable mapping from Git authors/ committers to SVN authors though.

Signed-off-by: Ramkumar Ramachandra <artagnon@gmail.com>
--8<--
diff --git a/git2svn b/git2svn
index 2380775..3856696 100755
--- a/git2svn
+++ b/git2svn
@@ -261,12 +261,8 @@ COMMAND: while (!eof(IN)) {
 	    $commit{Mark} = $1;
 	    $next = next_line($IN);
 	}
-	if ($next =~ m/author +(.*)/) {
-	    $commit{Author} = $1;
-	    $next = next_line($IN);
-	}
-	unless ($next =~ m/committer +(.+) +<([^>]+)> +(\d+) +[+-](\d+)$/) {
-	    die "missing comitter: $_";
+	unless ($next =~ m/author +(.+) +<([^>]+)> +(\d+) +[+-](\d+)$/) {
+	    die "missing author: $_";
 	}
 
 	$commit{CommitterName} = $1;
@@ -275,6 +271,9 @@ COMMAND: while (!eof(IN)) {
 	$commit{CommitterTZ} = $4;
 
 	$next = next_line($IN);
+	if ($next =~ m/committer +(.*)/) {
+	    $next = next_line($IN);
+	}
 	my $log = read_data($IN, $next);
 
 	$next = next_line($IN);
Previous: Joe CorneliNext: Jonathan Nieder
Message 6 of 12 in “working with a large repository and git svn”
  1. Joe CorneliJan 12, 2011
  2. Wesley J. LandakerJan 12, 2011
  3. Joe CorneliJan 13, 2011
  4. Jonathan NiederJan 13, 2011
  5. Joe CorneliJan 14, 2011
  6. Ramkumar RamachandraJan 14, 2011
  7. Jonathan NiederJan 14, 2011
  8. Michael HaggertyJan 14, 2011
  9. Optionally parse author informationRamkumar Ramachandra, Jan 14, 2011
  10. Joe CorneliJan 16, 2011
  11. Jonathan NiederJan 16, 2011
  12. Ramkumar RamachandraJan 16, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.