From 7b40e7d1ab20aebaac86b4586d48b6b645da57d1 Mon Sep 17 00:00:00 2001 From: Andy Whitcroft Date: Mon, 25 Sep 2006 12:08:13 +0100 Subject: svnimport: add support for parsing From: lines for author When commiting a non-signed off contribution you cannot just add a Signed-off-by: from the author as they did not sign it off. But if you then commit it, and necessarily sign it off yourself, the change appears to be yours. In this case it is common to use the following form: Commentry From: originator Signed-of-by: me Now that we have support for parsing Signed-off-by: for author information it makes sense to handle From: as well. This patch adds a new -F which will handle From: lines in the comments. It may be used in combination with -S. Signed-off-by: Andy Whitcroft Signed-off-by: Junio C Hamano --- git-svnimport.perl | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) (limited to 'git-svnimport.perl') diff --git a/git-svnimport.perl b/git-svnimport.perl index ed628974d..988514e29 100755 --- a/git-svnimport.perl +++ b/git-svnimport.perl @@ -31,7 +31,7 @@ $SIG{'PIPE'}="IGNORE"; $ENV{'TZ'}="UTC"; 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_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D,$opt_S); + $opt_b,$opt_r,$opt_I,$opt_A,$opt_s,$opt_l,$opt_d,$opt_D,$opt_S,$opt_F); sub usage() { print STDERR <\s*\n/) { + if ($opt_F && $message =~ /From:\s+(.*?)\s+<(.*)>\s*\n/) { ($author_name, $author_email) = ($1, $2); + print "Author from From: $1 <$2>\n" if ($opt_v);; + } elsif ($opt_S && $message =~ /Signed-off-by:\s+(.*?)\s+<(.*)>\s*\n/) { + ($author_name, $author_email) = ($1, $2); + print "Author from Signed-off-by: $1 <$2>\n" if ($opt_v);; } else { $author_name = $committer_name; $author_email = $committer_email; -- cgit v1.2.1