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

Re: working with a large repository and git svn

From
Jonathan Nieder <jrnieder@gmail.com>
Date
Jan 14, 2011, 08:29 UTC
Message-ID
<20110114082931.GC11343@burratino>
In-Reply-To
<20110114080554.GA1735@kytes>
Ramkumar Ramachandra wrote:
> Joe Corneli writes:
Show 10 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.
Thanks for the cc.  (cc-ing lha, as I should have before.)

I suppose if svn will show only one of the two (committer and author) then it is better to show the author. Possible complications:

. The author lines in fast-import streams are optional.
. Existing users of the incremental import facility might not want the
  meaning of svn:author to change between imports.  _If_ that is a
  problem then a command-line option to switch behaviors might help.
. Is svn okay with non-monotonic dates?  (If not, then the committer
  date would need to be used.)

Modulo those complications I like the idea. (Though I haven't read the implementation, which follows for reference.)

Show 32 quoted lines
> 
> 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: Ramkumar RamachandraNext: Michael Haggerty
Message 7 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.