yetus-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From a.@apache.org
Subject [yetus] branch master updated: YETUS-793. patch analysis shouldn't require dry-run
Date Fri, 15 Feb 2019 19:33:26 GMT
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 <aw@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 <aw@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


Mime
View raw message