(re-adding mutt-users to Cc:, there's no Mail-Followup-To: or Reply-To:
in the header and I'm new to this list (but not mutt) so I'll just
 follow git and linux-kernel mailing list (LKML) conventions for now)

Oliver Graute <oliver.gra...@gmail.com> wrote:
> On 15/06/15, Eric Wong wrote:
> > Oliver Graute <oliver.gra...@gmail.com> wrote:
> > > I would like to apply patches received from a public mailinglist to a 
> > > git repository. There for i'am looking for an easy to handle maintainer
> > > workflow for mutt and git. How do maintainers of known open source
> > > projects handle these workflow with incoming patches?
> > 
> > I use the following macros to apply patches directly from mutt (once I'm
> > in a project working directory):
> > 
> > macro index A ":unset pipe_decode\n|(umask 0022 && git am -3)\n:set 
> > pipe_decode\n"
> > macro pager A ":unset pipe_decode\n|(umask 0022 && git am -3)\n:set 
> > pipe_decode\n"
> 
> is something similar possible with git apply? if I replace git am -3 
> with git apply I got an error "fatal: unrecognized input"

Yes.  However, you would normally receive emails formatted using
"git format-patch" (which may be sent directly via "git send-email")
which are designed for use with "git am".

I disable pipe_decode so mutt won't attempt to process/decode a message
and throw off "git am" processing.

> > I will often save/copy messages to a separate mbox and apply them all at
> > once with "git am", perhaps editing them a little first (commit message
> > fixes/addendums, adding signed-off-by: tags, etc...)
> 
> can you describe me that more in detail. I'am new to mutt.

mbox is the standard Unix mail box format, basically just a text file
with all messages concatenated together.  "man 5 mbox" for details.
I normally use Maildir for general mail storage, but prefer mbox as
a temporary work space.

Mutt can save (move) or copy files to any mbox (new or existing) via 's'
or 'c' commands respectively hotkeys.

I have "set mbox_type = mbox" in my muttrc to default to creating
mboxes when an existing Maildir/mbox does not exist.

Running "mutt -f /path/to/mbox" lets me localize my work to a certain
patch series.  I normally use the 'e' key from within mutt to then edit
an existing message (patch) with $EDITOR.  A simple change would be to
add an "Acked-by: " tag at the end of the commit message.  Then I can
save and edit the mbox without changing my normal Maildir.

Instead of using mutt + 'e' key to edit patches, I might just edit/view
the mbox directly in my $EDITOR (bypassing mutt completely), and run
"git am" on the whole thing if I'm satisfied.  The mbox is just text,
after all.

Another thing I may do is just apply the patch as-is (via the above mutt
"git am" binding), make changes to the working directory, and use
"git commit --amend" to make further editorial changes to a patch.

Reply via email to