merging in changes for auto-tagging and git releng repo
diff --git a/org.eclipse.e4.builder/builder/general/build.properties b/org.eclipse.e4.builder/builder/general/build.properties
index 49ecc2c..955d1a5 100644
--- a/org.eclipse.e4.builder/builder/general/build.properties
+++ b/org.eclipse.e4.builder/builder/general/build.properties
@@ -199,12 +199,12 @@
 
 #skipMaps=true
 #mapsRepo=pwebster@dev.eclipse.org:/cvsroot/eclipse
-mapsRepo=:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
-mapsRoot=e4/releng
-mapsCheckoutTag=R4_1_maintenance
+#mapsRepo=:pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse
+#mapsRoot=e4/releng
+#mapsCheckoutTag=HEAD
 
 #tagMaps=true
-mapsTagTag=v${buildId}
+#mapsTagTag=v${buildId}
 
 
 ############ REPOSITORY CONTROL ###############
diff --git a/org.eclipse.e4.builder/builder/general/customTargets.xml b/org.eclipse.e4.builder/builder/general/customTargets.xml
index c198c01..71c898c 100644
--- a/org.eclipse.e4.builder/builder/general/customTargets.xml
+++ b/org.eclipse.e4.builder/builder/general/customTargets.xml
@@ -32,9 +32,10 @@
 	<!-- Replace values for mapsCheckoutTag as desired. -->
 	<!-- ===================================================================== -->
 	<target name="getMapFiles" depends="checkLocalMaps" unless="skipMaps">
-		<property name="mapsCheckoutTag" value="HEAD" />
-		<cvs cvsRoot="${mapsRepo}" package="${mapsRoot}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" />
-		<antcall target="tagMapFiles" />
+		<mkdir dir="${buildDirectory}/maps" />
+		<copy todir="${buildDirectory}/maps">
+			<fileset dir="${builder}/../../.." />
+		</copy>
 	</target>
 
 	<target name="checkLocalMaps">
@@ -42,7 +43,7 @@
 	</target>
 
 	<target name="tagMapFiles" if="tagMaps">
-		<cvs dest="${buildDirectory}/maps/${mapsRoot}" command="tag ${mapsTagTag}" />
+		<!--cvs dest="${buildDirectory}/maps/${mapsRoot}" command="tag ${mapsTagTag}" /-->
 	</target>
 
 	<!-- ===================================================================== -->
diff --git a/org.eclipse.e4.builder/scripts/bootstrap.sh b/org.eclipse.e4.builder/scripts/bootstrap.sh
index 7cb9f62..dbecfe7 100644
--- a/org.eclipse.e4.builder/scripts/bootstrap.sh
+++ b/org.eclipse.e4.builder/scripts/bootstrap.sh
@@ -3,27 +3,29 @@
 
 writableBuildRoot=/shared/eclipse/e4
 supportDir=$writableBuildRoot/build/e4
-relengBranch=HEAD
+GIT_CLONES=$supportDir/gitClones
+relengBranch=master
+
 while [ $# -gt 0 ]
 do
-	case "$1" in		
-		"-branch")
-			relengBranch="$2"; shift;;
-		 *) break;;	 # terminate while loop
-	esac
-	shift
-done	
+        case "$1" in
+                "-branch")
+                        relengBranch="$2"; shift;;
+                 *) break;;      # terminate while loop
+        esac
+        shift
+done
 
-cd $supportDir
-cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse update \
-  -d org.eclipse.e4.builder_$relengBranch
-cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse update \
-  -d org.eclipse.e4.sdk_$relengBranch
-cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse update \
-  -d org.eclipse.releng.eclipsebuilder
 
-cp org.eclipse.e4.builder_$relengBranch/scripts/masterBuild.sh $writableBuildRoot
+cd $GIT_CLONES/org.eclipse.e4.releng
+git checkout $relengBranch
+git pull
+
+
+cp $GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/masterBuild.sh \
+  $GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder/scripts/git-release.sh \
+  $writableBuildRoot
 
 cd $writableBuildRoot
-/bin/bash -l $writableBuildRoot/masterBuild.sh >$writableBuildRoot/logs/current.log 2>&1
+/bin/bash -l $writableBuildRoot/masterBuild.sh -branch $relengBranch >$writableBuildRoot/logs/current.log 2>&1
 
