[LLVMbugs] [Bug 13205] New: cmake does not correctly check "git svn log" output [PATCH INCLUDED]

bugzilla-daemon at llvm.org bugzilla-daemon at llvm.org
Mon Jun 25 08:20:57 PDT 2012


http://llvm.org/bugs/show_bug.cgi?id=13205

             Bug #: 13205
           Summary: cmake does not correctly check "git svn log" output
                    [PATCH INCLUDED]
           Product: Build scripts
           Version: trunk
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P
         Component: cmake
        AssignedTo: unassignedbugs at nondot.org
        ReportedBy: hammacher at cs.uni-saarland.de
                CC: llvmbugs at cs.uiuc.edu
    Classification: Unclassified


Created attachment 8761
  --> http://llvm.org/bugs/attachment.cgi?id=8761
add a check to the VersionFromVCS cmake module: git_output should not be empty

Cmake, precisely the "VersionFromVCS" module, calls "git svn log --limit=1
--oneline" and tries to extract the latest svn revision number. Unfortunately,
"git svn log" also returns 0 (success) if the git repository has no svn
information (is not connected to an SVN). But in this case, the output is
empty, and the regular expression matching fails.
To detect the situation that we are in a git, but no svn information is
available, we should also check the return value of the "git svn log" call. If
it's empty, then don't use it. The patch just adds this check:
-      if( git_result EQUAL 0 )
+      if( git_result EQUAL 0 AND git_output )

Even though not many people will need it, I have exactly that situation,
because I downloaded the sources as an archive, and initialized a local git
repository with it to test different patches on them.

It shouldn't hurt anyone, so please apply the patch.

-- 
Configure bugmail: http://llvm.org/bugs/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are on the CC list for the bug.



More information about the llvm-bugs mailing list