# Re: git-format-patch little gripe

6 messages from 2006-11-03 to 2006-11-25. Participants: Jeff King, Luben Tuikov, Sean.
Thread: https://gitlist.dev/t/43499

## Luben Tuikov, 2006-11-03 09:07

Subject: git-format-patch little gripe
Message-ID: <376237.14965.qm@web31805.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/376237.14965.qm%40web31805.mail.mud.yahoo.com

```
Yep, after more than a year, I simply cannot get used to it...
http://marc.theaimsgroup.com/?l=git&m=113259043217761&w=2
And as I've seen, other people brought that up too.

My brain simply says:
`` "git-format-patch" is singular and so the SHA-1 specified
   on the command line should generate a _single_ patch.''

Yeah, but no.

So I still make the mistake of:
# git-rev-list --no-merges --pretty=one-line HEAD -- <somepath>
    I select a commit
# git-format-patch -o /tmp/ <commit>
...
    Oh, f@#$!  <CTRL-C>
# git-format-patch -o /tmp/ <commit>^..<commit>

Is there a chance to make "git-format-patch" output a single
patch? of that commit only?

    Luben
P.S. And let "git-format-patches" go wild with the ideologies...
Sorry, needed to vent as I made this mistake twice already
today...






```

## Jeff King, 2006-11-03 18:50

Subject: Re: git-format-patch little gripe
Message-ID: <20061103185026.GA28566@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20061103185026.GA28566%40coredump.intra.peff.net
In-Reply-To: <376237.14965.qm@web31805.mail.mud.yahoo.com>

```
On Fri, Nov 03, 2006 at 01:07:20AM -0800, Luben Tuikov wrote:

> So I still make the mistake of:
> # git-rev-list --no-merges --pretty=one-line HEAD -- <somepath>
>     I select a commit
> # git-format-patch -o /tmp/ <commit>
> ...
>     Oh, f@#$!  <CTRL-C>
> # git-format-patch -o /tmp/ <commit>^..<commit>

For my own workflow, I don't want to have to pick the commit out of
rev-list (or log) output. I want to find it and hit a button to say "OK,
now mail this patch." So I put _all_ of my patches into an mbox, and
then browse them with mutt. Sort of a poor man's patch browser, but then
I'm ready to jump into mailing them immediately.

I use the following script:

#!/bin/sh
root=${1:-origin}
git-format-patch -s --stdout $root >.mbox
mutt -f .mbox
rm -f .mbox

And then in mutt, I use this macro to bind 'b' to editing the full
message w/ headers:

macro index b ":set edit_headers=yes<enter><resend-message>:set edit_headers=no<enter>"

I know that may be useless if you're not using mutt, but I just wanted
to stimulate some discussion among patch submitters about how they
actually do it. I'm not sure how configurable tig is, but it shouldn't
be too hard to add something like this to it.


```

## Luben Tuikov, 2006-11-03 20:37

Subject: Re: git-format-patch little gripe
Message-ID: <20061103203752.26472.qmail@web31810.mail.mud.yahoo.com>
URL: https://gitlist.dev/e/20061103203752.26472.qmail%40web31810.mail.mud.yahoo.com
In-Reply-To: <20061103185026.GA28566@coredump.intra.peff.net>

```
--- Jeff King <peff@peff.net> wrote:
> For my own workflow, I don't want to have to pick the commit out of
> rev-list (or log) output. I want to find it and hit a button to say "OK,
> now mail this patch." So I put _all_ of my patches into an mbox, and
> then browse them with mutt. Sort of a poor man's patch browser, but then
> I'm ready to jump into mailing them immediately.
> 
> I use the following script:
> 
> #!/bin/sh
> root=${1:-origin}
> git-format-patch -s --stdout $root >.mbox
> mutt -f .mbox
> rm -f .mbox
> 
> And then in mutt, I use this macro to bind 'b' to editing the full
> message w/ headers:
> 
> macro index b ":set edit_headers=yes<enter><resend-message>:set edit_headers=no<enter>"
> 
> I know that may be useless if you're not using mutt, but I just wanted
> to stimulate some discussion among patch submitters about how they
> actually do it. I'm not sure how configurable tig is, but it shouldn't
> be too hard to add something like this to it.

That's very cool!

   Luben

```

