Uploaded image for project: 'Jenkins'
  1. Jenkins
  2. JENKINS-57260

git blame fails for out-of-tree builds

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Fixed
    • Icon: Minor Minor
    • warnings-ng-plugin
    • None
    • 7.0.0

      My pipeline checks out the source code in a separate folder by settings the option 

      skipDefaultCheckout()
      

      and then manually checking out the source into ${ws}/src in the first step via

      stage('Prepare') {
        steps {
          dir('src') {
            checkout scm
          }
        }
      }
      

      Doxygen is then later build in ${ws}/build/doxygen using

      stage('Doxygen') {
        steps {
          dir('build/doxygen') {
            bat '@ninja doxygen' // outputs log into doxygen/doxygen.log
          }
          recordIssues(aggregatingResults: true, enabledForFailure: true, tools: [ doxygen(name: 'Doxygen', pattern: 'build/doxygen/doxygen/doxygen.log') ] )
        }
      }
      

      Warnings the counted correctly but git blame fails with

      [2019-04-27T12:26:27.192Z] [Doxygen] Successfully parsed file C:\workspace\workspace\doxygen0aa3610e\build\doxygen\doxygen\doxygen.log
      [2019-04-27T12:26:27.192Z] [Doxygen] -> found 39 issues (skipped 0 duplicates)
      [2019-04-27T12:26:27.573Z] [Doxygen] [-ERROR-] Can't determine head commit using 'git rev-parse'. Skipping blame.
      [2019-04-27T12:26:27.573Z] [Doxygen] [-ERROR-] hudson.plugins.git.GitException: Command "git rev-parse "HEAD^{commit}"" returned status code 128:
      [2019-04-27T12:26:27.573Z] stdout:
      [2019-04-27T12:26:27.573Z] stderr: fatal: not a git repository (or any of the parent directories): .git
      

      I also reported this in gitter on 27.4 and was asked to create this bug report here.

            drulli Ulli Hafner
            twam Tobias Müller
            Votes:
            3 Vote for this issue
            Watchers:
            5 Start watching this issue

              Created:
              Updated:
              Resolved: