Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[backport] PR #6909 to 4.5 #6924

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
85 changes: 85 additions & 0 deletions backport--instructions.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
Backport of PR #6909 to branch 4.5 failed

https://github.com/elastic/kibana/pull/6909


- 21 files could not be found in this branch

- 29 patches failed to apply
- 0 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/6909/4.5
git checkout jasper/backport/6909/4.5

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/6909/4.5


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/6909/4.5
24 changes: 24 additions & 0 deletions backport-commit-message.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
Backport PR #6909
---------

**Commit 1:**
[internal] Replace var with let in ui/public P-T

This change was applied to any .js files under directories beginning
with `p` through `t` in src/ui/public. There are no `o` directories.

This was an automatic replacement from var to let for any variable
declaration that doubles as the initial assignment. Ultimately we want
most of these to be converted to const, but this commit is so large that
it warrants breaking each step of automation up into its own commit.

For example:

`var foo = 'bar';` becomes `let foo = 'var';`

This was accomplished by replacing:
find: `var ([a-zA-Z_$][0-9a-zA-Z_$]*)(\s+)=`
replace: `let $1$2=`

* Original sha: 1cddaab2c473103810eb47a016e9ca7290e36f6c
* Authored by Court Ewing <court@epixa.com> on 2016-04-12T22:31:57Z
12 changes: 12 additions & 0 deletions backport-guided-begin.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

REMOTE="upstream"
BRANCH="jasper/backport/6909/4.5"
WORKING_BRANCH="tmp/$BRANCH"
STARTING_SHA="1cddaab2c473103810eb47a016e9ca7290e36f6c"
ENDING_SHA="1cddaab2c473103810eb47a016e9ca7290e36f6c"

git fetch $REMOTE

git checkout -b $WORKING_BRANCH $ENDING_SHA
git rebase $STARTING_SHA^ --onto $BRANCH
10 changes: 10 additions & 0 deletions backport-guided-finish.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

BRANCH="jasper/backport/6909/4.5"
WORKING_BRANCH="tmp/$BRANCH"

git checkout $BRANCH
git reset --hard $WORKING_BRANCH
git branch -D $WORKING_BRANCH

sh backport-wrangle-into-commit.rej
12 changes: 12 additions & 0 deletions backport-wrangle-into-commit.rej
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/sh

REMOTE="upstream"
BRANCH="jasper/backport/6909/4.5"
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