threads / discuss / 19047

git send-email: How to modify subject prefix?

Subject: git send-email: How to modify subject prefix?

## tl;dr

7 messages between Apr 24, 2009 and Apr 24, 2009.

replies: 6people: 3as markdown or json

Constantine Plotnikov· Apr 24, 2009, 15:18 UTC · lore

I'm interested how to modify subject prefix when sending patches using git send-email. I want it to prefix the subject with [JGIT PATCH] instead of [PATCH] and I have not found any option that allows it.

Regards, Constantine

Michael Witten· Apr 24, 2009, 15:20 UTC · re: Constantine Plotnikov · lore

Re: git send-email: How to modify subject prefix?

On Fri, Apr 24, 2009 at 10:18, Constantine Plotnikov <constantine.plotnikov@gmail.com> wrote:

> I'm interested how to modify subject prefix when sending patches using
> git send-email. I want it to prefix the subject with [JGIT PATCH]
> instead of [PATCH] and I have not found any option that allows it.
The option is format-patch's --subject-prefix
Michael Witten· Apr 24, 2009, 15:23 UTC · re: Michael Witten · lore

Re: git send-email: How to modify subject prefix?

On Fri, Apr 24, 2009 at 10:20, Michael Witten <mfwitten@gmail.com> wrote:
Show 8 quoted lines
> On Fri, Apr 24, 2009 at 10:18, Constantine Plotnikov
> <constantine.plotnikov@gmail.com> wrote:
>> I'm interested how to modify subject prefix when sending patches using
>> git send-email. I want it to prefix the subject with [JGIT PATCH]
>> instead of [PATCH] and I have not found any option that allows it.
>
> The option is format-patch's --subject-prefix
>

Looking at the source for send-email, it would appear you can do the following if you don't want to run format-patch separately:

    git send-email $send_email_args -- $format_patch_args
That should be documented!
Constantine Plotnikov· Apr 24, 2009, 15:28 UTC · re: Michael Witten · lore

Re: git send-email: How to modify subject prefix?

This option works. Thank you.
BTW why this option is not in the man page? Is it discouraged for use?
On Fri, Apr 24, 2009 at 7:20 PM, Michael Witten <mfwitten@gmail.com> wrote:
Show 8 quoted lines
> On Fri, Apr 24, 2009 at 10:18, Constantine Plotnikov
> <constantine.plotnikov@gmail.com> wrote:
>> I'm interested how to modify subject prefix when sending patches using
>> git send-email. I want it to prefix the subject with [JGIT PATCH]
>> instead of [PATCH] and I have not found any option that allows it.
>
> The option is format-patch's --subject-prefix
>
Michael Witten· Apr 24, 2009, 15:32 UTC · re: Constantine Plotnikov · lore

Re: git send-email: How to modify subject prefix?

On Fri, Apr 24, 2009 at 10:28, Constantine Plotnikov <constantine.plotnikov@gmail.com> wrote:

> This option works. Thank you.
>
> BTW why this option is not in the man page? Is it discouraged for use?

The option --subject-prefix is documented in format-patch's man page (it is an option of format-patch, after all :-D).

However, using '--' with send-email to pass along arguments to a call to format-patch is not documented in send-email's man page, and it should be.

Michael Witten· Apr 24, 2009, 15:34 UTC · re: Michael Witten · lore

Re: git send-email: How to modify subject prefix?

On Fri, Apr 24, 2009 at 10:32, Michael Witten <mfwitten@gmail.com> wrote:
Show 6 quoted lines
> The option --subject-prefix is documented in format-patch's man page
> (it is an option of format-patch, after all :-D).
>
> However, using '--' with send-email to pass along arguments to a call
> to format-patch is not documented in send-email's man page, and it
> should be.

I should add that I don't really like it though; it seems that it makes the relationship to format-patch a little to close and implicit. I would think that --format-patch-args would be better.

Shawn O. Pearce· Apr 24, 2009, 15:22 UTC · re: Constantine Plotnikov · lore

Re: git send-email: How to modify subject prefix?

Constantine Plotnikov <constantine.plotnikov@gmail.com> wrote:
> I'm interested how to modify subject prefix when sending patches using
> git send-email. I want it to prefix the subject with [JGIT PATCH]
> instead of [PATCH] and I have not found any option that allows it.

Here's how I send email, the trick is to set the subject on format-patch not on send-email:

_sop/dump.sh
--8<--
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
----
_sop/send.sh
--8<--
git send-email \
	--to 'Robin Rosenberg <robin.rosenberg@dewire.com>' \
	--cc 'git@vger.kernel.org' \
	--chain-reply-to \
	--suppress-cc self \
	--smtp-server localhost \
	--smtp-server-port 8025 \
	_sop/OUT
----
-- 
Shawn.

← back to recent threads