Index: tools/tools/git/arc-patch =================================================================== --- /dev/null +++ tools/tools/git/arc-patch @@ -0,0 +1,9 @@ +#!/bin/sh +# Run arc patch and update the commit message afterwards to filter out +# unneccessary phabricator tags. +# Since the message probably still needs some editing afterwards, it also +# runs git commit --amend to allow finalizing the message. +scriptdir=$(CDPATH= cd -- "$(dirname -- "$0")" && pwd -P) +arc patch --nobranch --skip-dependencies "$@" && "$scriptdir"/arcfilter.sh +git commit --amend + Index: tools/tools/git/arcfilter.sh =================================================================== --- /dev/null +++ tools/tools/git/arcfilter.sh @@ -0,0 +1,11 @@ +#!/bin/sh + +# Remove unnecessary phabricator tags from the commit at HEAD. +# Based on the arcfilter.sh script from LLVM. +git log -1 --pretty=%B | \ + sed 's/^Summary://' | \ + awk '/Reviewers:|Subscribers:/{p=1} /Reviewed By:|Differential Revision:/{p=0} !p && !/^Summary:$/ {sub(/^Summary: /,"");print}' | \ + sed -e 's/^Reviewers: /Reviewers:\t/' \ + -e 's/^Reviewed By: /Reviewed By:\t/' \ + -e 's/^Reviewed by: /Reviewed by:\t/' | \ + git commit --amend --date=now -F -