[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: Sending patch with Gnus
From: |
Leo |
Subject: |
Re: Sending patch with Gnus |
Date: |
Thu, 16 Dec 2010 13:07:29 +0000 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/23.2.91 (Mac OS X 10.6.5) |
On 2010-12-16 10:01 +0000, Francis Moreau wrote:
> Leo <address@hidden> 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
gitmail.el
Description: application/emacs-lisp
- Re: Sending patch with Gnus, Lars Magne Ingebrigtsen, 2010/12/15
- Re: Sending patch with Gnus, Thierry Volpiatto, 2010/12/15
- Re: Sending patch with Gnus, Lars Magne Ingebrigtsen, 2010/12/16
- Message not available
- Re: Sending patch with Gnus, Lars Magne Ingebrigtsen, 2010/12/16
- Re: Sending patch with Gnus, Štěpán Němec, 2010/12/17
- Re: Sending patch with Gnus, Francis Moreau, 2010/12/17
- Re: Sending patch with Gnus, Reiner Steib, 2010/12/18
- Re: Sending patch with Gnus, Štěpán Němec, 2010/12/19
Re: Sending patch with Gnus, Tassilo Horn, 2010/12/15