Skip to content

Commit

Permalink
Merge #5623: Make nicer pull request merge messages
Browse files Browse the repository at this point in the history
1078fb0 Make nicer pull request merge messages (BtcDrak)
  • Loading branch information
laanwj committed Feb 9, 2015
2 parents 7225577 + 1078fb0 commit f699416
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions contrib/devtools/github-merge.sh
Original file line number Diff line number Diff line change
Expand Up @@ -82,13 +82,15 @@ function cleanup() {
}

# Create unsigned merge commit.
PRTITLE=`curl -s https://api.github.com/repos/$REPO/pulls/$PULL | grep -e ' "title": ".*",'| awk -F'"' '{print $4}'`
MERGEMESSAGE="Merge #$PULL: $PRTITLE"
(
echo "Merge pull request #$PULL"
echo $MERGEMESSAGE
echo ""
git log --no-merges --topo-order --pretty='format:%h %s (%an)' pull/"$PULL"/base..pull/"$PULL"/head
)>"$TMPDIR/message"
if git merge -q --commit --no-edit --no-ff -m "$(<"$TMPDIR/message")" pull/"$PULL"/head; then
if [ "d$(git log --pretty='format:%s' -n 1)" != "dMerge pull request #$PULL" ]; then
if [ "d$(git log --pretty='format:%s' -n 1)" != "d$MERGEMESSAGE" ]; then
echo "ERROR: Creating merge failed (already merged?)." >&2
cleanup
exit 4
Expand Down

0 comments on commit f699416

Please sign in to comment.