diff --git a/org.eclipse.e4.builder/scripts/git-map.sh b/org.eclipse.e4.builder/scripts/git-map.sh
index 2e31d65..1382bc3 100644
--- a/org.eclipse.e4.builder/scripts/git-map.sh
+++ b/org.eclipse.e4.builder/scripts/git-map.sh
@@ -1,55 +1,121 @@
-#!/bin/bash
-#
-# example usage from within the local org.eclipse.e4.deeplink repo
-# USAGE: git-map.sh v20101018-1500 \
-#   ../releng/org.eclipse.e4.deeplink.releng/maps/deeplink.map \
-#   bundles
+#!/bin/bash 
 #
 #
+# example usage - you must have your repos checked out on the branch you
+# expect to tag.
+#
+# USAGE: repoRoot relengRoot repoURL [repoURL]*
+#    repoRoot   - absolute path to a folder containing cloned git repositories
+#    relengRoot - asolute path to releng project containing map files
+#    repoURL    - git repository urls to tag, must match entries in the map files
+# EXAMPLE: git-map.sh  \
+#   /opt/pwebster/git/eclipse \
+#   /opt/pwebster/workspaces/gitMigration/org.eclipse.releng \
+#   git://git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git \
+#   git://git.eclipse.org/gitroot/platform/eclipse.platform.ui.git >maps.txt
+# examine the file
+# grep -v ^OK maps.txt >run.txt
+# /bin/bash run.txt
+#
 
-BUG=/tmp/bugnumbers.txt
-CHPROJ=/tmp/changed_projects.txt
+PLATFORM=$( uname -s )
 
-BUILD_TAG=$1 ; shift
-MAPFILE=$1 ; shift
-BASEDIR=$1; shift
+get_repo_tag () {
+	REPO=$1
+	REPO_DIR=$( basename $REPO .git )
+	cd $ROOT/$REPO_DIR
+	REPO_COMMIT=$( git rev-list -1 HEAD  )
+	NEW_DATE=$( git log -1 --format="%ct" "$REPO_COMMIT" )
+	if [ "$PLATFORM" == "Darwin" ]; then
+		echo v$( date -u -j -f "%s" "$NEW_DATE" "+%Y%m%d-%H%M" )
+	else
+		echo v$( date -u --date="@$NEW_DATE"  "+%Y%m%d-%H%M" )
+	fi
+}
 
-PROJECTS=$( ls $BASEDIR )
+tag_repo_commit () {
+	REPO=$1
+	REPO_DIR=$( basename $REPO .git )
+	NEW_TAG=$( get_repo_tag $REPO )
+	cd $ROOT/$REPO_DIR
+	REPO_COMMIT=$( git rev-list -1 HEAD  )
+	if ! ( git log -1  --format="%d" "$REPO_COMMIT" | grep "[ (]$NEW_TAG[,)]" >/dev/null); then
+		OLD_TAG=$( git log --pretty=oneline --decorate | grep "[ (][vI][0-9]" \
+			| head -1 | sed 's/^[^(]* (.*\([vI][0-9][0-9][0-9][0-9]\)/\1/g'   | sed 's/[,)].*$//g' ) 
+		SUBMISSION_ARGS="$SUBMISSION_ARGS $REPO $OLD_TAG $NEW_TAG"
+		echo "#OK Executed: cd $ROOT/$REPO_DIR \; git tag \"$NEW_TAG\" \"$REPO_COMMIT\""
+		cd $ROOT/$REPO_DIR ; git tag "$NEW_TAG" "$REPO_COMMIT"
+	fi
+}
+
+update_map () {
+	#echo update_map "$@"
+	REPO=$1
+	REPO_DIR=$( basename $REPO .git )
+	MAP=$2
+	cd $ROOT/$REPO_DIR
+	grep "repo=${REPO}," "$MAP" >/tmp/maplines_$$.txt
+	if [ ! -s /tmp/maplines_$$.txt ]; then
+		return
+	fi
+	while read LINE; do
+		LINE_START=$( echo $LINE | sed 's/^\([^=]*\)=.*$/\1/g' )
+		PROJ_PATH=$( echo $LINE | sed 's/^.*path=//g' )
+		CURRENT_TAG=$( echo $LINE | sed 's/.*tag=\([^,]*\),.*$/\1/g' )
+		LAST_COMMIT=$( git rev-list -1 HEAD -- "$PROJ_PATH" )
+        if [ -z "$LAST_COMMIT" ]; then
+            echo "#SKIPPING $LINE_START, no commits for $PROJ_PATH"
+            continue
+        fi
+		
+		if ! ( git tag --contains $LAST_COMMIT | grep $CURRENT_TAG >/dev/null ); then
+			NEW_DATE=$( git log -1 --format="%ct" "$LAST_COMMIT" )		
+			if [ "$PLATFORM" == "Darwin" ]; then
+				NEW_TAG=v$( date -u -j -f "%s" "$NEW_DATE" "+%Y%m%d-%H%M" )
+			else
+				NEW_TAG=v$( date -u --date="@$NEW_DATE"  "+%Y%m%d-%H%M" )
+			fi
+			
+			if ! ( git log -1  --format="%d" "$LAST_COMMIT" | grep "[ (]$NEW_TAG[,)]" >/dev/null); then
+				echo "#OK Executed: cd $ROOT/$REPO_DIR \; git tag \"$NEW_TAG\" \"$LAST_COMMIT\""
+				cd $ROOT/$REPO_DIR ; git tag "$NEW_TAG" "$LAST_COMMIT"
+			fi
+			echo sed "'s/$LINE_START=GIT,tag=$CURRENT_TAG/$LINE_START=GIT,tag=$NEW_TAG/g'" $MAP \>/tmp/t1_$$.txt \; mv /tmp/t1_$$.txt $MAP
+		else
+			echo OK $LINE_START $CURRENT_TAG 
+		fi
+	done </tmp/maplines_$$.txt
+	rm -f /tmp/maplines_$$.txt
+	echo \( cd $ROOT/$REPO_DIR \; git push --tags \)
+}
+
+
+STATUS=OK
+STATUS_MSG=""
 LATEST_SUBMISSION=""
