tools.linux.kernel.org archive mirror
 help / color / mirror / Atom feed
From: "Konstantin Ryabitsev" <konstantin@linuxfoundation.org>
To: Philippe Blain <levraiphilippeblain@gmail.com>
Cc: tools@linux.kernel.org
Subject: Re: [b4] make 'b4 mbox' reorder headers so piping to 'git imap-send' works
Date: Mon, 21 Dec 2020 12:03:47 -0500	[thread overview]
Message-ID: <20201221170347.agxrsnalgvinjisj@chatter.i7.local> (raw)
In-Reply-To: <7e6329fa-e5fa-c5af-002d-a8fbb60e0724@gmail.com>

On Sun, Dec 20, 2020 at 07:21:43PM -0500, Philippe Blain wrote:
> Hi,
> 
> I'm using 'b4 mbox -o- <url> | git imap-send' to quickly import
> threads to my email account when I see an interesting thread that
> I'd like to reply to (I contribute to Git but I'm not subscribed to the
> Git mailing list).
> 
> This only works if the emails in the threads have the 'From', 'Date'
> and 'Subject' headers in exactly that order, because that order is
> hard-coded in 'git imap-send' [1]. I wrote a small script [2] that
> just reads the headers and reorders them accordingly but I'd like to
> just use 'b4 mbox' instead as it has more features. However I discovered
> that such reordering is not done by b4. For example, this fails as 'git imap-send'
> reports 'nothing to send':
> 
> b4 mbox -o- https://lore.kernel.org/git/op.0vvmwohypvqxoc@damia/T/#u | git imap-send
> 
> It would be nice if b4 would take care of the reordering.

I'm not sure that's a great solution, as you may be hitting other weird
corner-cases with git-imap-send. I suggest using isync/mbsync for this
purpose. I just added a tweak to b4 mbox that will recognize when -o receives
a maildir, in which case instead of saving an .mbox file, it will add messages
to the maildir instead, e.g.:

  b4 mbox -o ~/Mail [msgid]

This will add all messages from the retrieved thread to the mail spool in
~/Mail (assuming it has the expected {new,cur,tmp} subdirs).

Regards,
-K

  reply	other threads:[~2020-12-21 17:03 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-21  0:21 [b4] make 'b4 mbox' reorder headers so piping to 'git imap-send' works Philippe Blain
2020-12-21 17:03 ` Konstantin Ryabitsev [this message]
     [not found] ` <1652CA1A4BC02C6D.17984@linux.kernel.org>
2020-12-21 19:03   ` [tools] " Konstantin Ryabitsev

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=20201221170347.agxrsnalgvinjisj@chatter.i7.local \
    --to=konstantin@linuxfoundation.org \
    --cc=levraiphilippeblain@gmail.com \
    --cc=tools@linux.kernel.org \
    /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).