git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] git-svn: un-break "git svn rebase" when log.abbrevCommit=true

From
Ævar Arnfjörð Bjarmason <avarab@gmail.com>
Date
Jan 29, 2012, 02:11 UTC
Message-ID
<1327803073-7000-1-git-send-email-avarab@gmail.com>

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
Next: Jonathan Nieder
Message 1 of 9 in “git-svn: un-break "git svn rebase" when log.abbrevCommit=true”
  1. git-svn: un-break "git svn rebase" when log.abbrevCommit=trueÆvar Arnfjörð Bjarmason, Jan 29, 2012
  2. Jonathan NiederJan 29, 2012
  3. Ævar Arnfjörð BjarmasonJan 29, 2012
  4. Dan JohnsonJan 30, 2012
  5. Ævar Arnfjörð BjarmasonJan 30, 2012
  6. 1/2 git-svn: remove redundant porcelain option to rev-listÆvar Arnfjörð Bjarmason, Feb 12, 2012
  7. 2/2 git-svn: un-break "git svn rebase" when log.abbrevCommit=trueÆvar Arnfjörð Bjarmason, Feb 12, 2012
  8. Jonathan NiederFeb 12, 2012
  9. Eric WongFeb 12, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.