9ns: don't pass user pointers for 'spec'
[akaros.git] / scripts / git / pre-se.sh
1 #!/bin/bash
2 # Barret Rhoden (brho@cs.berkeley.edu)
3 # Copyright 2016 Google Inc
4 #
5 # Spits out a blob of text describing a patchset.  I'll use this with
6 # send-email's cover-letter for large patchsets.
7
8 usage()
9 {
10         echo "$0 <from>..<to>"
11         exit -1
12 }
13
14 if [ $# -ne 1 ]
15 then
16         usage
17 fi
18
19 FROM=`echo $1 | cut -f 1 -d '.'`
20 TO=`echo $1 | cut -f 3 -d '.'`
21
22 FROM_SHA=`git log --format=format:%h -1 $FROM`
23 TO_SHA=`git log --format=format:%h -1 $TO`
24
25 echo ""
26 echo "------------"
27 echo "You can also find this patch set at:"
28 echo ""
29 echo "git@github.com:brho/akaros.git"
30 echo "From: $FROM_SHA"
31 echo "To: $TO_SHA $TO"
32 echo ""
33 echo "And view them at: "
34 echo ""
35 echo "https://github.com/brho/akaros/compare/$FROM_SHA...$TO_SHA"
36 echo ""
37 echo "------------"