Skip to content
This repository was archived by the owner on Feb 22, 2018. It is now read-only.

Commit e834cf5

Browse files
committed
feat(scripts): pick-pr
Closes #1394
1 parent e47fa6c commit e834cf5

File tree

2 files changed

+29
-0
lines changed

2 files changed

+29
-0
lines changed

scripts/pick-pr

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/bin/sh
2+
3+
# Usage: pick-pr <pr-number>
4+
#
5+
# Takes a PR and cherry-picks it into the current branch.
6+
# Assumes you have an "upstream" remote pointing to GitHub.
7+
8+
set -e
9+
10+
PR=$1
11+
echo "Fetching PR $1 from GitHub"
12+
13+
git fetch [email protected]:angular/angular.dart.git master
14+
MASTER_SHA=$(git rev-list -n 1 FETCH_HEAD)
15+
git fetch [email protected]:angular/angular.dart.git pull/$PR/head
16+
echo
17+
18+
for sha in $(git rev-list --reverse FETCH_HEAD ^$MASTER_SHA); do
19+
echo "Cherrypicking $(git log --oneline -n 1 $sha)"
20+
git cherry-pick $sha;
21+
done
22+
23+
export PR
24+
export GIT_EDITOR=$(dirname $0)/pick-pr-editor
25+
git commit --amend

scripts/pick-pr-editor

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#!/bin/sh
2+
3+
FILE=$1
4+
echo "Closes #$PR" >>$FILE

0 commit comments

Comments
 (0)