{"thread":{"id":"6865","subject":"format-patch and send-email","startedAt":"2007-02-18T08:49:54Z","lastAt":"2007-02-18T18:17:25Z","messageCount":3,"participants":["Xavier Maillard","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"34945","messageId":"5680.1171788594@localhost","threadId":"6865","inReplyTo":null,"subject":"format-patch and send-email","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-02-18T08:49:54Z","receivedAt":"2007-02-18T08:49:54Z","isPatch":false,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"Hi,\n\nI tried to use format-patch and send-email but I think I am\nmisusing them because it does not react as I would expect.\n\nFirst, here is how git log looks like on my little repository:\n\ncommit 50c7032fa011b1e5c7bd63e4bc474c802017677d\nAuthor: Xavier Maillard <zedek@gnu.org>\nDate:   Fri Feb 16 20:20:18 2007 +0100\n\n    * Added 2007 to the copyright notice\n    * Added a note on relation between org-publish and blorg\n    * Changed/corrected things here and there\n    * Added a warning on needed skills before manipulating your own templates\n\ncommit 0e35f7847c7becc52ebcd51d9b043c626f9b3b3f\nAuthor: Xavier Maillard <zedek@gnu.org>\nDate:   Fri Feb 16 20:03:42 2007 +0100\n\n    new file: doc/blorg.texi (original version)\n\nNow I want to extract a patch and set it ready to be sent (I\nadded head -20 just to illustrate my problem):\n\ngit-format-patch --stdout -k 0e35f7847c7becc52ebcd51d9b043c626f9b3b3f | head -12\n\n\n>From 50c7032fa011b1e5c7bd63e4bc474c802017677d Mon Sep 17 00:00:00 2001\nFrom: Xavier Maillard <zedek@gnu.org>\nDate: Fri, 16 Feb 2007 20:20:18 +0100\nSubject: * Added 2007 to the copyright notice\nTo: <maillaxa@gmail.com>\n* Added a note on relation between org-publish and blorg\n* Changed/corrected things here and there\n* Added a warning on needed skills before manipulating your own templates\n---\n doc/blorg.texi |   31 +++++++++++++++++++------------\n 1 files changed, 19 insertions(+), 12 deletions(-)\n\nThe \"To\" header has been set up in my .git/config file. But why\nthe 'Subject' is like this and also why are there 2 'From'\nheaders ?\n\nActually, why can't I just do like this ? :\n\ngit format-patch <origin> | git send-email ?\n\nThank you for your explanations.\n\nXavier\n"},{"id":"34948","messageId":"7vps87hlbp.fsf@assigned-by-dhcp.cox.net","threadId":"6865","inReplyTo":"5680.1171788594@localhost","subject":"Re: format-patch and send-email","fromName":"Junio C Hamano","fromEmail":"junkio@cox.net","sentAt":"2007-02-18T09:22:18Z","receivedAt":"2007-02-18T09:22:18Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Xavier Maillard <zedek@gnu.org> writes:\n\n> From 50c7032fa011b1e5c7bd63e4bc474c802017677d Mon Sep 17 00:00:00 2001\n> From: Xavier Maillard <zedek@gnu.org>\n> Date: Fri, 16 Feb 2007 20:20:18 +0100\n> Subject: * Added 2007 to the copyright notice\n> To: <maillaxa@gmail.com>\n> * Added a note on relation between org-publish and blorg\n> * Changed/corrected things here and there\n> * Added a warning on needed skills before manipulating your own templates\n> ---\n>  doc/blorg.texi |   31 +++++++++++++++++++------------\n>  1 files changed, 19 insertions(+), 12 deletions(-)\n\n> The \"To\" header has been set up in my .git/config file. But why\n> the 'Subject' is like this and also why are there 2 'From'\n> headers ?\n\nThe \"format-patch\" output was designed to (minimally) mimic what\nyou would see in a UNIX mbox as if you (or whoever would apply\nthe e-mailed patches to repository) received it, so that anybody\ncan later run \"am\" on it.  The first \"From \" is what sometimes\nis called \"UNIX-From \" line, which separates each piece of\ne-mail in mbox formatted mailbox file.  The second one is used\nto record the author of the patch.\n\nThe commit log message is expected to be:\n\n\tA single line description of a patch\n\n\tMore detailed explanation of the patch with\n        possibly multi-line or multi-paragraph text.\n\nand the single line description becomes the subject.\n\nYour commit seems to squash four completely unrelated changes\ninto one, and enumerates only single-liner description for each\nindependent item, like this:\n\n\t* foo\n        * bar\n        * baz\n        * boa\n\nwhich makes format-patch think you wanted to title it \"* foo\"\nwith more detailed description \"* bar *baz *boa\".  I think you\nwould be much happier if you acquired a habit to make smaller\ncommits, that touch only one thing at a time without mixing up\nunrelated things together, and give more descriptive messages to\neach of them.\n\n> Actually, why can't I just do like this ? :\n>\n> git format-patch <origin> | git send-email ?\n\nWhile I know format-patch can be told to write to standard\noutput, I do not know if send-email can be told to read from the\nstandard input (I do not use send-email myself).  Some people\nseem to use send-imap to stuff format-patch output to imap\ndrafts.  I just read format-patch output into message\ncomposition buffer of my MUA (message mode of Emacs) and send it\nout just as an ordinary e-mail (iow, as if I typed it).  In\nother words, you do not have to use send-email as-is, if what it\ndoes does not suit your needs.\n\nI suspect the intended usage original author of \"send-email\"\nenvisioned was to have lots of format-patch output files and\nsend them in bulk, so probably reading from standard input was\nnot high on its design goals.  I dunno.\n\nWhile I do believe some people use it, I haven't seen much\nactive development/enhancement on send-email from the users\nlately.\n"},{"id":"34963","messageId":"9388.1171822645@localhost","threadId":"6865","inReplyTo":"7vps87hlbp.fsf@assigned-by-dhcp.cox.net","subject":"Re: format-patch and send-email","fromName":"Xavier Maillard","fromEmail":"zedek@gnu.org","sentAt":"2007-02-18T18:17:25Z","receivedAt":"2007-02-18T18:17:25Z","isPatch":false,"sender":{"key":"zedek@gnu.org","avatar":null},"body":"Hi Junio,\n\nJunio C Hamano <junkio@cox.net> wrote:\n\n> Xavier Maillard <zedek@gnu.org> writes:\n>\n>> [SNIP SNIP] \n> \n> The \"format-patch\" output was designed to (minimally) mimic what\n> you would see in a UNIX mbox as if you (or whoever would apply\n> the e-mailed patches to repository) received it, so that anybody\n> can later run \"am\" on it.  The first \"From \" is what sometimes\n> is called \"UNIX-From \" line, which separates each piece of\n> e-mail in mbox formatted mailbox file.  The second one is used\n> to record the author of the patch.\n> \n> The commit log message is expected to be:\n> \n> \tA single line description of a patch\n> \n> \tMore detailed explanation of the patch with\n>         possibly multi-line or multi-paragraph text.\n> \n> and the single line description becomes the subject.\n\nOk so I need to revert my usual practise :)\n\n \nThank you for your answers. I know have understood what was wrong\n;)\n\nRegards,\n\nXavier\n"}]}