# how to make a git-format patch

5 messages from 2006-04-12 to 2006-04-13. Participants: Aubrey, Jakub Narebski, Mathieu Chouquet-Stringer, Junio C Hamano.
Thread: https://gitlist.dev/t/3853

## Aubrey, 2006-04-12 10:28

Subject: how to make a git-format patch
Message-ID: <6d6a94c50604120328ufa09f0do76c04472206ae15f@mail.gmail.com>
URL: https://gitlist.dev/e/6d6a94c50604120328ufa09f0do76c04472206ae15f%40mail.gmail.com

```
Hi list,

When I use GIT to generate a patch, I can use git-diff, if one file
changed, I can get the following patch:
=================================
diff --git a/net/packet/Kconfig b/net/packet/Kconfig
index 34ff93f..959c272 100644
--- a/net/packet/Kconfig
+++ b/net/packet/Kconfig
@@ -17,7 +17,7 @@ config PACKET

 config PACKET_MMAP
        bool "Packet socket: mmapped IO"
-       depends on PACKET
+       depends on PACKET && MMU
        help
          If you say Y here, the Packet protocol driver will use an IO
          mechanism that results in faster communication.
=================================
But I saw most of the git-format patches have a header in the front of
the patch file, like:
=================================
 * Added xxxxxx support

Signed-off-by: xxxxxxxx <xxxxxxx@email.com>
---

 net/packet/Kconfig |   11 ++++++++++-
 1 files changed, 10 insertions(+), 1 deletions(-)

diff --git a/net/packet/Kconfig b/net/packet/Kconfig
index 34ff93f..959c272 100644
--- a/net/packet/Kconfig
+++ b/net/packet/Kconfig

----snip----
=================================

Just want to know how this kind of patch format generated.
Thanks for any hints.

Regards,
-Aubrey

```

## Jakub Narebski, 2006-04-12 11:12

Subject: Re: how to make a git-format patch
Message-ID: <e1inb0$o7n$1@sea.gmane.org>
URL: https://gitlist.dev/e/e1inb0%24o7n%241%40sea.gmane.org
In-Reply-To: <6d6a94c50604120328ufa09f0do76c04472206ae15f@mail.gmail.com>

```
Aubrey wrote:

> But I saw most of the git-format patches have a header in the front of
> the patch file, like:
> =================================
>  * Added xxxxxx support
> 
> Signed-off-by: xxxxxxxx <xxxxxxx@email.com>
> ---
> 
>  net/packet/Kconfig |   11 ++++++++++-
>  1 files changed, 10 insertions(+), 1 deletions(-)
> 
> diff --git a/net/packet/Kconfig b/net/packet/Kconfig
> index 34ff93f..959c272 100644
> --- a/net/packet/Kconfig
> +++ b/net/packet/Kconfig
> 
> ----snip----
> =================================
> 
> Just want to know how this kind of patch format generated.
> Thanks for any hints.

Perhaps git-format-patch(1) is what you want?

-- 
Jakub Narebski
Warsaw, Poland

```

## Mathieu Chouquet-Stringer, 2006-04-12 14:04

Subject: Re: how to make a git-format patch
Message-ID: <m3sloiriu7.fsf@localhost.localdomain>
URL: https://gitlist.dev/e/m3sloiriu7.fsf%40localhost.localdomain
In-Reply-To: <6d6a94c50604120328ufa09f0do76c04472206ae15f@mail.gmail.com>

```
aubreylee@gmail.com (Aubrey) writes:
> But I saw most of the git-format patches have a header in the front of
> the patch file, like:

I believe you're talking about 'git whatchanged -p' which not only displays
the diffs but also the commit comments.

-- 
Mathieu Chouquet-Stringer

```

## Aubrey, 2006-04-13 05:36

Subject: Re: how to make a git-format patch
Message-ID: <6d6a94c50604122236i47f3c2e9s7656118eda95a2cd@mail.gmail.com>
URL: https://gitlist.dev/e/6d6a94c50604122236i47f3c2e9s7656118eda95a2cd%40mail.gmail.com
In-Reply-To: <m3sloiriu7.fsf@localhost.localdomain>

```
On 12 Apr 2006 16:04:16 +0200, Mathieu Chouquet-Stringer
<ml2news@free.fr> wrote:
> I believe you're talking about 'git whatchanged -p' which not only displays
> the diffs but also the commit comments.

git whatchanged -p didn't include the signoff and howmany lines
changed which git-format-patch seems not include commit comments.

Is there one command to merge the two kind of message?

Thanks,
-Aubrey

```

## Junio C Hamano, 2006-04-13 05:53

Subject: Re: how to make a git-format patch
Message-ID: <7vveteyqba.fsf@assigned-by-dhcp.cox.net>
URL: https://gitlist.dev/e/7vveteyqba.fsf%40assigned-by-dhcp.cox.net
In-Reply-To: <6d6a94c50604122236i47f3c2e9s7656118eda95a2cd@mail.gmail.com>

```
Aubrey <aubreylee@gmail.com> writes:

> git whatchanged -p didn't include the signoff and howmany lines
> changed which git-format-patch seems not include commit comments.
>
> Is there one command to merge the two kind of message?

I think you already guessed it, judging from the Subject: line,
but the command is called "git-format-patch", and was around for
a long time.

```
