git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] git-svn: un-break "git svn rebase" when log.abbrevCommit=true
@ 2012-01-29  2:11 Ævar Arnfjörð Bjarmason
  2012-01-29  2:59 ` Jonathan Nieder
  2012-01-30 20:41 ` Dan Johnson
  0 siblings, 2 replies; 9+ messages in thread
From: Ævar Arnfjörð Bjarmason @ 2012-01-29  2:11 UTC (permalink / raw)
  To: git; +Cc: Eric Wong, Ævar Arnfjörð Bjarmason

Change git-svn to parse --no-abbrev-commit --no-decorate to git-log
since it's trying to parse the log output, and the parsing will fail
completely if log.abbrevCommit is set to true in the configuration,
also set --no-decorate so we won't fail if we're processing a commit
that has a tag pointing to it.

Without this patch the code will fail to parse a SHA1, and then just
spew a bunch of "Use of uninitialized value $hash in string eq"
warnings at "if ($c && $c eq $hash) { ..." and never do anything
useful.

A real fix would be to make git-svn not use any porcelain utilities,
but just work around it for now.

Signed-off-by: Ævar Arnfjörð Bjarmason <avarab@gmail.com>
---
 git-svn.perl |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/git-svn.perl b/git-svn.perl
index eeb83d3..570fe9c 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -1879,7 +1879,8 @@ sub cmt_sha2rev_batch {
 sub working_head_info {
 	my ($head, $refs) = @_;
 	my @args = qw/log --no-color --no-decorate --first-parent
-	              --pretty=medium/;
+	              --pretty=medium --no-abbrev-commit --no-decorate/;
+
 	my ($fh, $ctx) = command_output_pipe(@args, $head);
 	my $hash;
 	my %max;
-- 
1.7.8.3

^ permalink raw reply related	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2012-02-12  6:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2012-01-29  2:11 [PATCH] git-svn: un-break "git svn rebase" when log.abbrevCommit=true Ævar Arnfjörð Bjarmason
2012-01-29  2:59 ` Jonathan Nieder
2012-01-29  3:12   ` Ævar Arnfjörð Bjarmason
2012-01-30 20:41 ` Dan Johnson
2012-01-30 21:18   ` Ævar Arnfjörð Bjarmason
2012-02-12  0:23     ` [PATCH v2 1/2] git-svn: remove redundant porcelain option to rev-list Ævar Arnfjörð Bjarmason
2012-02-12  0:23       ` [PATCH v2 2/2] git-svn: un-break "git svn rebase" when log.abbrevCommit=true Ævar Arnfjörð Bjarmason
2012-02-12  0:31         ` Jonathan Nieder
2012-02-12  6:49       ` [PATCH v2 1/2] git-svn: remove redundant porcelain option to rev-list Eric Wong

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).