#!/bin/sh case "$2" in commit|message) # It appears git invokes this script for interactive rebase but does # not remove commented lines, so just exit if we're not called with the # default (comment-containing) template. egrep -q '^#' "$1" || return 0 ;; template) return 0 ;; merge) return 0 ;; esac outfile=$(mktemp /tmp/freebsd-git-commit.XXXXXXXX) cat >$outfile </pull/### (*full* GitHub URL needed). # Differential Revision: https://reviews.freebsd.org/D### (*full* phabric URL needed). $(awk '/^#$/,EOF' $1) EOF mv $outfile $1