diff options
author | Junio C Hamano <gitster@pobox.com> | 2008-05-25 13:37:25 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-05-25 13:37:25 -0700 |
commit | 834836bd3f1c817f93ee69a29c904d3333e635f0 (patch) | |
tree | 4dbae0f8d93bfe5add63c90db43dc0cbd941b6a2 /git-svn.perl | |
parent | 6c99f18660f62f90b83f0592c81ab6a4092d6d13 (diff) | |
parent | 27554e900dd0e2b91b578f2e01c38b3eba746a77 (diff) | |
download | git-834836bd3f1c817f93ee69a29c904d3333e635f0.tar.gz git-834836bd3f1c817f93ee69a29c904d3333e635f0.tar.xz |
Merge branch 'ap/svn'
* ap/svn:
git-svn: add test for --add-author-from and --use-log-author
git-svn: add documentation for --add-author-from option.
git-svn: Add --add-author-from option.
git-svn: add documentation for --use-log-author option.
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-x | git-svn.perl | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/git-svn.perl b/git-svn.perl index 2c53f39ae..0e61897b9 100755 --- a/git-svn.perl +++ b/git-svn.perl @@ -83,6 +83,7 @@ my %fc_opts = ( 'follow-parent|follow!' => \$Git::SVN::_follow_parent, 'repack-flags|repack-args|repack-opts=s' => \$Git::SVN::_repack_flags, 'use-log-author' => \$Git::SVN::_use_log_author, + 'add-author-from' => \$Git::SVN::_add_author_from, %remote_opts ); my ($_trunk, $_tags, $_branches, $_stdlayout); @@ -1012,17 +1013,28 @@ sub get_commit_entry { my ($msg_fh, $ctx) = command_output_pipe('cat-file', $type, $treeish); my $in_msg = 0; + my $author; + my $saw_from = 0; while (<$msg_fh>) { if (!$in_msg) { $in_msg = 1 if (/^\s*$/); + $author = $1 if (/^author (.*>)/); } elsif (/^git-svn-id: /) { # skip this for now, we regenerate the # correct one on re-fetch anyways # TODO: set *:merge properties or like... } else { + if (/^From:/ || /^Signed-off-by:/) { + $saw_from = 1; + } print $log_fh $_ or croak $!; } } + if ($Git::SVN::_add_author_from && defined($author) + && !$saw_from) { + print $log_fh "\nFrom: $author\n" + or croak $!; + } command_close_pipe($msg_fh, $ctx); } close $log_fh or croak $!; @@ -1249,7 +1261,7 @@ use constant rev_map_fmt => 'NH40'; use vars qw/$default_repo_id $default_ref_id $_no_metadata $_follow_parent $_repack $_repack_flags $_use_svm_props $_head $_use_svnsync_props $no_reuse_existing $_minimize_url - $_use_log_author/; + $_use_log_author $_add_author_from/; use Carp qw/croak/; use File::Path qw/mkpath/; use File::Copy qw/copy/; |