Skip to content

Commit

Permalink
git-svn: fix signed commit parsing
Browse files Browse the repository at this point in the history
When parsing a commit object, git-svn wrongly think that a line
containing spaces means the end of headers and the start of the commit
message. In case of signed commit, the gpgsig entry contains a line with
one space, so "git svn dcommit" will include part of the signature in
the commit message.

An example of such problem :
http://svnweb.mageia.org/treasurer?view=revision&revision=86

This commit changes the regex to only match an empty line as separator
between the headers and the commit message.

Signed-off-by: Nicolas Vigier <boklm@mars-attacks.org>
Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Eric Wong <normalperson@yhbt.net>
  • Loading branch information
Nicolas Vigier authored and Eric Wong committed Oct 10, 2013
1 parent 128a96c commit 60786bd
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion git-svn.perl
Original file line number Diff line number Diff line change
Expand Up @@ -1759,7 +1759,7 @@ sub get_commit_entry {
my $msgbuf = "";
while (<$msg_fh>) {
if (!$in_msg) {
$in_msg = 1 if (/^\s*$/);
$in_msg = 1 if (/^$/);
$author = $1 if (/^author (.*>)/);
} elsif (/^git-svn-id: /) {
# skip this for now, we regenerate the
Expand Down

0 comments on commit 60786bd

Please sign in to comment.