# [PATCH] git-format-patch(1)- add note about creating patch for single commit

4 messages from 2008-10-19 to 2008-10-19. Participants: Dan McGee, Junio C Hamano.
Thread: https://gitlist.dev/t/15960

## Dan McGee, 2008-10-19 04:54

Subject: [PATCH] git-format-patch(1)- add note about creating patch for single commit
Message-ID: <1224392084-12956-1-git-send-email-dpmcgee@gmail.com>
URL: https://gitlist.dev/e/1224392084-12956-1-git-send-email-dpmcgee%40gmail.com

```
Signed-off-by: Dan McGee <dpmcgee@gmail.com>
---

I thought this would be helpful because it took me the beter part of an hour
to find a solution instead of specifying C~1..C or other crazy things. The
current documentation just leaves you hanging when what you really want is
just one formatted patch.

If there any suggestions on better wording, feel free to resubmit or whatever-
I just felt like this should be documented somewhere.

 Documentation/git-format-patch.txt |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)

diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
index adb4ea7..8518c33 100644
--- a/Documentation/git-format-patch.txt
+++ b/Documentation/git-format-patch.txt
@@ -46,7 +46,9 @@ applies to that command line and you do not get "everything
 since the beginning of the time".  If you want to format
 everything since project inception to one commit, say "git
 format-patch \--root <commit>" to make it clear that it is the
-latter case.
+latter case.  If you want to format only a single commit, say "git
+format-patch <commit>^!" (which excludes all parent revisions of the
+specified commit).
 
 By default, each output file is numbered sequentially from 1, and uses the
 first line of the commit message (massaged for pathname safety) as
-- 
1.6.0.2

```

## Junio C Hamano, 2008-10-19 05:21

Subject: Re: [PATCH] git-format-patch(1)- add note about creating patch for single commit
Message-ID: <7v1vyd9n3d.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7v1vyd9n3d.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <1224392084-12956-1-git-send-email-dpmcgee@gmail.com>

```
Dan McGee <dpmcgee@gmail.com> writes:

> Signed-off-by: Dan McGee <dpmcgee@gmail.com>
> ---
>
> I thought this would be helpful because it took me the beter part of an hour
> to find a solution instead of specifying C~1..C or other crazy things. The
> current documentation just leaves you hanging when what you really want is
> just one formatted patch.
>
> If there any suggestions on better wording, feel free to resubmit or whatever-
> I just felt like this should be documented somewhere.
>
>  Documentation/git-format-patch.txt |    4 +++-
>  1 files changed, 3 insertions(+), 1 deletions(-)
>
> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
> index adb4ea7..8518c33 100644
> --- a/Documentation/git-format-patch.txt
> +++ b/Documentation/git-format-patch.txt
> @@ -46,7 +46,9 @@ applies to that command line and you do not get "everything
>  since the beginning of the time".  If you want to format
>  everything since project inception to one commit, say "git
>  format-patch \--root <commit>" to make it clear that it is the
> -latter case.
> +latter case.  If you want to format only a single commit, say "git
> +format-patch <commit>^!" (which excludes all parent revisions of the
> +specified commit).
>  
>  By default, each output file is numbered sequentially from 1, and uses the
>  first line of the commit message (massaged for pathname safety) as

Heh, a more natural way to say that is:

	git format-patch -1 $that_one

That uses the first option described in the documentation:

	-<n>::
        	Limits the number of patches to prepare.

```

## Dan McGee, 2008-10-19 05:26

Subject: Re: [PATCH] git-format-patch(1)- add note about creating patch for single commit
Message-ID: <449c10960810182226t5e2ae1ay4b53656a7cac4606@mail.gmail.com>
URL: https://gitlist.dev/e/449c10960810182226t5e2ae1ay4b53656a7cac4606%40mail.gmail.com
In-Reply-To: <7v1vyd9n3d.fsf@gitster.siamese.dyndns.org>

```
On Sun, Oct 19, 2008 at 12:21 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Dan McGee <dpmcgee@gmail.com> writes:
>
>> Signed-off-by: Dan McGee <dpmcgee@gmail.com>
>> ---
>>
>> I thought this would be helpful because it took me the beter part of an hour
>> to find a solution instead of specifying C~1..C or other crazy things. The
>> current documentation just leaves you hanging when what you really want is
>> just one formatted patch.
>>
>> If there any suggestions on better wording, feel free to resubmit or whatever-
>> I just felt like this should be documented somewhere.
>>
>>  Documentation/git-format-patch.txt |    4 +++-
>>  1 files changed, 3 insertions(+), 1 deletions(-)
>>
>> diff --git a/Documentation/git-format-patch.txt b/Documentation/git-format-patch.txt
>> index adb4ea7..8518c33 100644
>> --- a/Documentation/git-format-patch.txt
>> +++ b/Documentation/git-format-patch.txt
>> @@ -46,7 +46,9 @@ applies to that command line and you do not get "everything
>>  since the beginning of the time".  If you want to format
>>  everything since project inception to one commit, say "git
>>  format-patch \--root <commit>" to make it clear that it is the
>> -latter case.
>> +latter case.  If you want to format only a single commit, say "git
>> +format-patch <commit>^!" (which excludes all parent revisions of the
>> +specified commit).
>>
>>  By default, each output file is numbered sequentially from 1, and uses the
>>  first line of the commit message (massaged for pathname safety) as
>
> Heh, a more natural way to say that is:
>
>        git format-patch -1 $that_one
>
> That uses the first option described in the documentation:
>
>        -<n>::
>                Limits the number of patches to prepare.

Wow, had no idea about that option. :)

Given that I didn't even notice this option when I did go to the
manpage, what if my above change was instead reworked a bit:
>> +latter case.  If you want to format only a single commit, say "git
>> +format-patch -1 <commit>" .

```

## Junio C Hamano, 2008-10-19 05:33

Subject: Re: [PATCH] git-format-patch(1)- add note about creating patch for single commit
Message-ID: <7vwsg587y7.fsf@gitster.siamese.dyndns.org>
URL: https://gitlist.dev/e/7vwsg587y7.fsf%40gitster.siamese.dyndns.org
In-Reply-To: <449c10960810182226t5e2ae1ay4b53656a7cac4606@mail.gmail.com>

```
"Dan McGee" <dpmcgee@gmail.com> writes:

> On Sun, Oct 19, 2008 at 12:21 AM, Junio C Hamano <gitster@pobox.com> wrote:
>
>> Heh, a more natural way to say that is:
>>
>>        git format-patch -1 $that_one
>>
>> That uses the first option described in the documentation:
>>
>>        -<n>::
>>                Limits the number of patches to prepare.
>
> Wow, had no idea about that option. :)
>
> Given that I didn't even notice this option when I did go to the
> manpage, what if my above change was instead reworked a bit:
>>> +latter case.  If you want to format only a single commit, say "git
>>> +format-patch -1 <commit>" .

I thought about it, but saw "formatting three commits" example in the
manpage, and stopped there ;-)

```
