akaros/scripts/git/git-akaros-request-pull
<<
>>
Prefs
   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
   8OUTPUT=`git request-pull $*`
   9LINEMATCH="----------------------------------------------------------------"
  10
  11if [ $? -ne 0 ]
  12then
  13        echo "$OUTPUT"
  14        exit $?
  15fi
  16
  17FROM_SHA=`git log --format=format:%h -1 $1`
  18TO_SHA=`git log --format=format:%h -1 $2/$3`
  19URL="https://github.com/brho/akaros/compare/$FROM_SHA...$TO_SHA"
  20
  21echo "$OUTPUT" | sed "/$LINEMATCH/aView this online at:\n$URL\n\n$LINEMATCH"
  22