From 24ce7504d8a32b24bb13d9ead2cc691f9a124bb1 Mon Sep 17 00:00:00 2001 From: Elastic Jasper Date: Fri, 24 Feb 2017 09:26:55 -0500 Subject: [PATCH] Warn if the title is a duplicate Backports PR #10321 **Commit 1:** Warn if the title is a duplicate * Original sha: b0aa0b85f89ae7140d8606bef1aa8a45e1ff41ab * Authored by Stacey Gammon on 2017-02-13T18:07:23Z **Commit 2:** warn when copyOnSave is checked. add a test * Original sha: ee42002a16ccafdac76873057d2aff7a92692f4e * Authored by Stacey Gammon on 2017-02-14T14:20:37Z **Commit 3:** update message * Original sha: c90c8ae6b574f6523be4c6750135a3729dce7c01 * Authored by Stacey Gammon on 2017-02-14T14:24:50Z **Commit 4:** fix tests * Original sha: 5ec1a92ba016a46b7ef5da0300914e04bd8ce684 * Authored by Stacey Gammon on 2017-02-14T15:04:14Z **Commit 5:** Fix issues with substring matching add more tests. * Original sha: 4335e9e404881cbd3db88367b113605740c83d3e * Authored by Stacey Gammon on 2017-02-14T18:54:58Z **Commit 6:** make case insensitive and return matching title * Original sha: 8881739e9c952b1970e258651a230c7b0d08aa77 * Authored by Stacey Gammon on 2017-02-14T19:34:04Z **Commit 7:** Fix bug caused by subtle difference between this.type and type Add a comment and rename one of the variables to make the distinction clearer. * Original sha: f4011ced2ed5a8c8b73230abd543c50802dd6a26 * Authored by Stacey Gammon on 2017-02-16T16:31:13Z **Commit 8:** add debug messages. * Original sha: 2d448891c71ee4157549b49b15c2b43cd8ac3282 * Authored by Stacey Gammon on 2017-02-16T18:05:03Z **Commit 9:** fix tests again * Original sha: 3212c915aca70c2e3e7b253f81d02f4ea6f95919 * Authored by Stacey Gammon on 2017-02-16T22:10:25Z **Commit 10:** uncomment out tests * Original sha: 1f2cb28657deb856ee3bf70c6d315c21d1b5e7aa * Authored by Stacey Gammon on 2017-02-16T22:12:06Z **Commit 11:** more debug messages * Original sha: 807b1904759f997f343e73141473af0d1b6f8c28 * Authored by Stacey Gammon on 2017-02-17T02:09:37Z **Commit 12:** save more screenshots * Original sha: 3d025e953b5a5564ffb1b89a08145bd5e7cd7bd9 * Authored by Stacey Gammon on 2017-02-17T02:34:29Z **Commit 13:** Need to wait till save finishes or the page may redirect the url after the page has navigated away * Original sha: de00e24a850b9b847b87c804e8cc6df6ef61c531 * Authored by Stacey Gammon on 2017-02-17T14:01:22Z **Commit 14:** address code review comments * Original sha: 7bc02684b4d5c0289e5044e71deaa5c9fe5e77f3 * Authored by Stacey Gammon on 2017-02-17T17:28:34Z --- backport--instructions.rej | 83 ++++++++++++++++++++++++++++ backport-commit-message.rej | 92 ++++++++++++++++++++++++++++++++ backport-guided-begin.rej | 12 +++++ backport-guided-finish.rej | 10 ++++ backport-wrangle-into-commit.rej | 12 +++++ 5 files changed, 209 insertions(+) create mode 100644 backport--instructions.rej create mode 100644 backport-commit-message.rej create mode 100755 backport-guided-begin.rej create mode 100755 backport-guided-finish.rej create mode 100755 backport-wrangle-into-commit.rej diff --git a/backport--instructions.rej b/backport--instructions.rej new file mode 100644 index 00000000000000..bb605e81017398 --- /dev/null +++ b/backport--instructions.rej @@ -0,0 +1,83 @@ +Backport of PR #10321 to branch 5.x failed + +https://github.com/elastic/kibana/pull/10321 + + +- 1 patch failed to apply +- 9 patches were applied successfully + +------------------------------------- + +At this point, you need to manually resolve these conflicts on your machine and +push the changes back up to this upstream branch so the PR is updated with your +changes. The following instructions and scripts should help with that. + +All of the provided scripts assume that the remote "upstream" is where the +backport branch exists and that your local branch has the exact same name as +the upstream branch. + +First, check out this branch locally: + + git fetch upstream jasper/backport/10321/5.x + git checkout jasper/backport/10321/5.x + +Now, just follow one of these two paths: + + +1. GUIDED BACKPORT + +You should do the guided backport if you want to apply the backported changes +while resolving the conflicts on each commit. For most cases, this is what you +want to do. + +The following script will rebase the commits that need to be backported onto +a new temporary branch. Resolve any conflicts as you normally would during a +rebase. Do not remove these backport-*.rej files, and feel free to add +additional commits if that's necessary: + + sh backport-guided-begin.rej + +Once the conficts are resolved and the rebase is completed, the following +script will update the local backport branch with the changes, remove the +temporary branch that was created, remove the remnants of this backport commit +and squash the newly resolved commits (and any others you may have added) into +a single backport commit with the proper commit message: + + sh backport-guided-finish.rej + +At this point, you should be on the local backport branch, and it should be +exactly 1 commit ahead of the intended target. The commit message should be +very similar if not identical to the PR itself, and the changeset should +include all of the changes you intended to backport and none of these +backport-*.rej files. + +Now just replace the contents of the pull request with your local changes: + + git push -f upstream jasper/backport/10321/5.x + + +2. ALMOST COMPLETELY MANUAL + +You should do this option if there are just so many conflicts that it's easier +to rebuild the entire changeset from scratch. You'll still work on the local +backport branch which should be up to date with the intended target. + +Feel free to add as many commits as you'd like and don't worry about fancy +commit messages - we're just going to squash them down and replace the message +when you're finished. + +Once the changes are committed on your local backport branch, the following +script will remove the remnants of this backport commit and squash the newly +created commits into a single backport commit with the proper commit message. + + sh backport-wrangle-into-commit.rej + +At this point, you should be on the local backport branch, and it should be +exactly 1 commit ahead of the intended target. The commit message should be +very similar if not identical to the PR itself, and the changeset should +include all of the changes you intended to backport and none of these +backport-*.rej files. + +Now just replace the contents of the pull request with your local changes: + + git push -f upstream jasper/backport/10321/5.x diff --git a/backport-commit-message.rej b/backport-commit-message.rej new file mode 100644 index 00000000000000..6cb7c2954f68db --- /dev/null +++ b/backport-commit-message.rej @@ -0,0 +1,92 @@ +Warn if the title is a duplicate + +Backports PR #10321 + +**Commit 1:** +Warn if the title is a duplicate + +* Original sha: b0aa0b85f89ae7140d8606bef1aa8a45e1ff41ab +* Authored by Stacey Gammon on 2017-02-13T18:07:23Z + +**Commit 2:** +warn when copyOnSave is checked. add a test + +* Original sha: ee42002a16ccafdac76873057d2aff7a92692f4e +* Authored by Stacey Gammon on 2017-02-14T14:20:37Z + +**Commit 3:** +update message + +* Original sha: c90c8ae6b574f6523be4c6750135a3729dce7c01 +* Authored by Stacey Gammon on 2017-02-14T14:24:50Z + +**Commit 4:** +fix tests + +* Original sha: 5ec1a92ba016a46b7ef5da0300914e04bd8ce684 +* Authored by Stacey Gammon on 2017-02-14T15:04:14Z + +**Commit 5:** +Fix issues with substring matching + +add more tests. + +* Original sha: 4335e9e404881cbd3db88367b113605740c83d3e +* Authored by Stacey Gammon on 2017-02-14T18:54:58Z + +**Commit 6:** +make case insensitive and return matching title + +* Original sha: 8881739e9c952b1970e258651a230c7b0d08aa77 +* Authored by Stacey Gammon on 2017-02-14T19:34:04Z + +**Commit 7:** +Fix bug caused by subtle difference between this.type and type + +Add a comment and rename one of the variables to make the distinction +clearer. + +* Original sha: f4011ced2ed5a8c8b73230abd543c50802dd6a26 +* Authored by Stacey Gammon on 2017-02-16T16:31:13Z + +**Commit 8:** +add debug messages. + +* Original sha: 2d448891c71ee4157549b49b15c2b43cd8ac3282 +* Authored by Stacey Gammon on 2017-02-16T18:05:03Z + +**Commit 9:** +fix tests again + +* Original sha: 3212c915aca70c2e3e7b253f81d02f4ea6f95919 +* Authored by Stacey Gammon on 2017-02-16T22:10:25Z + +**Commit 10:** +uncomment out tests + +* Original sha: 1f2cb28657deb856ee3bf70c6d315c21d1b5e7aa +* Authored by Stacey Gammon on 2017-02-16T22:12:06Z + +**Commit 11:** +more debug messages + +* Original sha: 807b1904759f997f343e73141473af0d1b6f8c28 +* Authored by Stacey Gammon on 2017-02-17T02:09:37Z + +**Commit 12:** +save more screenshots + +* Original sha: 3d025e953b5a5564ffb1b89a08145bd5e7cd7bd9 +* Authored by Stacey Gammon on 2017-02-17T02:34:29Z + +**Commit 13:** +Need to wait till save finishes or the page may redirect the url after the page has navigated away + +* Original sha: de00e24a850b9b847b87c804e8cc6df6ef61c531 +* Authored by Stacey Gammon on 2017-02-17T14:01:22Z + +**Commit 14:** +address code review comments + +* Original sha: 7bc02684b4d5c0289e5044e71deaa5c9fe5e77f3 +* Authored by Stacey Gammon on 2017-02-17T17:28:34Z \ No newline at end of file diff --git a/backport-guided-begin.rej b/backport-guided-begin.rej new file mode 100755 index 00000000000000..ccd7df88073c82 --- /dev/null +++ b/backport-guided-begin.rej @@ -0,0 +1,12 @@ +#!/bin/sh + +REMOTE="upstream" +BRANCH="jasper/backport/10321/5.x" +WORKING_BRANCH="tmp/$BRANCH" +STARTING_SHA="b0aa0b85f89ae7140d8606bef1aa8a45e1ff41ab" +ENDING_SHA="7bc02684b4d5c0289e5044e71deaa5c9fe5e77f3" + +git fetch $REMOTE + +git checkout -b $WORKING_BRANCH $ENDING_SHA +git rebase $STARTING_SHA^ --onto $BRANCH diff --git a/backport-guided-finish.rej b/backport-guided-finish.rej new file mode 100755 index 00000000000000..86c962fcb17e45 --- /dev/null +++ b/backport-guided-finish.rej @@ -0,0 +1,10 @@ +#!/bin/sh + +BRANCH="jasper/backport/10321/5.x" +WORKING_BRANCH="tmp/$BRANCH" + +git checkout $BRANCH +git reset --hard $WORKING_BRANCH +git branch -D $WORKING_BRANCH + +sh backport-wrangle-into-commit.rej diff --git a/backport-wrangle-into-commit.rej b/backport-wrangle-into-commit.rej new file mode 100755 index 00000000000000..ea486aea75e1b1 --- /dev/null +++ b/backport-wrangle-into-commit.rej @@ -0,0 +1,12 @@ +#!/bin/sh + +REMOTE="upstream" +BRANCH="jasper/backport/10321/5.x" +COMMIT_MSG=`cat backport-commit-message.rej` + +git reset --soft $REMOTE/$BRANCH +git stash +git reset --hard HEAD^ +git stash apply --index + +git commit -m "$COMMIT_MSG" --no-verify