Re: git-send-email: Send with mutt(1)
- From
Jeff King <peff@peff.net>
- Date
- Nov 8, 2023, 21:27 UTC
- Message-ID
- <20231108212702.GA1586965@coredump.intra.peff.net>
- In-Reply-To
- <ZUv3gjjmuqvCaJEd@debian>
On Wed, Nov 08, 2023 at 10:02:52PM +0100, Alejandro Colomar wrote:
Show 8 quoted lines
> > That seems like a reasonable feature. Probably it should be > > --cc-from-trailer=signed-off-by, and then you could do the same with > > other trailers. > > That would work for me. I only suggested the other one because it's > aleady in send-email in that form. But yeah, it might be useful to have > finer control. In my case, something that CCs every mail in the trailer > would work (Reviewed-by, Suggested-by, ... I want them all, always).
Oh, I didn't realize it existed in send-email. I am showing my ignorance of it. ;)
Show 9 quoted lines
> > # 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.
Show 6 quoted lines
> 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.
> 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.
-Peff