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

7 messages from 2009-04-24 to 2009-04-24. Participants: Constantine Plotnikov, Michael Witten, Shawn O. Pearce.
Thread: https://gitlist.dev/t/19047

## Constantine Plotnikov, 2009-04-24 15:18

Subject: git send-email: How to modify subject prefix?
Message-ID: <85647ef50904240818s41fffc2eh798083a24ab53750@mail.gmail.com>
URL: https://gitlist.dev/e/85647ef50904240818s41fffc2eh798083a24ab53750%40mail.gmail.com

```
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, 2009-04-24 15:20

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <b4087cc50904240820r567020d7gaa7cecaa0f3b78fa@mail.gmail.com>
URL: https://gitlist.dev/e/b4087cc50904240820r567020d7gaa7cecaa0f3b78fa%40mail.gmail.com
In-Reply-To: <85647ef50904240818s41fffc2eh798083a24ab53750@mail.gmail.com>

```
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

```

## Shawn O. Pearce, 2009-04-24 15:22

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <20090424152227.GY23604@spearce.org>
URL: https://gitlist.dev/e/20090424152227.GY23604%40spearce.org
In-Reply-To: <85647ef50904240818s41fffc2eh798083a24ab53750@mail.gmail.com>

```
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.

```

## Michael Witten, 2009-04-24 15:23

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <b4087cc50904240823nea4ef2ep20f2060f48395f74@mail.gmail.com>
URL: https://gitlist.dev/e/b4087cc50904240823nea4ef2ep20f2060f48395f74%40mail.gmail.com
In-Reply-To: <b4087cc50904240820r567020d7gaa7cecaa0f3b78fa@mail.gmail.com>

```
On Fri, Apr 24, 2009 at 10:20, Michael Witten <mfwitten@gmail.com> wrote:
> 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, 2009-04-24 15:28

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <85647ef50904240828i76cf5f0en14a9fd2dc496a89d@mail.gmail.com>
URL: https://gitlist.dev/e/85647ef50904240828i76cf5f0en14a9fd2dc496a89d%40mail.gmail.com
In-Reply-To: <b4087cc50904240820r567020d7gaa7cecaa0f3b78fa@mail.gmail.com>

```
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:
> 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, 2009-04-24 15:32

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <b4087cc50904240832u6d0a17b2gaad406a0176da883@mail.gmail.com>
URL: https://gitlist.dev/e/b4087cc50904240832u6d0a17b2gaad406a0176da883%40mail.gmail.com
In-Reply-To: <85647ef50904240828i76cf5f0en14a9fd2dc496a89d@mail.gmail.com>

```
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, 2009-04-24 15:34

Subject: Re: git send-email: How to modify subject prefix?
Message-ID: <b4087cc50904240834q34200ee1qd9081b8c4480c83a@mail.gmail.com>
URL: https://gitlist.dev/e/b4087cc50904240834q34200ee1qd9081b8c4480c83a%40mail.gmail.com
In-Reply-To: <b4087cc50904240832u6d0a17b2gaad406a0176da883@mail.gmail.com>

```
On Fri, Apr 24, 2009 at 10:32, Michael Witten <mfwitten@gmail.com> wrote:
> 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.

```
