[PATCH] git-svn: fix signed commit parsing

Subsystems: the rest

STALE3737d

3 messages, 3 authors, 2016-06-15 · open the first message on its own page

[PATCH] git-svn: fix signed commit parsing

From: Nicolas Vigier <hidden>
Date: 2016-06-15 22:58:56

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 <redacted>
---
 git-svn.perl | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/git-svn.perl b/git-svn.perl
index ff1ce3d..1823db1 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -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
-- 
1.8.4

Re: [PATCH] git-svn: fix signed commit parsing

From: Jonathan Nieder <hidden>
Date: 2016-06-15 22:58:56

Nicolas Vigier wrote:
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 <redacted>
Good catch.  For what it's worth,
Reviewed-by: Jonathan Nieder <redacted>

Re: [PATCH] git-svn: fix signed commit parsing

From: Eric Wong <hidden>
Date: 2016-06-15 22:58:58

Jonathan Nieder [off-list ref] wrote:
Nicolas Vigier wrote:
quoted
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 <redacted>
Good catch.  For what it's worth,
Reviewed-by: Jonathan Nieder <redacted>
Thanks both.  I've signed-off, added Jonathan's reviewed-by and
queued this up in my master.  Currently at:

The following changes since commit 128a96c98442524c7f2eeef4757b1e48445f24ce:

  Update draft release notes to 1.8.5 for the fifth batch of topics (2013-09-20 12:42:02 -0700)

are available in the git repository at:

  git://git.bogomips.org/git-svn.git master

for you to fetch changes up to 945b9c14ffd3e11c916ee2b2428a0b2be9645829:

  git-svn.txt: elaborate on rev_map files (2013-10-10 06:56:12 +0000)

----------------------------------------------------------------
Keshav Kini (4):
      git-svn.txt: fix AsciiDoc formatting error
      git-svn.txt: reword description of gc command
      git-svn.txt: replace .git with $GIT_DIR
      git-svn.txt: elaborate on rev_map files

Nicolas Vigier (1):
      git-svn: fix signed commit parsing

 Documentation/git-svn.txt | 46 +++++++++++++++++++++++++++++++++-------------
 git-svn.perl              |  2 +-
 2 files changed, 34 insertions(+), 14 deletions(-)
-- 
Eric Wong
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help