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

Re: [PATCH v2 04/11] contrib: remove "thunderbird-patch-inline"

From
PWPhillip Wood <phillip.wood123@gmail.com>
Date
May 12, 2025, 13:02 UTC
Message-ID
<a3aaa11a-a842-4c10-8189-07b681663573@gmail.com>
In-Reply-To
<87jz6mo4n9.fsf@gmail.com>
Hi Collin
On 12/05/2025 05:05, Collin Funk wrote:
Show 18 quoted lines
> Hi,
> 
> You said:
> 
>> The "thunderbird-patch-inline" directory in "contrib/" contains a script
>> to send patch files via Thunderbird. This script depends on the
>> ExternalEditor extension [1], which seems to be effectively unmaintained
>> with the last update being in 2008. While the extension has eventually
>> been maintained in [2], that fork hasn't received any updates since
>> 2020, either.
>>
>> In addition, the script itself hasn't really seen a lot of maintenance
>> outside of a couple of global cleanups. It is quite unlikely that this
>> setup still works, and if it did it's even less likely that somebody
>> uses this script.
> 
> FWIW, in case it helps any Thunderbird users, there is External Editor
> Revived which seems to work pretty well when I used Thunderbird [1].

Thanks for pointing that out. I noticed that extensional the other day but had not got around to posting it.

> I think this script would be irrelevant with that extension though.

Users who want to post patches using thunderbird would still benefit from the script. It needs tweaking to account for a different separator between the headers and message body though. The patch below does that.

Best Wishes
Phillip
---- >8 ----
From: Phillip Wood <phillip.wood@dunelm.org.uk>
Subject: [PATCH] contrib: update thunderbird-patch-inline

This script uses an extension to run an external editor from thunderbird that is no-longer maintained. Replace it with a different extension that is maintained[1]. The new extension uses a different separator between the mail headers and message body so update the script to accommodate that.

Signed-Off-By: Phillip Wood <phillip.wood@dunelm.org.uk>

[1] https://github.com/Frederick888/external-editor-revived ---

diff --git a/contrib/thunderbird-patch-inline/README b/contrib/thunderbird-patch-inline/README
index 000147bbe4a..aa00b379a60 100644
--- a/contrib/thunderbird-patch-inline/README
+++ b/contrib/thunderbird-patch-inline/README
@@ -1,6 +1,6 @@
-appp.sh is a script that is supposed to be used together with ExternalEditor
-for Mozilla Thunderbird. It will let you include patches inline in e-mails
-in an easy way.
+appp.sh is a script that is supposed to be used together with
+ExternalEditorRevived for Mozilla Thunderbird. It will let you include
+patches inline in e-mails in an easy way.
  
  Usage:
  - Generate the patch with git format-patch.
@@ -14,7 +14,7 @@ will be moved to the section between the --- and the diffstat.
  
  All S-O-B:s and Cc:s in the patch will be added to the CC list.
  
-To set it up, just install External Editor and tell it to use appp.sh as the
-editor.
+To set it up, just install External Editor Revived and tell it to use
+appp.sh as the editor.
  
  Zenity is a required dependency.
diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh
index fdcc9483520..72c37aace4e 100755
--- a/contrib/thunderbird-patch-inline/appp.sh
+++ b/contrib/thunderbird-patch-inline/appp.sh
@@ -1,10 +1,12 @@
  #!/bin/sh
  # Copyright 2008 Lukas Sandström <luksan@gmail.com>
  #
-# AppendPatch - A script to be used together with ExternalEditor
+# AppendPatch - A script to be used together with ExternalEditorRevived
  # for Mozilla Thunderbird to properly include patches inline in e-mails.
  
-# ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2
+# ExternalEditorRevived extension can be installed using the Add-ons
+# manager in thunderbird, the source is available at
+# https://github.com/Frederick888/external-editor-revived
  
  CONFFILE=~/.appprc
  
@@ -25,8 +27,12 @@ fi
  
  cd - > /dev/null
  
+# The headers are separated from the message body by a blanks
+# line. However the message uses CR LF line ending so on platforms
+# where the native line ending is LF we see a line with a single CR.
+SEP="$(printf '^\r\\{0,1\\}$')"
  SUBJECT=$(sed -n -e '/^Subject: /p' "${PATCH}")
-HEADERS=$(sed -e '/^'"${SEP}"'$/,$d' $1)
+HEADERS=$(sed -e "/${SEP}/"',$d' $1)
  BODY=$(sed -e "1,/${SEP}/d" $1)
  CMT_MSG=$(sed -e '1,/^$/d' -e '/^---$/,$d' "${PATCH}")
  DIFF=$(sed -e '1,/^---$/d' "${PATCH}")
