yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject yetus git commit: YETUS-485. Fixing test-patch to handle rebase/force push on branch.
Date Mon, 26 Jun 2017 20:56:54 GMT
Repository: yetus
Updated Branches:
  refs/heads/master 7fc6b1e4d -> 405cd9fa6


YETUS-485. Fixing test-patch to handle rebase/force push on branch.

Signed-off-by: Allen Wittenauer <aw@apache.org>


Project: http://git-wip-us.apache.org/repos/asf/yetus/repo
Commit: http://git-wip-us.apache.org/repos/asf/yetus/commit/405cd9fa
Tree: http://git-wip-us.apache.org/repos/asf/yetus/tree/405cd9fa
Diff: http://git-wip-us.apache.org/repos/asf/yetus/diff/405cd9fa

Branch: refs/heads/master
Commit: 405cd9fa6e4f6240690bbba1bad6d054a4241214
Parents: 7fc6b1e
Author: Subru Krishnan <subru@apache.org>
Authored: Tue Apr 11 18:48:26 2017 -0700
Committer: Allen Wittenauer <aw@apache.org>
Committed: Mon Jun 26 13:56:42 2017 -0700

----------------------------------------------------------------------
 .../source/documentation/in-progress/precommit-basic.md        | 6 +++++-
 precommit/test-patch.sh                                        | 6 ++++--
 2 files changed, 9 insertions(+), 3 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/yetus/blob/405cd9fa/asf-site-src/source/documentation/in-progress/precommit-basic.md
----------------------------------------------------------------------
diff --git a/asf-site-src/source/documentation/in-progress/precommit-basic.md b/asf-site-src/source/documentation/in-progress/precommit-basic.md
index 40efe8d..ef71513 100644
--- a/asf-site-src/source/documentation/in-progress/precommit-basic.md
+++ b/asf-site-src/source/documentation/in-progress/precommit-basic.md
@@ -172,7 +172,11 @@ For example:
 $ test-patch.sh --robot --patch-dir=${WORKSPACE}/patchprocess --basedir=${WORKSPACE}/source
${WORKSPACE}/patchfile
 ```
 
-... will trigger test-patch to run in fully automated mode, using ${WORKSPACE}/patchprocess
as its scratch space, ${WORKSPACE}/source as the source repository, and ${WORKSPACE}/patchfile
as the name of the patch to test against.  This will always run the unit tests, write answers
back to bug systems, remove old, stopped/exited Docker containers after 24 hours and images
after 1 week, forcibly use --resetrepo, and more.  The --build-url option is also useful when
running in --robot mode so that emails and such
+... will trigger test-patch to run in fully automated mode, using ${WORKSPACE}/patchprocess
as its scratch space, ${WORKSPACE}/source as the source repository, and ${WORKSPACE}/patchfile
as the name of the patch to test against.  This will always run the unit tests, write answers
back to bug systems, remove old, stopped/exited Docker containers after 24 hours and images
after 1 week, forcibly use --resetrepo, and more.
+
+**NOTE: Make sure to add the patch directory to `.gitignore` if the directory is inside the
source tree to avoid deleting it, as `test-patch` does a `git clean` to remove untracked files
from previous runs.**
+
+The --build-url option is also useful when running in --robot mode so that emails and such
 have a location to look at the output artifacts:
 
 ```bash

http://git-wip-us.apache.org/repos/asf/yetus/blob/405cd9fa/precommit/test-patch.sh
----------------------------------------------------------------------
diff --git a/precommit/test-patch.sh b/precommit/test-patch.sh
index 0ca3d91..a632f5f 100755
--- a/precommit/test-patch.sh
+++ b/precommit/test-patch.sh
@@ -1299,9 +1299,11 @@ function git_checkout
     fi
 
     # if we've selected a feature branch that has new changes
-    # since our last build, we'll need to rebase to see those changes.
+    # since our last build, we'll need to reset to the latest FETCH_HEAD.
     if [[ ${OFFLINE} == false ]]; then
-      ${GIT} pull --rebase
+      ${GIT} fetch
+      ${GIT} reset --hard FETCH_HEAD
+      ${GIT} clean -df
       if [[ $? != 0 ]]; then
         yetus_error "ERROR: git pull is failing"
         cleanup_and_exit 1


Mime
View raw message