Index: Jenkins/Distribute
===================================================================
--- Jenkins/Distribute	(revision c3d3c229d22ff53e5478072beb36a6885089adde)
+++ Jenkins/Distribute	(revision d29a39495bf6a6c63083ef54b55dbecee31a1377)
@@ -26,5 +26,5 @@
 		wrap([$class: 'TimestamperBuildWrapper']) {
 
-			gitref = prepare_build()
+			final commit = prepare_build()
 
 			node('x64') {
@@ -34,5 +34,5 @@
 				Tools.clean()
 
-				Tools.checkout(gitref)
+				Tools.checkout( commit )
 			}
 
Index: Jenkins/tools.groovy
===================================================================
--- Jenkins/tools.groovy	(revision c3d3c229d22ff53e5478072beb36a6885089adde)
+++ Jenkins/tools.groovy	(revision d29a39495bf6a6c63083ef54b55dbecee31a1377)
@@ -1,4 +1,5 @@
 #!groovy
 
+import groovy.transform.Field
 
 // For skipping stages
@@ -32,3 +33,73 @@
 }
 
+def checkout(commitHash = null) {
+	BuildStage('Checkout', true) {
+		//checkout the source code and clean the repo
+		final scmVars = ref ? checkout scm : checkout([$class: 'GitSCM', branches: [[name: commitHash ]]])
+
+		echo GitLogMessage(scmVars.GIT_COMMIT, scmVars.GIT_PREVIOUS_COMMIT)
+	}
+}
+
+//===========================================================================================================
+//Routine responsible of sending the email notification once the build is completed
+//===========================================================================================================
+@NonCPS
+def SplitLines(String text) {
+	def list = []
+
+	text.eachLine {
+		list += it
+	}
+
+	return list
+}
+
+def GitLogMessage(String oldRef, String newRef) {
+	def revText = sh(returnStdout: true, script: "git rev-list ${oldRef}..${newRef}").trim()
+	def revList = SplitLines( revText )
+
+	def gitUpdate = ""
+	revList.each { rev ->
+		def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim()
+		gitUpdate = gitUpdate + "       via  ${rev} (${type})"
+	}
+
+	def rev = oldRef
+	def type = sh(returnStdout: true, script: "git cat-file -t ${rev}").trim()
+	gitUpdate = gitUpdate + "      from  ${rev} (${type})"
+
+	def gitLog    = sh(returnStdout: true, script: "git rev-list --format=short ${oldRef}...${newRef}").trim()
+
+	def gitDiff   = sh(returnStdout: true, script: "git diff --stat --color ${newRef} ${oldRef}").trim()
+	gitDiff = gitDiff.replace('[32m', '<span style="color: #00AA00;">')
+	gitDiff = gitDiff.replace('[31m', '<span style="color: #AA0000;">')
+	gitDiff = gitDiff.replace('[m', '</span>')
+
+	return """
+<pre>
+The branch ${env.BRANCH_NAME} has been updated.
+${gitUpdate}
+</pre>
+
+<p>Check console output at ${env.BUILD_URL} to view the results.</p>
+
+<p>- Status --------------------------------------------------------------</p>
+
+<p>BUILD# ${env.BUILD_NUMBER} - ${currentBuild.result}</p>
+
+<p>- Log -----------------------------------------------------------------</p>
+
+<pre>
+${gitLog}
+</pre>
+
+<p>-----------------------------------------------------------------------</p>
+<pre>
+Summary of changes:
+${gitDiff}
+</pre>
+"""
+}
+
 return this;
