git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* format-patch and send-email
@ 2007-02-18  8:49 Xavier Maillard
  2007-02-18  9:22 ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Xavier Maillard @ 2007-02-18  8:49 UTC (permalink / raw)
  To: git

Hi,

I tried to use format-patch and send-email but I think I am
misusing them because it does not react as I would expect.

First, here is how git log looks like on my little repository:

commit 50c7032fa011b1e5c7bd63e4bc474c802017677d
Author: Xavier Maillard <zedek@gnu.org>
Date:   Fri Feb 16 20:20:18 2007 +0100

    * Added 2007 to the copyright notice
    * Added a note on relation between org-publish and blorg
    * Changed/corrected things here and there
    * Added a warning on needed skills before manipulating your own templates

commit 0e35f7847c7becc52ebcd51d9b043c626f9b3b3f
Author: Xavier Maillard <zedek@gnu.org>
Date:   Fri Feb 16 20:03:42 2007 +0100

    new file: doc/blorg.texi (original version)

Now I want to extract a patch and set it ready to be sent (I
added head -20 just to illustrate my problem):

git-format-patch --stdout -k 0e35f7847c7becc52ebcd51d9b043c626f9b3b3f | head -12


>From 50c7032fa011b1e5c7bd63e4bc474c802017677d Mon Sep 17 00:00:00 2001
From: Xavier Maillard <zedek@gnu.org>
Date: Fri, 16 Feb 2007 20:20:18 +0100
Subject: * Added 2007 to the copyright notice
To: <maillaxa@gmail.com>
* Added a note on relation between org-publish and blorg
* Changed/corrected things here and there
* Added a warning on needed skills before manipulating your own templates
---
 doc/blorg.texi |   31 +++++++++++++++++++------------
 1 files changed, 19 insertions(+), 12 deletions(-)

The "To" header has been set up in my .git/config file. But why
the 'Subject' is like this and also why are there 2 'From'
headers ?

Actually, why can't I just do like this ? :

git format-patch <origin> | git send-email ?

Thank you for your explanations.

Xavier

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: format-patch and send-email
  2007-02-18  8:49 format-patch and send-email Xavier Maillard
@ 2007-02-18  9:22 ` Junio C Hamano
  2007-02-18 18:17   ` Xavier Maillard
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2007-02-18  9:22 UTC (permalink / raw)
  To: Xavier Maillard; +Cc: git

Xavier Maillard <zedek@gnu.org> writes:

> From 50c7032fa011b1e5c7bd63e4bc474c802017677d Mon Sep 17 00:00:00 2001
> From: Xavier Maillard <zedek@gnu.org>
> Date: Fri, 16 Feb 2007 20:20:18 +0100
> Subject: * Added 2007 to the copyright notice
> To: <maillaxa@gmail.com>
> * Added a note on relation between org-publish and blorg
> * Changed/corrected things here and there
> * Added a warning on needed skills before manipulating your own templates
> ---
>  doc/blorg.texi |   31 +++++++++++++++++++------------
>  1 files changed, 19 insertions(+), 12 deletions(-)

> The "To" header has been set up in my .git/config file. But why
> the 'Subject' is like this and also why are there 2 'From'
> headers ?

The "format-patch" output was designed to (minimally) mimic what
you would see in a UNIX mbox as if you (or whoever would apply
the e-mailed patches to repository) received it, so that anybody
can later run "am" on it.  The first "From " is what sometimes
is called "UNIX-From " line, which separates each piece of
e-mail in mbox formatted mailbox file.  The second one is used
to record the author of the patch.

The commit log message is expected to be:

	A single line description of a patch

	More detailed explanation of the patch with
        possibly multi-line or multi-paragraph text.

and the single line description becomes the subject.

Your commit seems to squash four completely unrelated changes
into one, and enumerates only single-liner description for each
independent item, like this:

	* foo
        * bar
        * baz
        * boa

which makes format-patch think you wanted to title it "* foo"
with more detailed description "* bar *baz *boa".  I think you
would be much happier if you acquired a habit to make smaller
commits, that touch only one thing at a time without mixing up
unrelated things together, and give more descriptive messages to
each of them.

> Actually, why can't I just do like this ? :
>
> git format-patch <origin> | git send-email ?

While I know format-patch can be told to write to standard
output, I do not know if send-email can be told to read from the
standard input (I do not use send-email myself).  Some people
seem to use send-imap to stuff format-patch output to imap
drafts.  I just read format-patch output into message
composition buffer of my MUA (message mode of Emacs) and send it
out just as an ordinary e-mail (iow, as if I typed it).  In
other words, you do not have to use send-email as-is, if what it
does does not suit your needs.

I suspect the intended usage original author of "send-email"
envisioned was to have lots of format-patch output files and
send them in bulk, so probably reading from standard input was
not high on its design goals.  I dunno.

While I do believe some people use it, I haven't seen much
active development/enhancement on send-email from the users
lately.

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: format-patch and send-email
  2007-02-18  9:22 ` Junio C Hamano
@ 2007-02-18 18:17   ` Xavier Maillard
  0 siblings, 0 replies; 3+ messages in thread
From: Xavier Maillard @ 2007-02-18 18:17 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

Hi Junio,

Junio C Hamano <junkio@cox.net> wrote:

> Xavier Maillard <zedek@gnu.org> writes:
>
>> [SNIP SNIP] 
> 
> The "format-patch" output was designed to (minimally) mimic what
> you would see in a UNIX mbox as if you (or whoever would apply
> the e-mailed patches to repository) received it, so that anybody
> can later run "am" on it.  The first "From " is what sometimes
> is called "UNIX-From " line, which separates each piece of
> e-mail in mbox formatted mailbox file.  The second one is used
> to record the author of the patch.
> 
> The commit log message is expected to be:
> 
> 	A single line description of a patch
> 
> 	More detailed explanation of the patch with
>         possibly multi-line or multi-paragraph text.
> 
> and the single line description becomes the subject.

Ok so I need to revert my usual practise :)

 
Thank you for your answers. I know have understood what was wrong
;)

Regards,

Xavier

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-02-18 18:20 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-02-18  8:49 format-patch and send-email Xavier Maillard
2007-02-18  9:22 ` Junio C Hamano
2007-02-18 18:17   ` Xavier Maillard

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).