Gnus development mailing list
 help / color / mirror / Atom feed
From: Leo <sdl.web@gmail.com>
To: Francis Moreau <francis.moro@gmail.com>
Cc: emacs-devel@gnu.org, ding@gnus.org,
	Thierry Volpiatto <thierry.volpiatto@gmail.com>
Subject: Re: Sending patch with Gnus
Date: Thu, 16 Dec 2010 13:07:29 +0000	[thread overview]
Message-ID: <m1sjxx50j2.fsf@cam.ac.uk> (raw)
In-Reply-To: <m2aak6vxy1.fsf@gmail.com> (Francis Moreau's message of "Thu, 16 Dec 2010 11:01:10 +0100")

[-- Attachment #1: Type: text/plain, Size: 3658 bytes --]

On 2010-12-16 10:01 +0000, Francis Moreau wrote:
> Leo <sdl.web@gmail.com> writes:
>
> [...]
>
>>
>> I tweaked gnus-dired to support git-send-email (patches attached).
>
> Thanks for doing that.
>
> Unfortunately your patches don't seem to be based on Gnus repository but
> rather to emacs one that I don't have. So I can't test them.

OK, I put it in a separate file as attached.

>> So if you have gnus-dired loaded you can in dired buffer:
>>
>> C-c C-m C-i    import patches as DRAFTS
>> C-c C-m C-s    send patches directly
>>
>> This is handy when you need to send a large patch set. For one to two
>> patches I just copy and paste.
>
> Funny because I feel the opposite, I use git-send-email(1) when dealing
> with a large patch set since the overhead to set it up is ok in this
> case. But for one patch, I do it by hands as you do, but I would prefer
> to not have editing the email manually.
>
> But I think, your approach can still be usefull since it imports patches
> as _drafts_. I don't think it's a good idea to modify the patch itself,
> but modifying or adding some header fields like To, Cc, Bcc... should be
> ok. And I like to check what the patch looks like before sending it.
>
> One other idea is to generate one or several drafts from a buffer which
> contains one or several mbox files. Let's call the magic command: M-x
> create-draft-from-buffer (yeah the name sucks).
>
> With such command, one could do in an emacs session:
>
>   M-! git format-patch --stdout HEAD~4
>   C-x o
>   M-x create-draft-from-buffer
>
> So you're putting in the *Shell Command Output* buffer the mbox files,
> and then switching to that buffer and generating the drafts. The main
> advantages I see is that you use a shell command to generate the buffer
> containing the patches.
>
> BTW, if you needn't to modify the patches and only want to see them
> before sending them then you can currently do this:
>
>   M-! git format-patch --stdout HEAD~4 >/tmp/patch-set.mbox
>   C-x b *Group*
>   G f /tmp/patch-set.mbox
>
> This will create a nndoc group which contains all your patches as
> articles.
>
> Then you can mark all of them and resend them with 'S D r'. But you
> can't add Cc or Gcc header fields with this method.

Now we have four commands (not bound to any keys for the moment)

  gitmail-import-mbox-as-draft
  gitmail-send-mbox
  gitmail-send-mbox-buffer
  gitmail-import-mbox-buffer

Editing drafts in Gnus resets the date so you need this small patch (or
is there a butter way to handle this?):

diff --git a/lisp/gnus/gnus-draft.el b/lisp/gnus/gnus-draft.el
index 1e6b7ee..d9aa2f2 100644
--- a/lisp/gnus/gnus-draft.el
+++ b/lisp/gnus/gnus-draft.el
@@ -102,7 +102,8 @@
     (save-excursion
       (save-restriction
 	(message-narrow-to-headers)
-	(message-remove-header "date")))
+	(unless (message-fetch-field "x-draft-keep-date")
+	  (message-remove-header "date"))))
     (let ((message-draft-headers
 	   (delq 'Date (copy-sequence message-draft-headers))))
       (save-buffer))
	Modified lisp/gnus/message.el
diff --git a/lisp/gnus/message.el b/lisp/gnus/message.el
index 214ac0b..686f21b 100644
--- a/lisp/gnus/message.el
+++ b/lisp/gnus/message.el
@@ -269,7 +269,7 @@ included.  Organization and User-Agent are optional."
 		 regexp))
 
 (defcustom message-ignored-mail-headers
-  "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Gnus-Agent-Meta-Information:"
+  "^[GF]cc:\\|^Resent-Fcc:\\|^Xref:\\|^X-Draft-From:\\|^X-Draft-Keep-Date:\\|^X-Gnus-Agent-Meta-Information:"
   "*Regexp of headers to be removed unconditionally before mailing."
   :group 'message-mail
   :group 'message-headers

-- 
Oracle is the new evil

[-- Attachment #2: gitmail.el --]
[-- Type: application/emacs-lisp, Size: 5793 bytes --]

  reply	other threads:[~2010-12-16 13:07 UTC|newest]

Thread overview: 33+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-12-15 16:05 Francis Moreau
2010-12-15 19:21 ` Lars Magne Ingebrigtsen
2010-12-15 21:11   ` Thierry Volpiatto
2010-12-15 21:50     ` Francis Moreau
2010-12-15 21:54       ` Lars Magne Ingebrigtsen
2010-12-15 22:13         ` Francis Moreau
2010-12-16  6:09     ` Leo
2010-12-16 10:01       ` Francis Moreau
2010-12-16 13:07         ` Leo [this message]
2010-12-16 13:12           ` Leo
2010-12-16 20:20           ` Francis Moreau
2010-12-17  0:53         ` Rupert Swarbrick
2010-12-17  1:03           ` "Purging" nndoc group, was: " Rupert Swarbrick
2010-12-17  7:52           ` Francis Moreau
2010-12-17  8:02             ` Rupert Swarbrick
2010-12-17  8:14               ` Francis Moreau
2010-12-17 16:30           ` Lars Magne Ingebrigtsen
2010-12-17 19:54             ` Francis Moreau
2010-12-17 19:57               ` Lars Magne Ingebrigtsen
2010-12-17 20:04                 ` Francis Moreau
2010-12-17 20:14                   ` Štěpán Němec
2010-12-16 15:53       ` Lars Magne Ingebrigtsen
2010-12-16 17:16         ` Leo
2010-12-16 17:19           ` Lars Magne Ingebrigtsen
2010-12-17  6:29             ` Štěpán Němec
2010-12-17  7:33               ` Francis Moreau
2010-12-18 20:34               ` Reiner Steib
2010-12-19  6:50                 ` Štěpán Němec
2010-12-17 10:01             ` Leo
2010-12-15 21:27   ` Tassilo Horn
2010-12-15 21:41     ` Francis Moreau
2010-12-15 22:06       ` Tassilo Horn
2010-12-15 22:27         ` Francis Moreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=m1sjxx50j2.fsf@cam.ac.uk \
    --to=sdl.web@gmail.com \
    --cc=ding@gnus.org \
    --cc=emacs-devel@gnu.org \
    --cc=francis.moro@gmail.com \
    --cc=thierry.volpiatto@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).