akaros/scripts/git/pre-se.sh
<<
>>
Prefs
   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
   8usage()
   9{
  10        echo "$0 <from>..<to>"
  11        exit -1
  12}
  13
  14if [ $# -ne 1 ]
  15then
  16        usage
  17fi
  18
  19FROM=`echo $1 | cut -f 1 -d '.'`
  20TO=`echo $1 | cut -f 3 -d '.'`
  21
  22FROM_SHA=`git log --format=format:%h -1 $FROM`
  23TO_SHA=`git log --format=format:%h -1 $TO`
  24
  25echo ""
  26echo "------------"
  27echo "You can also find this patch set at:"
  28echo ""
  29echo "git@github.com:brho/akaros.git"
  30echo "From: $FROM_SHA"
  31echo "To: $TO_SHA $TO"
  32echo ""
  33echo "And view them at: "
  34echo ""
  35echo "https://github.com/brho/akaros/compare/$FROM_SHA...$TO_SHA"
  36echo ""
  37echo "------------"
  38