@@ -37,7 +43,7 @@ CCS=$(printf '%s\n%s\n' "$CMT_MSG" "$HEADERS" | sed -n -e 's/^Cc: \(.*\)$/\1,/gp
  echo "$SUBJECT" > $1
  echo "Cc: $CCS" >> $1
  echo "$HEADERS" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1
-echo "$SEP" >> $1
+echo >> $1
  
  echo "$CMT_MSG" >> $1
  echo "---" >> $1
Previous: Collin FunkNext: Patrick Steinhardt
Message 51 of 62 in “Spring cleanup of "contrib/"”
  1. 00/10 Spring cleanup of "contrib/"Patrick Steinhardt, May 6, 2025
  2. 02/10 contrib: remove "examples" directoryPatrick Steinhardt, May 6, 2025
  3. 01/10 contrib: remove "remotes2config.sh"Patrick Steinhardt, May 6, 2025
  4. Junio C HamanoMay 6, 2025
  5. Patrick SteinhardtMay 7, 2025
  6. Junio C HamanoMay 7, 2025
  7. 03/10 contrib: remove remote-helper stubsPatrick Steinhardt, May 6, 2025
  8. 04/10 contrib: remove "thunderbird-patch-inline"Patrick Steinhardt, May 6, 2025
  9. 05/10 contrib: remove "hooks" directoryPatrick Steinhardt, May 6, 2025
  10. 06/10 contrib: remove "mw-to-git"Patrick Steinhardt, May 6, 2025
  11. Junio C HamanoMay 6, 2025
  12. Matthieu MoyMay 7, 2025
  13. 08/10 contrib: remove "git-resurrect.sh"Patrick Steinhardt, May 6, 2025
  14. Junio C HamanoMay 6, 2025
  15. Patrick SteinhardtMay 7, 2025
  16. Junio C HamanoMay 7, 2025
  17. Kristoffer HaugsbakkMay 7, 2025
  18. 09/10 contrib: remove "emacs" directoryPatrick Steinhardt, May 6, 2025
  19. Junio C HamanoMay 6, 2025
  20. 07/10 contrib: remove "persistent-https" remote helperPatrick Steinhardt, May 6, 2025
  21. Junio C HamanoMay 6, 2025
  22. 10/10 contrib: remove "git-new-workdir"Patrick Steinhardt, May 6, 2025
  23. Junio C HamanoMay 6, 2025
  24. Patrick SteinhardtMay 7, 2025
  25. Junio C HamanoMay 7, 2025
  26. Patrick SteinhardtMay 9, 2025
  27. Junio C HamanoMay 6, 2025
  28. Eric SunshineMay 6, 2025
  29. Todd ZullingerMay 7, 2025
  30. Eric SunshineMay 7, 2025
  31. Patrick SteinhardtMay 7, 2025
  32. D. Ben KnobleMay 10, 2025
  33. Phillip WoodMay 12, 2025
  34. 00/11 Spring cleanup of "contrib/"Patrick Steinhardt, May 9, 2025
  35. 01/11 contrib: remove "remotes2config.sh"Patrick Steinhardt, May 9, 2025
  36. 02/11 contrib: remove "examples" directoryPatrick Steinhardt, May 9, 2025
  37. 03/11 contrib: remove remote-helper stubsPatrick Steinhardt, May 9, 2025
  38. 04/11 contrib: remove "thunderbird-patch-inline"Patrick Steinhardt, May 9, 2025
  39. 05/11 contrib: remove "hooks" directoryPatrick Steinhardt, May 9, 2025
  40. 06/11 contrib: remove "mw-to-git"Patrick Steinhardt, May 9, 2025
  41. 08/11 contrib: remove "git-resurrect.sh"Patrick Steinhardt, May 9, 2025
  42. 07/11 contrib: remove "persistent-https" remote helperPatrick Steinhardt, May 9, 2025
  43. 09/11 contrib: remove "emacs" directoryPatrick Steinhardt, May 9, 2025
  44. 10/11 contrib: remove "git-new-workdir"Patrick Steinhardt, May 9, 2025
  45. 11/11 contrib: remove "stats" directoryPatrick Steinhardt, May 9, 2025
  46. Elijah NewrenMay 9, 2025
  47. Elijah NewrenMay 9, 2025
  48. Junio C HamanoMay 10, 2025
  49. Patrick SteinhardtMay 12, 2025
  50. Collin FunkMay 12, 2025
  51. Phillip WoodMay 12, 2025
  52. Patrick SteinhardtMay 12, 2025
  53. Junio C HamanoMay 12, 2025
  54. Phillip WoodMay 14, 2025
  55. contrib: update thunderbird-patch-inlinePhillip Wood, May 16, 2025
  56. Kristoffer HaugsbakkMay 16, 2025
  57. Patrick SteinhardtMay 19, 2025
  58. Collin FunkMay 19, 2025
  59. Phillip WoodMay 19, 2025
  60. Junio C HamanoJun 3, 2025
  61. Junio C HamanoMay 19, 2025
  62. Peter KreftingMay 10, 2025

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.