Commits

Satish Balay committed 7a2b0e1 Merge

Merge branch 'balay/scripts-use-git-detached-head'

Comments (0)

Files changed (3)

bin/maint/builddist

 
 # Clean and Update the git repository and check for branch
 cd $PETSC_DIR
-git checkout -f $branch
+git clean -q -f -d -x
+git fetch -q origin
+git checkout -f origin/$branch
 if [ "$?" != "0" ]; then
   echo 'Error: branch: $branch does not exist in $PETSC_DIR'
   exit
 fi
-git clean -q -f -d -x
-git pull -q
 
 pdir=`basename $PETSC_DIR`
 

bin/maint/buildtest

 rm -f build.log
 echo "Build on $MACH $ARCH $nPETSC_DIR `date` " > build.log
 
+# Note: we are using detatched heads - so 'git fetch/pull' is not done here.
 # Note use 'git clean' intead of manually deleting seleted old files.
-# This also requires 'clean' extension enabled on all nightly build machines.
-
-echo "Cleaning throughly and updating git clone at $nPETSC_DIR" >>& build.log
-(git reset --hard; git clean -q -f -d -x -e build.log;git pull -q) >>& build.log
-echo "Currently building git branch:" `git describe --contains --all HEAD` >>& build.log
+echo "Cleaning throughly at $nPETSC_DIR" >>& build.log
+(git reset --hard; git clean -q -f -d -x -e build.log) >>& build.log
 # if externalpackage tarball also packs a git repo - one has to explicitly remove it
 rm -rf ./externalpackages
+echo "Currently building git branch:" `git describe --contains --all HEAD` >>& build.log
+git log -1 >>& build.log
 
 setenv PETSC_DIR $nPETSC_DIR
 set PETSC_ARCH=${ARCH}

bin/maint/startnightly

       endif
     endif
     echo "Cleaning and updating clone at $USR@$MACH $LOC"
-    $SSH $USR@$MACH $DASHN "cd $LOC ; git checkout -f ${BRANCH}; git pull -q "
+    $SSH $USR@$MACH $DASHN "cd $LOC ; git fetch -q origin; git checkout -f origin/${BRANCH} "
   else
     rsync -e ssh -az --delete  $pdir/ ${USR}@${MACH}:${LOC}
   endif