git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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
Previous: Alejandro ColomarNext: Alejandro Colomar
Message 6 of 17 in “git-send-email: Send with mutt(1)”
  1. Alejandro ColomarNov 7, 2023
  2. Jeff KingNov 7, 2023
  3. Alejandro ColomarNov 7, 2023
  4. Jeff KingNov 7, 2023
  5. Alejandro ColomarNov 8, 2023
  6. Jeff KingNov 8, 2023
  7. Alejandro ColomarNov 9, 2023
  8. Konstantin RyabitsevNov 9, 2023
  9. Alejandro ColomarNov 9, 2023
  10. Konstantin RyabitsevNov 9, 2023
  11. Alejandro ColomarNov 10, 2023
  12. Jeff KingNov 9, 2023
  13. Alejandro ColomarNov 9, 2023
  14. Alejandro ColomarNov 10, 2023
  15. Alejandro ColomarNov 10, 2023
  16. Jeff KingNov 10, 2023
  17. Junio C HamanoNov 10, 2023

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.