Index: Jenkinsfile
===================================================================
--- Jenkinsfile	(revision 155c2a280be50b543b9cd8cce62b291b620fc754)
+++ Jenkinsfile	(revision 5afeab965a86326017fdbba6b23c8c6cb1c9a42d)
@@ -6,5 +6,4 @@
 node ('master'){
 
-	boolean bIsSandbox = env.BRANCH_NAME == "jenkins-sandbox"
 	def err = null
 	def log_needed = false
@@ -26,5 +25,5 @@
 			notify_server(0)
 
-			final settings = prepare_build()
+			final Settings = prepare_build()
 
 			clean()
@@ -63,5 +62,5 @@
 	finally {
 		//Send email with final results if this is not a full build
-		if( !params.Silent ) {
+		if( !Settings.Silent ) {
 			echo 'Notifying users of result'
 			email(currentBuild.result, log_needed, bIsSandbox)
@@ -80,32 +79,53 @@
 // Helper classes/variables/routines
 //===========================================================================================================
-//Helper routine to collect information about the git history
-def collect_git_info() {
-
-	final scmVars = checkout scm
-	echo "----------------------------------------"
-	echo "${scmVars.getClass()}"
-	echo "scmVars: ${scmVars}"
-
-	//create the temporary output directory in case it doesn't already exist
-	def out_dir = pwd tmp: true
-	sh "mkdir -p ${out_dir}"
-
-	//parse git logs to find what changed
-	gitRefName = env.BRANCH_NAME
-	sh "git reflog > ${out_dir}/GIT_COMMIT"
-	git_reflog = readFile("${out_dir}/GIT_COMMIT")
-	gitRefOldValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][1]
-	gitRefNewValue = (git_reflog =~ /moving from (.+) to (.+)/)[0][2]
-}
-
 class BuildSettings implements Serializable {
-	BuildSettings() {
+	public final CC_Desc Compiler
+	public final Arch_Desc Architecture
+	public final Boolean RunAllTests
+	public final Boolean RunBenchmark
+	public final Boolean BuildDocumentation
+	public final Boolean Publish
+	public final Boolean Silent
+	public final Boolean IsSandbox
+	public final String Branch
+	public final String Commit
+	public final String PrevCommit
+	public final String RepoUrl
+	public final String DescLong
+	public final String DescShort
+
+	BuildSettings(java.util.Collections$UnmodifiableMap param, java.util.TreeMap scmVars) {
+		echo "${env}"
+
+		this.Compiler	      = compiler_from_params( params.Compiler )
+		this.Architecture       = architecture_from_params( params.Architecture )
+		this.RunAllTests        = params.RunAllTests
+		this.RunBenchmark       = params.RunBenchmark
+		this.BuildDocumentation = params.BuildDocumentation
+		this.Publish            = params.Publish
+		this.Silent             = params.Silent
+		this.IsSandbox          = scmVars.GIT_BRANCH == "jenkins-sandbox"
+		this.Branch             = scmVars.GIT_BRANCH
+		this.Commit             = scmVars.GIT_COMMIT
+		this.PrevCommit         = scmVars.GIT_PREVIOUS_COMMIT
+		this.RepoUrl            = scmVars.GIT_URL
+
+		def full = params.RunAllTests ? " (Full)" : ""
+		this.DescShort = "${ this.Compiler.cc_name }:${ this.Architecture.name }${full}"
+
+		this.DescLong """Compiler 	         : ${ this.Compiler.cc_name } (${ this.Compiler.cpp_cc }/${ this.Compiler.cfa_cc })
+Architecture            : ${ this.Architecture.name }
+Arc Flags               : ${ this.Architecture.flags }
+Run All Tests           : ${ this.RunAllTests.toString() }
+Run Benchmark           : ${ this.RunBenchmark.toString() }
+Build Documentation     : ${ this.BuildDocumentation.toString() }
+Publish                 : ${ this.Publish.toString() }
+Silent                  : ${ this.Silent.toString() }
+"""
 	}
 }
 
 def prepare_build() {
-	collect_git_info()
-
+	// prepare the properties
 	properties ([ 													\
 		[$class: 'ParametersDefinitionProperty', 								\
@@ -151,21 +171,13 @@
 		]])
 
-	echo "${params.getClass()}"
-
-	compiler	 = compiler_from_params( params.Compiler )
-	crchitecture = architecture_from_params( params.Architecture )
-
-	def full = params.RunAllTests ? " (Full)" : ""
-	currentBuild.description = "${ compiler.cc_name }:${ architecture.name }${full}"
-
-	echo """Compiler 	         : ${ params.Compiler.cc_name } (${ compiler.cpp_cc }/${ compiler.cfa_cc })
-Architecture            : ${ architecture.name }
-Arc Flags               : ${ architecture.flags }
-Run All Tests           : ${ params.RunAllTests.toString() }
-Run Benchmark           : ${ params.RunBenchmark.toString() }
-Build Documentation     : ${ params.BuildDocumentation.toString() }
-Publish                 : ${ params.Publish.toString() }
-Silent                  : ${ params.Silent.toString() }
-"""
+	// Collect git information
+	final scmVars = checkout scm
+
+	final settings = new BuildSettings(params, scmVars)
+
+	currentBuild.description = settings.DescShort
+	echo                       settings.DescLong
+
+	return settings
 }
 
@@ -285,5 +297,5 @@
 			//Also specify the compiler by hand
 			targets=""
-			if( params.RunAllTests ) {
+			if( Settings.RunAllTests ) {
 				targets="--with-target-hosts='host:debug,host:nodebug'"
 			} else {
@@ -291,5 +303,5 @@
 			}
 
-			sh "${srcdir}/configure CXX=${params.Compiler.cpp_cc} ${params.Architecture.flags} ${targets} --with-backend-compiler=${params.Compiler.cfa_cc} --quiet"
+			sh "${srcdir}/configure CXX=${Settings.Compiler.cpp_cc} ${Settings.Architecture.flags} ${targets} --with-backend-compiler=${Settings.Compiler.cfa_cc} --quiet"
 
 			//Compile the project
@@ -304,5 +316,5 @@
 		dir (builddir) {
 			//Run the tests from the tests directory
-			if ( params.RunAllTests ) {
+			if ( Settings.RunAllTests ) {
 				sh 'make --no-print-directory -C tests all-tests debug=yes'
 				sh 'make --no-print-directory -C tests all-tests debug=no '
@@ -318,9 +330,9 @@
 	build_stage('Benchmark') {
 
-		if( !params.RunBenchmark ) return
+		if( !Settings.RunBenchmark ) return
 
 		dir (builddir) {
 			//Append bench results
-			sh "make --no-print-directory -C benchmark jenkins githash=${gitRefNewValue} arch=${params.Architecture} | tee ${srcdir}/bench.json"
+			sh "make --no-print-directory -C benchmark jenkins githash=${gitRefNewValue} arch=${Settings.Architecture} | tee ${srcdir}/bench.json"
 		}
 	}
@@ -330,5 +342,5 @@
 	build_stage('Documentation') {
 
-		if( !params.BuildDocumentation ) return
+		if( !Settings.BuildDocumentation ) return
 
 		dir ('doc/user') {
@@ -345,5 +357,5 @@
 	build_stage('Publish') {
 
-		if( !params.Publish ) return
+		if( !Settings.Publish ) return
 
 		//Then publish the results
@@ -386,10 +398,10 @@
 
 	try {
-		gitUpdate = gitBranchUpdate(gitRefOldValue, gitRefNewValue)
-
-		sh "git rev-list --format=short ${gitRefOldValue}...${gitRefNewValue} > GIT_LOG"
+		gitUpdate = gitBranchUpdate(Settings.PrevCommit, Settings.Commit)
+
+		sh "git rev-list --format=short ${Settings.PrevCommit}...${Settings.Commit} > GIT_LOG"
 		gitLog = readFile('GIT_LOG')
 
-		sh "git diff --stat ${gitRefNewValue} ${gitRefOldValue} > GIT_DIFF"
+		sh "git diff --stat ${Settings.Commit} ${Settings.PrevCommit} > GIT_DIFF"
 		gitDiff = readFile('GIT_DIFF')
 	}