+SUBMISSION_ARGS=""
 
-for proj in $PROJECTS; do
-    echo Processing $proj
-    PROJ_LINE=$( grep "@${proj}=" ${MAPFILE} )
-    projId=$proj
-    
-    if [ -z "$PROJ_LINE" ]; then
-    	PROJ_LINE=$( grep "path=${BASEDIR}/${proj}" ${MAPFILE} )
-    	projId=$( echo $PROJ_LINE | sed -e 's:^\(plugin\|feature\|fragment\|bundle\)@\([-._A-Za-z0-9]*\)=.*$:\2:' )
-    fi
-    
-    if [ ! -z "$PROJ_LINE" ]; then
-	LAST_COMMIT=$( git rev-list HEAD -- $BASEDIR/$proj | head -1 )
-	LAST_SUBMISSION=$( echo $PROJ_LINE | sed -e 's/^.*tag=//' | sed -e 's/,.*$//')
-	if [ "$LATEST_SUBMISSION" \< "$LAST_SUBMISSION" ]; then
-	    LATEST_SUBMISSION=$LAST_SUBMISSION
-	fi
-	
-	LAST_COMMIT_DATE=$( git log --pretty=format:"%H %ad" --date=iso | grep $LAST_COMMIT | sed -e 's:[a-f0-9]* \(.*\)$:\1:' )
-	echo Last commit was at $LAST_COMMIT_DATE
-	echo Map file entry is $LAST_SUBMISSION
-	
-	if ! ( git tag --contains $LAST_COMMIT | grep $LAST_SUBMISSION >/dev/null ); then
-	    echo Needs to move from $LAST_SUBMISSION to $BUILD_TAG
-	    echo ${proj} >>$CHPROJ
-	    sed "s/@${projId}=GIT,tag=$LAST_SUBMISSION/@${projId}=GIT,tag=$BUILD_TAG/g" $MAPFILE >/tmp/t1.txt
-	    mv /tmp/t1.txt $MAPFILE
-	fi
-    fi
+if [ $# -lt 3 ]; then
+  echo "USAGE: $0 repoRoot relengRoot repoURL [repoURL]*"
+  exit 1
+fi
 
-    echo ""
+
+ROOT=$1; shift
+RELENG=$1; shift
+REPOS="$@"
+
+
+
+for REPO in $REPOS; do
+	cd $ROOT
+	tag_repo_commit $REPO
+	MAPS=$( find $RELENG -name "*.map" -exec grep -l "repo=${REPO}," {} \; )
+	if [ ! -z "$MAPS" ]; then
+		for MAP in $MAPS; do
+			update_map $REPO $MAP
+		done
+	fi
 done
 
-git log  ${LATEST_SUBMISSION}..${BUILD_TAG} "$BASEDIR" \
- | grep '[Bb]ug '  \
- | sed 's/.*[Bb]ug[^0-9]*\([0-9][0-9][0-9][0-9][0-9]*\)[^0-9].*$/\1/g' >>$BUG
-
+echo "/bin/bash git-submission.sh $ROOT $SUBMISSION_ARGS > report.txt"
diff --git a/org.eclipse.e4.builder/scripts/git-release.sh b/org.eclipse.e4.builder/scripts/git-release.sh
new file mode 100644
index 0000000..00aaf01
--- /dev/null
+++ b/org.eclipse.e4.builder/scripts/git-release.sh
@@ -0,0 +1,129 @@
+#!/bin/bash
+
+#*******************************************************************************
+# Copyright (c) 2011 IBM Corporation and others.
+# All rights reserved. This program and the accompanying materials
+# are made available under the terms of the Eclipse Public License v1.0
+# which accompanies this distribution, and is available at
+# http://www.eclipse.org/legal/epl-v10.html
+#
+# Contributors:
+#     IBM Corporation - initial API and implementation
+#*******************************************************************************
+
+#default values, overridden by command line
+user=pwebster
+email=pwebster@ca.ibm.com
+name="E4 Build"
+writableBuildRoot=/shared/eclipse/e4
+supportDir=$writableBuildRoot/build/e4
+GIT_CLONES=$supportDir/gitClones
+buildType=I
+date=$(date +%Y%m%d)
+time=$(date +%H%M)
+timestamp=$date$time
+relengBranch=master
+
+while [ $# -gt 0 ]
+do
+        case "$1" in
+                "-branch")
+                        relengBranch="$2"; shift;;
+
+                "-I")
+                        buildType=I;
+                        tagMaps="-DtagMaps=true";
+                        compareMaps="-DcompareMaps=true";;
+                "-N")
+                        buildType=N;
+                        tagMaps="";
+                        compareMaps="";
+                        fetchTag="-DfetchTag=CVS=HEAD,GIT=origin/master";;
+
+                "-root")
+                        writableBuildRoot="$2"; shift;;
+
+                "-timestamp")
+                        timestamp="$2";
+                        date=${timestamp:0:8}
+                        time=${timestamp:8};
+                        shift;;
+
+                "-noTag")
+                        noTag=true;;
+
+                -*)
+                        echo >&2 usage: $0 [-I | -N]
+                        exit 1;;
+                 *) break;;      # terminate while loop
+        esac
+        shift
+done
+
+#Pull or clone a branch from a repository
+#Usage: pull repositoryURL  branch
+pull() {
+        pushd $GIT_CLONES
+        directory=$(basename $1 .git)
+        if [ ! -d $directory ]; then
+                echo git clone $1
+                git clone $1
+                cd $directory
+                git config --add user.email "$email"
+                git config --add user.name "$name"
+        fi
+        popd
+        pushd $GIT_CLONES/$directory
+        echo git checkout $2
+        git checkout $2
+        echo git pull
+        git pull
+        popd
+}
+#Nothing to do for nightly builds, or if $noTag is specified
+if [ "$buildType" == "N" -o "$noTag" ]; then
+        echo Skipping build tagging for nightly build or -noTag build
+        exit
+fi
+
+pushd $writableBuildRoot
+relengRepo=$GIT_CLONES/org.eclipse.e4.releng
+#pull the releng project to get the list of repositories to tag
+pull "ssh://$user@git.eclipse.org/gitroot/e4/org.eclipse.e4.releng.git" $relengBranch
+
+cp $relengRepo/org.eclipse.e4.builder/scripts/git-map.sh .
+chmod 744 git-map.sh
+cp $relengRepo/org.eclipse.e4.builder/scripts/git-submission.sh .
+chmod 744 git-submission.sh
+
+
+#remove comments
+rm -f repos-clean.txt clones.txt
+cat "$relengRepo/tagging/repositories.txt" | grep -v "^#" > repos-clean.txt
+#clone or pull each repository and checkout the appropriate branch
+while read line; do
+        #each line is of the form <repository> <branch>
+        set -- $line
+        pull $1 $2
+        echo $1 | sed 's/ssh:.*@git.eclipse.org/git:\/\/git.eclipse.org/g' >> clones.txt
+done < repos-clean.txt
+
+cat clones.txt| xargs /bin/bash git-map.sh $GIT_CLONES \
+        $relengRepo > maps.txt
+
+#Trim out lines that don't require execution
+grep -v ^OK maps.txt | grep -v ^Executed >run.txt
+/bin/bash run.txt
+
+mkdir $writableBuildRoot/$buildType$timestamp
+cp report.txt $writableBuildRoot/$buildType$timestamp
+
+cd $relengRepo
+git add $( find . -name "*.map" )
+git commit -m "Releng build tagging for $buildType$timestamp"
+git tag -f $buildType$timestamp   #tag the map file change
+
+git push
+git push --tags
+
+popd
diff --git a/org.eclipse.e4.builder/scripts/git-submission.sh b/org.eclipse.e4.builder/scripts/git-submission.sh
index c9676b2..ceef8c3 100644
--- a/org.eclipse.e4.builder/scripts/git-submission.sh
+++ b/org.eclipse.e4.builder/scripts/git-submission.sh
@@ -2,59 +2,42 @@
 #
 # When the map file has been updated, this can be used to generate
 # the releng build submission report
