-
Notifications
You must be signed in to change notification settings - Fork 8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add option to confirm overwrite on save
Backports PR #9659 **Commit 1:** add option to confirm overwrite on save * Original sha: 5875c15 * Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T14:29:48Z **Commit 2:** Make save options instead of using a boolean to increase readability. * Original sha: 1701b9c * Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T21:07:56Z **Commit 3:** clean up comment * Original sha: bc2b9b1 * Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T21:14:43Z **Commit 4:** Address code comments - implicit returns from arrow function - throw an error not an object clean up implicit return confusion use promise.reject instead of throw. * Original sha: 8e43346 * Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-29T19:11:50Z
- Loading branch information
1 parent
b771d19
commit 912cc47
Showing
5 changed files
with
151 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,83 @@ | ||
Backport of PR #9659 to branch 5.x failed | ||
|
||
https://github.com/elastic/kibana/pull/9659 | ||
|
||
|
||
- 2 patches failed to apply | ||
- 1 patch was 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/9659/5.x | ||
git checkout jasper/backport/9659/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/9659/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/9659/5.x |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
add option to confirm overwrite on save | ||
|
||
Backports PR #9659 | ||
|
||
**Commit 1:** | ||
add option to confirm overwrite on save | ||
|
||
* Original sha: 5875c150577a4f68f91a17a597053387991cc048 | ||
* Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T14:29:48Z | ||
|
||
**Commit 2:** | ||
Make save options instead of using a boolean to increase readability. | ||
|
||
* Original sha: 1701b9c142b91cc5e25995c7fc253b296afc5175 | ||
* Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T21:07:56Z | ||
|
||
**Commit 3:** | ||
clean up comment | ||
|
||
* Original sha: bc2b9b15f1847ae8f5f559e2f71ed615e8d5979b | ||
* Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-27T21:14:43Z | ||
|
||
**Commit 4:** | ||
Address code comments | ||
|
||
- implicit returns from arrow function | ||
- throw an error not an object | ||
|
||
clean up implicit return confusion | ||
|
||
use promise.reject instead of throw. | ||
|
||
* Original sha: 8e4334660c1748edec2866e930f75b48ec2b192f | ||
* Authored by Stacey Gammon <gammon@elastic.co> on 2016-12-29T19:11:50Z |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
REMOTE="upstream" | ||
BRANCH="jasper/backport/9659/5.x" | ||
WORKING_BRANCH="tmp/$BRANCH" | ||
STARTING_SHA="5875c150577a4f68f91a17a597053387991cc048" | ||
ENDING_SHA="8e4334660c1748edec2866e930f75b48ec2b192f" | ||
|
||
git fetch $REMOTE | ||
|
||
git checkout -b $WORKING_BRANCH $ENDING_SHA | ||
git rebase $STARTING_SHA^ --onto $BRANCH |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
BRANCH="jasper/backport/9659/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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
#!/bin/sh | ||
|
||
REMOTE="upstream" | ||
BRANCH="jasper/backport/9659/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 |