Skip to contentSkip to conversation

git-svn: fix processing of decorated commit hashes

PATCH In review Mathias Lafeldt 2 participants 2 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-svn: fix processing of decorated commit hashes

The function working_head_info() fails to parse commit hashes if they are decorated (i.e. log.decorate is true), causing dcommit, rebase, and other vital git-svn commands to malfunction.

This patch disables decorated log output with --no-decorate.

---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-svn.perl +1 -1
index 9b046b6..90e1236 100755
@@ -1513,7 +1513,7 @@ sub cmt_sha2rev_batch {
 
 sub working_head_info {
 	my ($head, $refs) = @_;
-	my @args = ('log', '--no-color', '--first-parent', '--pretty=medium');
+	my @args = qw/log --no-color --no-decorate --first-parent --pretty=medium/;
 	my ($fh, $ctx) = command_output_pipe(@args, $head);
 	my $hash;
 	my %max;
Signature · 1 line
1.7.3
Acked-by on v1 1/1
#1 lore raw
Quoted 7 lines · Mathias Lafeldt

The function working_head_info() fails to parse commit hashes if they are decorated (i.e. log.decorate is true), causing dcommit, rebase, and other vital git-svn commands to malfunction.

This patch disables decorated log output with --no-decorate.

Thanks Mathias,

I wrapped the long line to 80 chars but otherwise everything is good.

Quoted 19 lines
---
 git-svn.perl |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
git-svn.perl +1 -1
index 9b046b6..90e1236 100755
@@ -1513,7 +1513,7 @@ sub cmt_sha2rev_batch {
 
 sub working_head_info {
 	my ($head, $refs) = @_;
-	my @args = ('log', '--no-color', '--first-parent', '--pretty=medium');
+	my @args = qw/log --no-color --no-decorate --first-parent --pretty=medium/;
 	my ($fh, $ctx) = command_output_pipe(@args, $head);
 	my $hash;
 	my %max;
Signature · 1 line
1.7.3