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

Commit

Permalink
feat(scripts): pick-pr
Browse files Browse the repository at this point in the history
Closes #1394
  • Loading branch information
jbdeboer committed Aug 29, 2014
1 parent c533eb5 commit 3090a19
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions scripts/pick-pr
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
#!/bin/sh

# Usage: pick-pr <pr-number>
#
# Takes a PR and cherry-picks it into the current branch.
# Assumes you have an "upstream" remote pointing to GitHub.

set -e

PR=$1
echo "Fetching PR $1 from GitHub"

git fetch [email protected]:angular/angular.dart.git master
MASTER_SHA=$(git rev-list -n 1 FETCH_HEAD)
git fetch [email protected]:angular/angular.dart.git pull/$PR/head
echo

for sha in $(git rev-list --reverse FETCH_HEAD ^$MASTER_SHA); do
echo "Cherrypicking $(git log --oneline -n 1 $sha)"
git cherry-pick $sha;
done

export PR
export GIT_EDITOR=$(dirname $0)/pick-pr-editor
git commit --amend
4 changes: 4 additions & 0 deletions scripts/pick-pr-editor
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
#!/bin/sh

FILE=$1
echo "Closes #$PR" >>$FILE

0 comments on commit 3090a19

Please sign in to comment.