# New Ticket Created by  Matt Kraai 
# Please include the string:  [perl #52022]
# in the subject line of all future correspondence about this issue. 
# <URL: http://rt.perl.org/rt3/Ticket/Display.html?id=52022 >


Howdy,

I'm using git-svn and have made some local commits.  When I run

 perl Configure.pl

it displays the following warnings:

 Generating C headers...value for 'revision' in config/gen/config_h/config_h.in 
is undef at lib/Parrot/Configure/Compiler.pm line 393, <$in> line 19.
 ...
 Recording configuration data for later retrieval...value for 'revision' in 
config/gen/config_pm/myconfig.in is undef at lib/Parrot/Configure/Compiler.pm 
line 393, <$in> line 1.

If I run make, compilers/imcc/main.c fails to compile with the
following error messages:

 compilers/imcc/main.c: In function ‘Parrot_version’:
 compilers/imcc/main.c:243: error: expected expression before ‘)’ token
 compilers/imcc/main.c:245: error: expected expression before ‘!=’ token
 compilers/imcc/main.c:249: error: expected expression before ‘!=’ token

because it contains

         printf(" (r%d)", PARROT_REVISION);

and PARROT_REVISION is defined as follows:

 #define PARROT_REVISION         

Parrot::Revision runs "git log -1" and tries to use the git-svn-id:
line to determine the revision, but "git log -1" shows a commit I
made, not the most recent commit in Subversion.

The attached patch fixes this problem by passing "--grep=^git-svn-id:"
to "git log", which should prevent it from showing local commits.

I verified that this works with both my repository and does not hang
when using a repository cloned from git://repo.or.cz/parrot.git.

-- 
Matt
>From 6aa865bd27bade795bb99301d5f80121a3ada7f2 Mon Sep 17 00:00:00 2001
From: Matt Kraai <[EMAIL PROTECTED]>
Date: Sat, 22 Mar 2008 20:14:35 -0700
Subject: [PATCH] Pass "--grep=^git-svn-id:" to "git log" in Parrot::Revision

This prevents it from trying to determine the non-existent revision a
local commit.
---
 lib/Parrot/Revision.pm |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/lib/Parrot/Revision.pm b/lib/Parrot/Revision.pm
index fd240e3..aa0772b 100644
--- a/lib/Parrot/Revision.pm
+++ b/lib/Parrot/Revision.pm
@@ -59,7 +59,7 @@ sub _analyze_sandbox {
             ($revision) = $line =~ /(\d+)/;
         }
     }
-    elsif ( -d '.git' && (my @git_info = qx/git log -1 2>$nul/ and $? == 0) ) {
+    elsif ( -d '.git' && (my @git_info = qx/git log -1 --grep=^git-svn-id: 2>$nul/ and $? == 0) ) {
         ($revision) =
             $git_info[-1] =~ m[git-svn-id: https://svn.perl.org/parrot/trunk@(\d+) ];
     }
-- 
1.5.4.4

Reply via email to