hbase-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sean Busbey (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (HBASE-14776) Rewrite smart-apply-patch.sh to use 'git am' or 'git apply' rather than 'patch'
Date Fri, 06 Nov 2015 04:04:27 GMT

    [ https://issues.apache.org/jira/browse/HBASE-14776?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14993054#comment-14993054
] 

Sean Busbey commented on HBASE-14776:
-------------------------------------

no worries. I checked and it looks like it does.

{code}
 PATCH_FILE=$1
-if [ -z "$PATCH_FILE" ]; then
+if [ -z "$PATCH_FILE" -o ! -f "$PATCH_FILE" ]; then
   echo usage: $0 patch-file
   exit 1
 fi
{code}

won't this break the "pass '-' for stdin" bit?

{code}
-echo Going to apply patch with: $PATCH -p$PLEVEL
-$PATCH -p$PLEVEL -E < $PATCH_FILE
-
+if [ $AM_WORKS -eq 0 ]; then
+  # try git apply
+  git apply $PATCH_FILE
+  status=$?
+  if [ $status -eq 0 ]; then
+    APPLY_WORKS=1
+    echo "Patch applies with git apply. Consider using git format-patch to create patches."
+    # Apply does not commit, just reset
+    git reset -q --hard
+  else
+    echo "Patch does not apply with git apply."
+  fi
+fi
+if [ $AM_WORKS -eq 0 -a $APPLY_WORKS -eq 0 ]; then
+  echo "Could not apply the patch."
+  cleanup 1
+fi
 cleanup $?
{code}

It looks like after this change we don't actually apply the patch?

> Rewrite smart-apply-patch.sh to use 'git am' or 'git apply' rather than 'patch'
> -------------------------------------------------------------------------------
>
>                 Key: HBASE-14776
>                 URL: https://issues.apache.org/jira/browse/HBASE-14776
>             Project: HBase
>          Issue Type: Bug
>          Components: scripts
>    Affects Versions: 2.0.0
>            Reporter: Misty Stanley-Jones
>            Assignee: Misty Stanley-Jones
>             Fix For: 2.0.0
>
>         Attachments: HBASE-14776.patch
>
>
> We require patches to be created using 'git format-patch' or 'git diff', so patches should
be tested using 'git am' or 'git apply', not 'patch -pX'. This causes false errors in the
Jenkins patch tester.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message