9ns: don't pass user pointers for 'spec'
[akaros.git] / scripts / git / git-akaros-request-pull
1 #!/bin/bash
2 # Barret Rhoden (brho@cs.berkeley.edu)
3 # Copyright 2016 Google Inc
4 #
5 # Wrapper around git request-pull that adds in a github URL to view the
6 # patchset
7
8 OUTPUT=`git request-pull $*`
9 LINEMATCH="----------------------------------------------------------------"
10
11 if [ $? -ne 0 ]
12 then
13         echo "$OUTPUT"
14         exit $?
15 fi
16
17 FROM_SHA=`git log --format=format:%h -1 $1`
18 TO_SHA=`git log --format=format:%h -1 $2/$3`
19 URL="https://github.com/brho/akaros/compare/$FROM_SHA...$TO_SHA"
20
21 echo "$OUTPUT" | sed "/$LINEMATCH/aView this online at:\n$URL\n\n$LINEMATCH"