Uploaded image for project: 'Hadoop Common'
  1. Hadoop Common
  2. HADOOP-11994

smart-apply-patch wrongly assumes that git is infallible

    Details

    • Hadoop Flags:
      Reviewed

      Description

      Even if git fails, smart-apply-patch should try the normal patch command. I've seen a few patches now where git apply fails, but patch does not.

        Activity

        Hide
        sekikn Kengo Seki added a comment -

        Allen Wittenauer, smart-apply-patch seems to use the normal patch command rather than git apply. And on HADOOP-12014, smart-apply-patch failed but git apply succeeded.
        What you meant is, if patch command fails, then try git apply?

        Show
        sekikn Kengo Seki added a comment - Allen Wittenauer , smart-apply-patch seems to use the normal patch command rather than git apply. And on HADOOP-12014 , smart-apply-patch failed but git apply succeeded. What you meant is, if patch command fails, then try git apply?
        Hide
        aw Allen Wittenauer added a comment -

        It definitely tries git apply first in trunk:

        # Special case for git-diff patches without --no-prefix
        if is_git_diff_with_prefix "$PATCH_FILE"; then
          GIT_FLAGS="--binary -p1 -v"
          if [[ -z $DRY_RUN ]]; then
              GIT_FLAGS="$GIT_FLAGS --stat --apply "
              echo Going to apply git patch with: git apply "${GIT_FLAGS}"
          else
              GIT_FLAGS="$GIT_FLAGS --check "
          fi
          git apply ${GIT_FLAGS} "${PATCH_FILE}"
          exit $?
        fi
        
        # Come up with a list of changed files into $TMP
        TMP="$TMPDIR/smart-apply.paths.$RANDOM"
        TOCLEAN="$TOCLEAN $TMP"
        
        if $PATCH -p0 -E --dry-run < $PATCH_FILE 2>&1 > $TMP; then
        
        Show
        aw Allen Wittenauer added a comment - It definitely tries git apply first in trunk: # Special case for git-diff patches without --no-prefix if is_git_diff_with_prefix "$PATCH_FILE" ; then GIT_FLAGS= "--binary -p1 -v" if [[ -z $DRY_RUN ]]; then GIT_FLAGS= "$GIT_FLAGS --stat --apply " echo Going to apply git patch with: git apply "${GIT_FLAGS}" else GIT_FLAGS= "$GIT_FLAGS --check " fi git apply ${GIT_FLAGS} "${PATCH_FILE}" exit $? fi # Come up with a list of changed files into $TMP TMP= "$TMPDIR/smart-apply.paths.$RANDOM" TOCLEAN= "$TOCLEAN $TMP" if $PATCH -p0 -E --dry-run < $PATCH_FILE 2>&1 > $TMP; then
        Hide
        sekikn Kengo Seki added a comment -

        I misunderstood. Thank you.

        Show
        sekikn Kengo Seki added a comment - I misunderstood. Thank you.
        Hide
        sekikn Kengo Seki added a comment -

        I'd like to take this JIRA. But it will conflict with HADOOP-12018, so I'll deal with this after its merge.
        Currently, cleanup method in smart-apply-patch won't be executed when git apply is invoked. I'll fix it also.

        Show
        sekikn Kengo Seki added a comment - I'd like to take this JIRA. But it will conflict with HADOOP-12018 , so I'll deal with this after its merge. Currently, cleanup method in smart-apply-patch won't be executed when git apply is invoked. I'll fix it also.
        Hide
        sekikn Kengo Seki added a comment -

        Attaching a patch.

        Show
        sekikn Kengo Seki added a comment - Attaching a patch.
        Hide
        hadoopqa Hadoop QA added a comment -

        A patch to the files used for the QA process has been detected.
        Re-executing against the patched versions to perform further tests.
        The console is at https://builds.apache.org/job/PreCommit-HADOOP-Build/6915/console in case of problems.

        Show
        hadoopqa Hadoop QA added a comment - A patch to the files used for the QA process has been detected. Re-executing against the patched versions to perform further tests. The console is at https://builds.apache.org/job/PreCommit-HADOOP-Build/6915/console in case of problems.
        Hide
        hadoopqa Hadoop QA added a comment -



        +1 overall



        Vote Subsystem Runtime Comment
        0 reexec 0m 0s dev-support patch detected.
        0 pre-patch 0m 0s Pre-patch trunk compilation is healthy.
        +1 @author 0m 0s The patch does not contain any @author tags.
        +1 release audit 0m 14s The applied patch does not increase the total number of release audit warnings.
        +1 shellcheck 0m 6s There were no new shellcheck (v0.3.3) issues.
        +1 whitespace 0m 0s The patch has no lines that end in whitespace.
            0m 23s  



        Subsystem Report/Notes
        Patch URL http://issues.apache.org/jira/secure/attachment/12737456/HADOOP-11994.001.patch
        Optional Tests shellcheck
        git revision trunk / b5f0d29
        Java 1.7.0_55
        uname Linux asf909.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux
        Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6915/console

        This message was automatically generated.

        Show
        hadoopqa Hadoop QA added a comment - +1 overall Vote Subsystem Runtime Comment 0 reexec 0m 0s dev-support patch detected. 0 pre-patch 0m 0s Pre-patch trunk compilation is healthy. +1 @author 0m 0s The patch does not contain any @author tags. +1 release audit 0m 14s The applied patch does not increase the total number of release audit warnings. +1 shellcheck 0m 6s There were no new shellcheck (v0.3.3) issues. +1 whitespace 0m 0s The patch has no lines that end in whitespace.     0m 23s   Subsystem Report/Notes Patch URL http://issues.apache.org/jira/secure/attachment/12737456/HADOOP-11994.001.patch Optional Tests shellcheck git revision trunk / b5f0d29 Java 1.7.0_55 uname Linux asf909.gq1.ygridcore.net 3.13.0-36-lowlatency #63-Ubuntu SMP PREEMPT Wed Sep 3 21:56:12 UTC 2014 x86_64 x86_64 x86_64 GNU/Linux Console output https://builds.apache.org/job/PreCommit-HADOOP-Build/6915/console This message was automatically generated.
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        +1, self-test with your patch which (intentionally?) fails with git apply but succeeds with patch. Committing shortly.

        Show
        arpitagarwal Arpit Agarwal added a comment - +1, self-test with your patch which (intentionally?) fails with git apply but succeeds with patch. Committing shortly.
        Hide
        arpitagarwal Arpit Agarwal added a comment -

        Committed for 2.8.0.

        Thanks for the contribution Kengo Seki.

        Show
        arpitagarwal Arpit Agarwal added a comment - Committed for 2.8.0. Thanks for the contribution Kengo Seki .
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-trunk-Commit #7966 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7966/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • dev-support/smart-apply-patch.sh
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-trunk-Commit #7966 (See https://builds.apache.org/job/Hadoop-trunk-Commit/7966/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) hadoop-common-project/hadoop-common/CHANGES.txt dev-support/smart-apply-patch.sh
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #219 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/219/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • dev-support/smart-apply-patch.sh
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Yarn-trunk-Java8 #219 (See https://builds.apache.org/job/Hadoop-Yarn-trunk-Java8/219/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) hadoop-common-project/hadoop-common/CHANGES.txt dev-support/smart-apply-patch.sh
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Yarn-trunk #949 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/949/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • dev-support/smart-apply-patch.sh
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Yarn-trunk #949 (See https://builds.apache.org/job/Hadoop-Yarn-trunk/949/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) hadoop-common-project/hadoop-common/CHANGES.txt dev-support/smart-apply-patch.sh
        Hide
        hudson Hudson added a comment -

        SUCCESS: Integrated in Hadoop-Hdfs-trunk #2147 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2147/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • dev-support/smart-apply-patch.sh
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - SUCCESS: Integrated in Hadoop-Hdfs-trunk #2147 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk/2147/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) dev-support/smart-apply-patch.sh hadoop-common-project/hadoop-common/CHANGES.txt
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #208 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/208/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • dev-support/smart-apply-patch.sh
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Hdfs-trunk-Java8 #208 (See https://builds.apache.org/job/Hadoop-Hdfs-trunk-Java8/208/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) hadoop-common-project/hadoop-common/CHANGES.txt dev-support/smart-apply-patch.sh
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk #2165 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2165/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • hadoop-common-project/hadoop-common/CHANGES.txt
        • dev-support/smart-apply-patch.sh
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk #2165 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk/2165/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) hadoop-common-project/hadoop-common/CHANGES.txt dev-support/smart-apply-patch.sh
        Hide
        hudson Hudson added a comment -

        FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #217 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/217/)
        HADOOP-11994. smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb)

        • dev-support/smart-apply-patch.sh
        • hadoop-common-project/hadoop-common/CHANGES.txt
        Show
        hudson Hudson added a comment - FAILURE: Integrated in Hadoop-Mapreduce-trunk-Java8 #217 (See https://builds.apache.org/job/Hadoop-Mapreduce-trunk-Java8/217/ ) HADOOP-11994 . smart-apply-patch wrongly assumes that git is infallible. (Contributed by Kengo Seki) (arp: rev 8266dae0e9404c20093daa21645d4d66d8bb7bdb) dev-support/smart-apply-patch.sh hadoop-common-project/hadoop-common/CHANGES.txt

          People

          • Assignee:
            sekikn Kengo Seki
            Reporter:
            aw Allen Wittenauer
          • Votes:
            0 Vote for this issue
            Watchers:
            5 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development