[libvirt] patch submission: git send-email, format-patch or git diff

Jim Meyering jim at meyering.net
Mon May 3 09:16:54 UTC 2010


Kenneth Nagin wrote:
>>Cole Robinson <crobinso at redhat.com> wrote on 30/04/2010 15:42:05:
>> From: Cole Robinson <crobinso at redhat.com>
>> To: Kenneth Nagin/Haifa/IBM at IBMIL
>> Cc: "Daniel P. Berrange" <berrange at redhat.com>, list libvirt
>> <libvir-list at redhat.com>, Daniel Veillard <veillard at redhat.com>
>> Date: 30/04/2010 15:42
>> Subject: Re: [libvirt] (Resend) Live Migration with non-shared storage
> for kvm
>
>> Finding a way to post the patch in-line will also probably get better
>> attention: just pasting it into the mail client will probably mangle the
>> patch, I'd recommend git send-email.

> I'm new to git so I suspect that I don't understand the proper method for
> patch submission.  But this is the problem that I see with your suggestion.
> git send-email implies usage of git-format-patch.  But git-format-patch
> creates a set of files one per commit.

If (and this is a big "if") your mail client does not split lines
or mangle white space, it's ok to use e.g.,

    git format-patch --stdout -1 > FILE

and then to insert FILE in the body of your message.
That will put the single, most recent change-set in FILE.

If you want to submit a series of N (say N=5) change sets,
you can s/-1/-5/:

    git format-patch --stdout -5 > FILE

still assuming that the 5 most recent change sets are the ones you want.

Regarding your mail client, you should try it first
by sending yourself a patch.  When you receive it, save
the patch to a file, say PATCH, removing any ">" that were prepended
to "From" lines, and then run "git checkout master; git am PATCH" and
ensure that that succeeds.  If there is any problem, go back to square 1
and either fix your client or use git send-email...

Using "git send-email" is similar, but makes it easier for
the recipient/reviewer to apply your patch.

> However,  don't you want to submit the diff between the changed code and
> the master, i.e. git diff master > patch?

Yes.  Typically I copy the 00* patch files into an empty
directory, cd into that directory and then run this:

    git send-email --compose --to=libvir-list at redhat.com 00*

Be sure that you've set this in your ~/.gitconfig:

    git config --global sendemail.chainreplyto no




More information about the libvir-list mailing list