Subject: Re: [PATCH 2/2] Use NullProgressMonitor.INSTANCE and indent for loop

From: "Shawn O. Pearce" <[email-masked]>
Date: Wed, 6 May 2009 13:54:44 -0700

Alex Blewitt <[email-masked]> wrote:
> I've been using git send-email --format-patch, which doesn't appear to  
> add the signed by line. If I do it as the commit, will it add the  
> signed-by when it gets committed, and thus I can use send-email? git  
> format-patch just seems to dump a load of files into the directory, and 
> (as noted elsewhere) the git-rebase doesn't appear to work for me.

IIRC, "git send-email --format-patch -- -s" would pass -s to the
format-patch script, adding the line automatically.  But that's
an undocumented feature of send-email.

Personally, I put the SOB line in with "git commit -s" when I write
the change.  Then its there when I dump it out with format-patch.

As for format-patch making a ton of files, yea, that's its job.
I actually use the following pair of scripts to manage sending,
as this lets me edit _sop/OUT/* before firing it off.

--8<--
#!/bin/sh
if [ -n "$(git rev-parse --show-cdup)" ]; then
	cd $(git rev-parse --show-cdup) || exit
fi

mkdir -p _sop/OUT &&
rm -f $(find _sop/OUT -name '*.patch' | grep -v '0000-cover-letter') &&
base="${1:-master}" &&
if [ $(git rev-list ^$base HEAD | wc -l) -gt 1 ]
then
	n="--numbered --cover-letter"
fi &&
git format-patch \
	--output-directory _sop/OUT \
	--subject-prefix='JGIT PATCH' \
	-M \
	$n \
	$base || exit
----

--8<--
#!/bin/sh
if [ -n "$(git rev-parse --show-cdup)" ]; then
	cd $(git rev-parse --show-cdup) || exit
fi

ls -1 _sop/OUT
read

git send-email \
	--to 'Robin Rosenberg <[email-masked]>' \
	--cc [email-masked]' \
	--chain-reply-to \
	--suppress-cc self \
	--smtp-server localhost \
	--smtp-server-port 8025 \
	_sop/OUT
----

-- 
Shawn.