-# USAGE: git-submission.sh >report.txt
+# USAGE: git-submission.sh repoRoot repoURL last_tag build_tag [repoURL...] >report.txt
 #
 
-BUG=/tmp/bugnumbers.txt
-CHPROJ=/tmp/changed_projects.txt
 
-SFX=_$( date "+%Y%m%d%H%M%S" ).txt
-BUGREJ=/tmp/bugrej$SFX
-BUGT1=/tmp/bug1$SFX
+ROOT=$1; shift
+rm -f /tmp/proj_changed_$$.txt /tmp/bug_list_$$.txt
 
+while [ $# -gt 0 ]; do
+	REPO="$1"; shift
+	REPO_DIR=$( basename $REPO .git )
+	LAST_TAG="$1"; shift
+	BUILD_TAG="$1"; shift
+	cd $ROOT/$REPO_DIR
+	git diff --name-only ${LAST_TAG} ${BUILD_TAG} | cut -f2 -d/ | sort -u >>/tmp/proj_changed_$$.txt
+	 
+	
+	git log --first-parent ${LAST_TAG}..${BUILD_TAG} \
+		| grep '[Bb]ug[^0-9]*[0-9][0-9][0-9][0-9][0-9]*[^0-9]'  \
+		| sed 's/.*[Bb]ug[^0-9]*\([0-9][0-9][0-9][0-9][0-9]*\)[^0-9].*$/\1/g' >>/tmp/bug_list_$$.txt
+done
 
-if [ ! -r $BUG ]; then
-    echo No bug numbers to process 1>&2
-    exit 0
-fi
+rm -f /tmp/bug_info_$$.txt
 
-grep '[^0-9 ]' $BUG >$BUGREJ
-if [ -s $BUGREJ ]; then
-    echo Unprocessed lines:  1>&2
-    cat $BUGREJ  1>&2
-fi
-
-grep -v '[^0-9 ]' $BUG | grep '[0-9]' | sort -nu  >$BUGT1
-
-if [ ! -s $BUGT1 ]; then
-    echo Nothing to process  1>&2
-    exit 0
-fi
-
-echo The map file has been updated for the following Bug changes:
-
-while read LINE; do
-    echo Working on $LINE 1>&2
-    BUGT2=/tmp/buginfo_${LINE}.txt
-    
-    # commented out so we can pick up the real status
-    #if [ ! -s $BUGT2 ]; then
-    curl -k https://bugs.eclipse.org/bugs/show_bug.cgi?id=${LINE}\&ctype=xml >$BUGT2 2>/dev/null
-    #fi
-    
-    TITLE=$( grep short_desc $BUGT2 | sed 's/^.*<short_desc.//g' | sed 's/<\/short_desc.*$//g' )
+for BUG in $( cat /tmp/bug_list_$$.txt | sort -n -u ); do
+	BUGT2=/tmp/buginfo_${BUG}_$$.txt
+	curl -k https://bugs.eclipse.org/bugs/show_bug.cgi?id=${BUG}\&ctype=xml >$BUGT2 2>/dev/null
+	TITLE=$( grep short_desc $BUGT2 | sed 's/^.*<short_desc.//g' | sed 's/<\/short_desc.*$//g' )
     STATUS=$( grep bug_status $BUGT2 | sed 's/^.*<bug_status.//g' | sed 's/<\/bug_status.*$//g' )
     if [ RESOLVED = "$STATUS" -o VERIFIED = "$STATUS" ]; then
         STATUS=$( grep '<resolution>' $BUGT2 | sed 's/^.*<resolution.//g' | sed 's/<\/resolution.*$//g' )
     fi
-    echo + Bug $LINE - $TITLE \(${STATUS}\)
-done <$BUGT1
+    echo + Bug $BUG - $TITLE \(${STATUS}\) >>/tmp/bug_info_$$.txt
+done
 
+echo The build contains the following changes:
+cat /tmp/bug_info_$$.txt
 echo ""
-
-if [ -s $CHPROJ ]; then
-    echo The following projects have changed:
-    cat $CHPROJ
-fi
-
-rm -f $BUG $CHPROJ
+echo The following projects have changed:
+cat /tmp/proj_changed_$$.txt | sort -u
\ No newline at end of file
diff --git a/org.eclipse.e4.builder/scripts/masterBuild.sh b/org.eclipse.e4.builder/scripts/masterBuild.sh
index 1548230..3b7ecc4 100755
--- a/org.eclipse.e4.builder/scripts/masterBuild.sh
+++ b/org.eclipse.e4.builder/scripts/masterBuild.sh
@@ -1,9 +1,17 @@
 #!/bin/bash +x
 
-publishingUser=pwebster
-quietCVS=-Q
+#default values, overridden by command line
+user=pwebster
+email=pwebster@ca.ibm.com
+name="E4 Build"
 writableBuildRoot=/shared/eclipse/e4
-projRelengBranch="R4_1_maintenance"; # default set below
+supportDir=$writableBuildRoot/build/e4
+GIT_CLONES=$supportDir/gitClones
+
+quietCVS=-Q
+publishingUser=pwebster
+writableBuildRoot=/shared/eclipse/e4
+relengBranch="master"; # default set below
 arch="x86_64"
 archProp="-x86_64"
 processor=$( uname -p )
@@ -13,18 +21,29 @@
     arch="ppc"
 fi
 
+
+while [ $# -gt 0 ]
+do
+        case "$1" in
+                "-branch")
+                        relengBranch="$2"; shift;;
+                 *) break;;      # terminate while loop
+        esac
+        shift
+done
+
+
+
 #
 # Real Build on build.eclipse.org
 #
 realBuildProperties () {
 	supportDir=$writableBuildRoot/build/e4
-	builderDir=${supportDir}/org.eclipse.e4.builder
+	GIT_CLONES=$supportDir/gitClones
+	builderDir=${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder
     builddate=$( date +%Y%m%d )
     buildtime=$( date +%H%M )
 
-#tag maps
-    projRoot='pwebster@dev.eclipse.org:/cvsroot/eclipse'
-    tagMaps=-tagMaps
 
 #publish
     publishIndex="$publishingUser@build.eclipse.org:/home/data/httpd/download.eclipse.org/e4/downloads"
@@ -44,7 +63,9 @@
 #
 testBuildProperties () {
 	supportDir=$writableBuildRoot/build/e4
-	builderDir=${supportDir}/org.eclipse.e4.builder
+	GIT_CLONES=$supportDir/gitClones
+	builderDir=${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder
+	noTag=true
 
 #	builderDir=/opt/pwebster/workspaces/e4/releng/org.eclipse.e4.builder
 #builddate=20090624
@@ -107,55 +128,37 @@
 
 updateE4Builder () {
     cd $supportDir
-    if [[ ! -d org.eclipse.e4.builder_${projRelengBranch} ]]; then
-        echo "[start] [`date +%H\:%M\:%S`] get org.eclipse.e4.builder_${projRelengBranch}"
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r $projRelengBranch -d org.eclipse.e4.builder_${projRelengBranch} e4/releng/org.eclipse.e4.builder"
-        echo $cmd
-        $cmd
-    else
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -d org.eclipse.e4.builder_${projRelengBranch} "
-        echo $cmd
-        $cmd
-    fi
 
-    echo "[start] [`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_${projRelengBranch}"
+    echo "[start] [`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_${relengBranch}"
     rm org.eclipse.e4.builder
-    ln -s ${supportDir}/org.eclipse.e4.builder_${projRelengBranch} org.eclipse.e4.builder
+    ln -s ${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.builder org.eclipse.e4.builder
 
 }
 
 updateSDKBuilder () {
     cd $supportDir
-    echo "[start] [`date +%H\:%M\:%S`] get org.eclipse.e4.sdk_${projRelengBranch}"
-    if [[ ! -d org.eclipse.e4.sdk_${projRelengBranch} ]]; then
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r $projRelengBranch -d org.eclipse.e4.sdk_${projRelengBranch} e4/releng/org.eclipse.e4.sdk"
-        echo $cmd
-        $cmd
-    else
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -C -d org.eclipse.e4.sdk_${projRelengBranch} "
-        echo $cmd
-        $cmd
-    fi
     
+    echo "[start] [`date +%H\:%M\:%S`] setting org.eclipse.e4.sdk_${relengBranch}"
     rm org.eclipse.e4.sdk 
-    ln -s ${supportDir}/org.eclipse.e4.sdk_${projRelengBranch} org.eclipse.e4.sdk  
+    ln -s ${GIT_CLONES}/org.eclipse.e4.releng/org.eclipse.e4.sdk org.eclipse.e4.sdk  
 }
 
 updateEclipseBuilder() {
+	cd $supportDir
 	echo "[`date +%H\:%M\:%S`] get org.eclipse.releng.eclipsebuilder"
-    if [[ ! -d org.eclipse.releng.eclipsebuilder_R4_1_maintenance ]]; then
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r R4_1_maintenance -d org.eclipse.releng.eclipsebuilder_R4_1_maintenance org.eclipse.releng.eclipsebuilder"
+    if [[ ! -d org.eclipse.releng.eclipsebuilder_R4_HEAD ]]; then
+        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS co -r R4_HEAD -d org.eclipse.releng.eclipsebuilder_R4_HEAD org.eclipse.releng.eclipsebuilder"
         echo $cmd
         $cmd
     else
-        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -C -d org.eclipse.releng.eclipsebuilder_R4_1_maintenance "
+        cmd="cvs -d :pserver:anonymous@dev.eclipse.org:/cvsroot/eclipse $quietCVS update -C -d org.eclipse.releng.eclipsebuilder_R4_HEAD "
         echo $cmd
         $cmd
     fi
     
-    echo "[`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_R4_1_maintenance"
+    echo "[`date +%H\:%M\:%S`] setting org.eclipse.e4.builder_R4_HEAD"
     rm org.eclipse.releng.eclipsebuilder
-    ln -s ${supportDir}/org.eclipse.releng.eclipsebuilder_R4_1_maintenance org.eclipse.releng.eclipsebuilder
+    ln -s ${supportDir}/org.eclipse.releng.eclipsebuilder_R4_HEAD org.eclipse.releng.eclipsebuilder
 }
 
 runSDKBuild () {
@@ -171,8 +174,8 @@
       -cp $cpAndMain \
       -application org.eclipse.ant.core.antRunner  \
       -buildfile $buildfile \
-	  -Dbuilder=$supportDir/org.eclipse.e4.sdk/builder \
-	  -Dorg.eclipse.e4.builder=$supportDir/org.eclipse.e4.builder \
+	  -Dbuilder=$GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.sdk/builder \
+	  -Dorg.eclipse.e4.builder=$GIT_CLONES/org.eclipse.e4.releng/org.eclipse.e4.builder \
 	  -Declipse.build.configs=$supportDir/org.eclipse.releng.eclipsebuilder/eclipse/buildConfigs \
 	  -DbuildType=M \
 	  -Dbuilddate=$builddate \
@@ -451,7 +454,11 @@
     zip -r ../I$buildTimestamp/org.eclipse.swt.e4.flex-incubation-I$buildTimestamp.zip org.eclipse.swt org.eclipse.swt.e4.jcl
 }
 
-
+tagRepo () {
+	pushd $writableBuildRoot
+	/bin/bash git-release.sh -branch $relengBranch -timestamp $builddate$buildtime
+	popd
+}
 
 realBuildProperties
 #testBuildProperties
@@ -462,6 +469,8 @@
 updateE4Builder
 updateEclipseBuilder
 
+tagRepo
+
 cd ${builderDir}/scripts
 
 
diff --git a/org.eclipse.e4.sdk/builder/build.properties b/org.eclipse.e4.sdk/builder/build.properties
index 873f3a5..18b7077 100644
--- a/org.eclipse.e4.sdk/builder/build.properties
+++ b/org.eclipse.e4.sdk/builder/build.properties
@@ -190,13 +190,13 @@
 # This section defines CVS tags to use when fetching the map files from the repository.
 # If you want to fetch the map file from repository / location, change the getMapFiles target in the customTargets.xml
 
-mapsRepo=:pserver:anonymous@dev.eclipse.org/cvsroot/eclipse
-mapsRoot_sdk=e4/releng/org.eclipse.e4.sdk/maps
-mapsRoot_e4=e4/releng/org.eclipse.e4.ui.releng/maps
-mapsCheckoutTag=R4_1_maintenance
+#mapsRepo=:pserver:anonymous@dev.eclipse.org/cvsroot/eclipse
+#mapsRoot_sdk=e4/releng/org.eclipse.e4.sdk/maps
+#mapsRoot_e4=e4/releng/org.eclipse.e4.ui.releng/maps
+#mapsCheckoutTag=HEAD
 
 #tagMaps=true
-mapsTagTag=v${buildId}
+#mapsTagTag=v${buildId}
 
 
 ############ REPOSITORY CONTROL ###############
diff --git a/org.eclipse.e4.sdk/builder/customTargets.xml b/org.eclipse.e4.sdk/builder/customTargets.xml
index ab28ad6..8a54894 100644
--- a/org.eclipse.e4.sdk/builder/customTargets.xml
+++ b/org.eclipse.e4.sdk/builder/customTargets.xml
@@ -18,9 +18,11 @@
 	<!-- Replace values for mapsCheckoutTag as desired. -->
 	<!-- ===================================================================== -->
 	<target name="getMapFiles" depends="checkLocalMaps,initLocations" unless="skipMaps">
-		<property name="mapsCheckoutTag" value="HEAD" />
-		<cvs cvsRoot="${mapsRepo}" package="${mapsRoot_sdk}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" />
-		<cvs cvsRoot="${mapsRepo}" package="${mapsRoot_e4}" dest="${buildDirectory}/maps" tag="${mapsCheckoutTag}" />
+		<mkdir dir="${buildDirectory}/maps" />
+		<copy todir="${buildDirectory}/maps">
+			<fileset dir="${builder}/../maps" />
+			<fileset dir="${builder}/../../org.eclipse.e4.ui.releng/maps" />
+		</copy>
 		<replace dir="${buildDirectory}/maps/" value="${eclipseRepoURL-latest}" token="ECLIPSE_PLATFORM_REPO" />
 	</target>
 
@@ -29,8 +31,8 @@
 	</target>
 
 	<target name="tagMapFiles" if="tagMaps">
-		<cvs dest="${buildDirectory}/maps/${mapsRoot_sdk}" command="tag ${mapsTagTag}" />
-		<cvs dest="${buildDirectory}/maps/${mapsRoot_e4}" command="tag ${mapsTagTag}" />
+		<!--cvs dest="${buildDirectory}/maps/${mapsRoot_sdk}" command="tag ${mapsTagTag}" />
+		<cvs dest="${buildDirectory}/maps/${mapsRoot_e4}" command="tag ${mapsTagTag}" /-->
 	</target>
 
 	<!-- ===================================================================== -->
diff --git a/tagging/repositories.txt b/tagging/repositories.txt
new file mode 100644
index 0000000..62269a0
--- /dev/null
+++ b/tagging/repositories.txt
@@ -0,0 +1,6 @@
+#repositories to be tagged, and corresponding branch name
+#format is <repository URL> <branch name>
+ssh://pwebster@git.eclipse.org/gitroot/platform/eclipse.platform.ui.git R4_1_maintenance
+ssh://pwebster@git.eclipse.org/gitroot/platform/eclipse.platform.runtime.git R4_1_maintenance
+ssh://pwebster@git.eclipse.org/gitroot/e4/org.eclipse.e4.tools.git R4_1_maintenance
+ssh://pwebster@git.eclipse.org/gitroot/e4/org.eclipse.e4.ui.git R4_1_maintenance