Changeset fce01e7 for Jenkinsfile


Ignore:
Timestamp:
Sep 9, 2019, 5:33:39 PM (5 years ago)
Author:
Thierry Delisle <tdelisle@…>
Branches:
ADT, arm-eh, ast-experimental, enum, forall-pointer-decay, jacob/cs343-translation, jenkins-sandbox, master, new-ast, new-ast-unique-expr, pthread-emulation, qualifiedEnum
Children:
249091f
Parents:
dea0b69
Message:

Removing need for PrettyGitLog?

File:
1 edited

Legend:

Unmodified
Added
Removed
  • Jenkinsfile

    rdea0b69 rfce01e7  
    227227        if (!Settings || !Settings.GitOldRef || !Settings.GitNewRef) return "\nERROR retrieveing git information!\n"
    228228
    229         sh "${SrcDir}/tools/PrettyGitLogs.sh ${SrcDir} ${BuildDir} ${Settings.GitOldRef} ${Settings.GitNewRef}"
    230 
    231         def result = sh(returnStdout: true, script: "git rev-list ${Settings.GitOldRef}..${Settings.GitNewRef}")
    232         echo result
    233 
    234         def gitUpdate = readFile("${BuildDir}/GIT_UPDATE")
    235         def gitLog    = sh(returnStdout: true, script: "git rev-list --format=short ${Settings.GitOldRef}...${Settings.GitNewRef}")
    236         def gitDiff   = readFile("${BuildDir}/GIT_DIFF")
     229        def oldRef = Settings.GitOldRef
     230        def newRef = Settings.GitNewRef
     231
     232        def revisions = sh(returnStdout: true, script: "git rev-list ${Settings.GitOldRef}..${Settings.GitNewRef}")
     233        def gitUpdate = ""
     234
     235        revisions.eachLine {
     236                def rev = it
     237                def type = sh(returnStdout: true, script: "git cat-file -t ${rev}")
     238                gitUpdate = gitUpdate + "       via  ${rev} (${type})"
     239        }
     240
     241        def rev = oldRef
     242        def type = sh(returnStdout: true, script: "git cat-file -t ${rev}")
     243        gitUpdate = gitUpdate + "       via  ${rev} (${type})"
     244
     245        def gitLog    = sh(returnStdout: true, script: "git rev-list --format=short ${oldRef}...${newRef}")
     246
     247        def gitDiff   = sh(returnStdout: true, script: "git diff --stat --color ${newRef} ${oldRef}")
     248        gitDiff = gitDiff.replace('[32m', '<span style="color: #00AA00;">')
     249        gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')
     250        gitDiff = gitDiff.replace('[m', '</span>')
    237251
    238252        return """
Note: See TracChangeset for help on using the changeset viewer.