## Sean, 2006-11-25 15:30

Subject: Re: git-format-patch little gripe
Message-ID: <BAYC1-PASMTP115161C7958A05B82E52A9AEE00@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP115161C7958A05B82E52A9AEE00%40CEZ.ICE
In-Reply-To: <20061103185026.GA28566@coredump.intra.peff.net>

```
On Fri, 3 Nov 2006 13:50:26 -0500
Jeff King <peff@peff.net> wrote:

> For my own workflow, I don't want to have to pick the commit out of
> rev-list (or log) output. I want to find it and hit a button to say "OK,
> now mail this patch." So I put _all_ of my patches into an mbox, and
> then browse them with mutt. Sort of a poor man's patch browser, but then
> I'm ready to jump into mailing them immediately.
> 
> I use the following script:
> 
> #!/bin/sh
> root=${1:-origin}
> git-format-patch -s --stdout $root >.mbox
> mutt -f .mbox
> rm -f .mbox

If your mail setup support imap, the patches can be dumped directly into
it rather than having to go through an mbox.  For instance you can have
something like this in your ~/.gitconfig:

[imap]
   Host = imap.server.com
   Folder = "Drafts"
   User = uname
   Pass = password

And then the above command line becomes:

git-format-patch -s --stdout $root | git-imap-send

To move all the patches into your imap drafts folder to be accessed
by whatever email client you use.

Sean

```

## Jeff King, 2006-11-25 15:39

Subject: Re: git-format-patch little gripe
Message-ID: <20061125153949.GA11136@coredump.intra.peff.net>
URL: https://gitlist.dev/e/20061125153949.GA11136%40coredump.intra.peff.net
In-Reply-To: <20061125103033.2ea742d3.seanlkml@sympatico.ca>

```
On Sat, Nov 25, 2006 at 10:30:33AM -0500, Sean wrote:

> If your mail setup support imap, the patches can be dumped directly into
> it rather than having to go through an mbox.  For instance you can have
> something like this in your ~/.gitconfig:

Sure, I could. But if you have a client which supports mboxes, it's
probably better to use the mbox. With your solution, I send the patch to
the imap server, then fire up the mail client and re-download the
patch, possibly mark it up, and then send it out by smtp. The latency
increase can be noticeable, especially for big patches and slow imap
servers.

> To move all the patches into your imap drafts folder to be accessed
> by whatever email client you use.

Oh come on, Real Men just edit the mbox in vi. :)


```

## Sean, 2006-11-25 15:42

Subject: Re: git-format-patch little gripe
Message-ID: <BAYC1-PASMTP11C557DF59DF29690CDB77AEE00@CEZ.ICE>
URL: https://gitlist.dev/e/BAYC1-PASMTP11C557DF59DF29690CDB77AEE00%40CEZ.ICE
In-Reply-To: <20061125153949.GA11136@coredump.intra.peff.net>

```
On Sat, 25 Nov 2006 10:39:49 -0500
Jeff King <peff@peff.net> wrote:

> On Sat, Nov 25, 2006 at 10:30:33AM -0500, Sean wrote:
> 
> > If your mail setup support imap, the patches can be dumped directly into
> > it rather than having to go through an mbox.  For instance you can have
> > something like this in your ~/.gitconfig:
> 
> Sure, I could. But if you have a client which supports mboxes, it's
> probably better to use the mbox. With your solution, I send the patch to
> the imap server, then fire up the mail client and re-download the
> patch, possibly mark it up, and then send it out by smtp. The latency
> increase can be noticeable, especially for big patches and slow imap
> servers.

Yeah, I didn't mean it as a better replacement for your use, just as
an option that might suit some people better.  It works out well here.

> > To move all the patches into your imap drafts folder to be accessed
> > by whatever email client you use.
> 
> Oh come on, Real Men just edit the mbox in vi. :)

Damn.. caught in my skirt again.. ;o)


```
