[FFmpeg-devel] [GOODIE] mutt script for sending patches

Peter Ross pross at xvid.org
Sat Mar 19 00:12:19 CET 2011


File enclosed this time.

On Sat, Mar 19, 2011 at 10:11:03AM +1100, Peter Ross wrote:
> This has the same cmdline usage as git-send-email, except that it invokes mutt.
> 
> It saves duplicating smtp configuration in .git/config. Also provides opportunity
> to run spellcheck & gpg prior to sending.
> 
> -- Peter
> (A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
#!/bin/sh
#
# NAME
# git-mutt-patch - Send one or more git patches using Mutt
#
# SYNOPSIS
# git-mutt-patch [options] <since> | <revision range>
#
# OPTIONS
# Accepts existing git-format-patch options
# e.g.
#     --cover-letter
#     --in-reply-to=<Message-Id>
#
# CONFIGURATION
# Uses standard git-send-email config variables
#     sendemail.to
#     sendemail.cc
#     sendemail.thread
#
# AUTHOR
# Peter Ross <pross at xvid.org>
#

MUTT=mutt

addflagstr(){
v=`git config $1` && GFPFLAGS="${GFPFLAGS} $2 ${v}"
}
addflagbool(){
v=`git config $1` && test "${v}" = "true" && GFPFLAGS="${GFPFLAGS} $2"
}

# convert git-config variables to git-format-patch flags
GFPFLAGS=
addflagstr sendemail.to --to
addflagstr sendemail.cc --cc
addflagbool sendemail.thread --thread

# feed each formatted patch into mutt
patchdir="$(mktemp -d)"
for x in `git format-patch ${GFPFLAGS} -o "${patchdir}" $*`; do
   ( echo "$*" | grep "\--in-reply-to" ) && sed -i 's/^Subject: /Subject: Re: /' "${x}"
   ${MUTT} -e 'set followup_to=no' -H "${x}" || break
done
rm -rf "${patchdir}"
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20110319/28641fc3/attachment-0001.asc>


More information about the ffmpeg-devel mailing list