2017-11-30 22:09:26 +03:00
|
|
|
# ./hack/patch/cherrypick.sh
|
2017-10-24 23:37:58 +03:00
|
|
|
|
|
|
|
Handles cherry-picks of PR(s) from etcd master to a stable etcd release branch automatically.
|
|
|
|
|
|
|
|
## Setup
|
|
|
|
|
|
|
|
Set the `UPSTREAM_REMOTE` and `FORK_REMOTE` environment variables.
|
2018-08-29 03:47:19 +03:00
|
|
|
`UPSTREAM_REMOTE` should be set to git remote name of `github.com/etcd-io/etcd`,
|
2017-11-10 19:59:51 +03:00
|
|
|
and `FORK_REMOTE` should be set to the git remote name of the forked etcd
|
|
|
|
repo (`github.com/${github-username}/etcd`). Use `git remotes -v` to
|
|
|
|
look up the git remote names. If etcd has not been forked, create
|
2017-10-24 23:37:58 +03:00
|
|
|
one on github.com and register it locally with `git remote add ...`.
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
export UPSTREAM_REMOTE=origin
|
|
|
|
export FORK_REMOTE=${github-username}
|
2017-11-30 22:09:26 +03:00
|
|
|
export GITHUB_USER=${github-username}
|
2017-10-24 23:37:58 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
Next, install hub from https://github.com/github/hub
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2017-11-30 22:09:26 +03:00
|
|
|
To cherry pick PR 12345 onto release-3.2 and propose is as a PR, run:
|
2017-10-24 23:37:58 +03:00
|
|
|
|
|
|
|
```sh
|
2017-11-30 22:09:26 +03:00
|
|
|
./hack/patch/cherrypick.sh ${UPSTREAM_REMOTE}/release-3.2 12345
|
2017-10-24 23:37:58 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
To cherry pick 12345 then 56789 and propose them togther as a single PR, run:
|
|
|
|
|
|
|
|
```
|
2017-11-30 22:09:26 +03:00
|
|
|
./hack/patch/cherrypick.sh ${UPSTREAM_REMOTE}/release-3.2 12345 56789
|
2017-10-24 23:37:58 +03:00
|
|
|
```
|
|
|
|
|
|
|
|
|