git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Alejandro Colomar <alx@kernel.org>
To: Jeff King <peff@peff.net>
Cc: git@vger.kernel.org
Subject: Re: git-send-email: Send with mutt(1)
Date: Thu, 9 Nov 2023 16:26:23 +0100	[thread overview]
Message-ID: <ZUz6H3IqRc1YGPZM@debian> (raw)
In-Reply-To: <20231108212702.GA1586965@coredump.intra.peff.net>

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

Hi Jeff,

On Wed, Nov 08, 2023 at 04:27:02PM -0500, Jeff King wrote:
> > > # spool the message to a fake mbox; we need to add
> > > # a "From" line to make it look legit
> > > trap 'rm -f to-send' 0 &&
> > > {
> > >   echo "From whatever Mon Sep 17 00:00:00 2001" &&
> > >   cat
> > > } >to-send &&
> > 
> > Would a named pipe work?  Or maybe we could use $(mktemp)?
> 
> I suspect mutt wants it to be a real file. But yeah, mktemp would
> definitely work. I actually started to write it that way but switched to
> a static name for simplicity in demonstrating the idea. :)
> 
> One note, though. Later we need to pass this filename to mutt config:
> 
> > > mutt -p \
> > >   -e 'set postponed=to-send' \
> 
> so it's a potential worry if "mktemp" might use a path with spaces or
> funny characters (e.g., from $TMPDIR). Probably not much of a problem in
> practice, though.
> 
> > Huh, this is magic sauce!  Works perfect for what I need.  This would
> > need to be packaged to the masses.  :-)
> > 
> > I found a minor problem: If I ctrl+C within mutt(1), I expect it to
> > cancel the last action, but this script intercepts the signal and exits.
> > We would probably need to ignore SIGINT from mutt-as-mta.
> 
> Yeah, that might make sense, and can be done with trap.

I've tried something even simpler:

---8<---
#!/bin/sh

mutt -H -;
--->8---

I used it for sending a couple of patches to linux-man@, and it seems to
work.  I don't have much experience with mutt, so maybe I'm missing some
corner cases.  Do you expect it to not work for some case?  Otherwise,
we might have a winner.  :)

> 
> > Would you mind adding this as part of git?  Or should we suggest the
> > mutt project adding this script?
> 
> IMHO it is a little too weird and user-specific to really make sense in
> either project. It's really glue-ing together two systems. And as it's
> not something I use myself, I don't plan it moving it further along. But
> you are welcome to take what I wrote and do what you will with it,
> including submitting it to mutt.

I'll start by creating a git repository in my own server, and will write
something about it to let the public know about it.  I'll also start
requiring contributors to linux-man@ to sign their patches, and
recommend them using this if they use mutt(1).

Cheers,
Alex

-- 
<https://www.alejandro-colomar.es/>

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2023-11-09 15:26 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-11-07 11:14 git-send-email: Send with mutt(1) Alejandro Colomar
2023-11-07 17:48 ` Jeff King
2023-11-07 18:36   ` Alejandro Colomar
2023-11-07 20:16     ` Jeff King
2023-11-08 21:02       ` Alejandro Colomar
2023-11-08 21:27         ` Jeff King
2023-11-09 15:26           ` Alejandro Colomar [this message]
2023-11-09 16:08             ` Konstantin Ryabitsev
2023-11-09 17:42               ` Alejandro Colomar
2023-11-09 17:59                 ` Konstantin Ryabitsev
2023-11-10 21:06                   ` Alejandro Colomar
2023-11-09 18:03             ` Jeff King
2023-11-09 23:00               ` Alejandro Colomar
2023-11-10  0:51               ` Alejandro Colomar
2023-11-10 13:30                 ` Alejandro Colomar
2023-11-10 21:41                   ` Jeff King
2023-11-10 23:31                   ` Junio C Hamano

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=ZUz6H3IqRc1YGPZM@debian \
    --to=alx@kernel.org \
    --cc=git@vger.kernel.org \
    --cc=peff@peff.net \
    /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).