This is an automated email from the ASF dual-hosted git repository.

aw pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/yetus.git


The following commit(s) were added to refs/heads/master by this push:
     new 2923027  YETUS-793. patch analysis shouldn't require dry-run
2923027 is described below

commit 2923027750d8dbc42cf8576cd871146f391a99ec
Author: Allen Wittenauer <a...@apache.org>
AuthorDate: Tue Feb 12 08:23:37 2019 -0800

    YETUS-793. patch analysis shouldn't require dry-run
    
    Signed-off-by: Allen Wittenauer <a...@apache.org>
---
 precommit/src/main/shell/smart-apply-patch.sh | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/precommit/src/main/shell/smart-apply-patch.sh 
b/precommit/src/main/shell/smart-apply-patch.sh
index 8997ae4..049294e 100755
--- a/precommit/src/main/shell/smart-apply-patch.sh
+++ b/precommit/src/main/shell/smart-apply-patch.sh
@@ -101,6 +101,7 @@ function cleanup_and_exit
 function setup_defaults
 {
   common_defaults
+  REPORTONLY=false
 }
 
 ## @description  Print the usage information
@@ -148,6 +149,7 @@ function yetus_usage
 
   echo ""
   echo "Patch reporting:"
+  yetus_add_option "--report-only" "Do not try to apply at all; just report on 
the patch"
   yetus_add_option "--build-tool=<tool>" "Override the build tool"
   yetus_add_option "--changedfilesreport=<name>" "List of files that this 
patch modifies"
   yetus_add_option "--changedmodulesreport=<name>" "List of modules that this 
patch modifies"
@@ -211,6 +213,9 @@ function parse_args
       --changedunionreport=*)
         UNIONREPORT=${i#*=}
       ;;
+      --report-only)
+        REPORTONLY=true
+      ;;
       --*)
         ## PATCH_OR_ISSUE can't be a --.  So this is probably
         ## a plugin thing.
@@ -246,8 +251,6 @@ function patch_reports
     return
   fi
 
-  set -x
-
   find_changed_files
 
   if [[ -n "${FILEREPORT}" ]]; then
@@ -401,6 +404,11 @@ plugins_initialize
 
 locate_patch
 
+if [[ "${REPORTONLY}" = true ]]; then
+  patch_reports
+  cleanup_and_exit 0
+fi
+
 if [[ ${COMMITMODE} = true ]]; then
   status=$("${GIT}" status --porcelain)
   if [[ "$status" != "" ]] ; then

Reply via email to