{"thread":{"id":"31396","subject":"[PATCH v4] Thunderbird: fix appp.sh format problems","startedAt":"2012-08-31T14:09:30Z","lastAt":"2012-09-05T06:30:27Z","messageCount":21,"participants":["Marco Stornelli","Junio C Hamano","Johannes Sixt"],"isPatch":true,"patchVersion":4,"patchTotal":null},"messages":[{"id":"198145","messageId":"5040C59A.6090303@gmail.com","threadId":"31396","inReplyTo":null,"subject":"[PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-08-31T14:09:30Z","receivedAt":"2012-08-31T14:09:30Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"The current script has got the following problems:\n\n1) It doesn't work if the language used by Thunderbird is not english;\n2) The field To: filled by format-patch is not evaluated;\n3) The field Cc: is loaded from Cc used in the commit message\ninstead of using the Cc field filled by format-patch in the email\nheader.\n\nAdded comments for point 1), added parsing of To: for point 2) and\nadded parsing of Cc: in the email header for point 3), removing the\nCc: parsing from commit message.\n\nSigned-off-by: Marco Stornelli <marco.stornelli@gmail.com>\n---\n\nv4: create a tmp file to allow correct perl parsing\nv3: parse only To: and Cc: in the email header, fix some comments\nv2: changed the commit message to reflect better the script implementation\nv1: first draft\n\n contrib/thunderbird-patch-inline/appp.sh |   26 ++++++++++++++++++++++----\n 1 files changed, 22 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh\nindex 5eb4a51..0daeb29 100755\n--- a/contrib/thunderbird-patch-inline/appp.sh\n+++ b/contrib/thunderbird-patch-inline/appp.sh\n@@ -6,6 +6,9 @@\n \n # ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2\n \n+# NOTE: You must change some words in this script according to the language\n+# used by Mozilla Thunderbird, as <Subject>, <To>, <Don't remove this line>.\n+\n CONFFILE=~/.appprc\n \n SEP=\"-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-\"\n@@ -26,17 +29,32 @@ fi\n cd - > /dev/null\n \n SUBJECT=`sed -n -e '/^Subject: /p' \"${PATCH}\"`\n-HEADERS=`sed -e '/^'\"${SEP}\"'$/,$d' $1`\n BODY=`sed -e \"1,/${SEP}/d\" $1`\n CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' \"${PATCH}\"`\n DIFF=`sed -e '1,/^---$/d' \"${PATCH}\"`\n+MAILHEADER=`sed '/^$/q' \"${PATCH}\"`\n+PATCHTMP=\"${PATCH}.tmp\"\n+\n+echo $MAILHEADER > $PATCHTMP\n+\n+export PATCHTMP\n+CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n+close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n+print $addr;'`\n+\n+TO=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n+close FILE; $addr = $1 if $text =~ /To: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n+print $addr;'`\n \n-CCS=`echo -e \"$CMT_MSG\\n$HEADERS\" | sed -n -e 's/^Cc: \\(.*\\)$/\\1,/gp' \\\n-\t-e 's/^Signed-off-by: \\(.*\\)/\\1,/gp'`\n+rm -rf $PATCHTMP\n \n+# Change Subject: before next line according to Thunderbird language\n+# for example:\n+# SUBJECT=`echo $SUBJECT | sed -e 's/Subject/Oggetto/g'`\n echo \"$SUBJECT\" > $1\n+# Change To: according to Thunderbird language\n+echo \"To: $TO\" >> $1\n echo \"Cc: $CCS\" >> $1\n-echo \"$HEADERS\" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1\n echo \"$SEP\" >> $1\n \n echo \"$CMT_MSG\" >> $1\n-- \n1.7.3.4\n"},{"id":"198153","messageId":"7v3933oupe.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"5040C59A.6090303@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-31T17:08:29Z","receivedAt":"2012-08-31T17:08:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> The current script has got the following problems:\n>\n> 1) It doesn't work if the language used by Thunderbird is not english;\n> 2) The field To: filled by format-patch is not evaluated;\n> 3) The field Cc: is loaded from Cc used in the commit message\n> instead of using the Cc field filled by format-patch in the email\n> header.\n>\n> Added comments for point 1), added parsing of To: for point 2) and\n> added parsing of Cc: in the email header for point 3), removing the\n> Cc: parsing from commit message.\n>\n> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>\n> ---\n\nThanks. [+cc Lukas].\n\nA few new issues your patch introduced:\n\n - MAILHEADER is only set once to read from sed, and then used once\n   to be echoed to another file.  Just send sed output to the file.\n\n - The \"s/Subject/Oggetto/g\" bit in my previous review.\n\n(find the fix-up at the end).\n\n>\n> v4: create a tmp file to allow correct perl parsing\n> v3: parse only To: and Cc: in the email header, fix some comments\n> v2: changed the commit message to reflect better the script implementation\n> v1: first draft\n>\n>  contrib/thunderbird-patch-inline/appp.sh |   26 ++++++++++++++++++++++----\n>  1 files changed, 22 insertions(+), 4 deletions(-)\n>\n> diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh\n> index 5eb4a51..0daeb29 100755\n> --- a/contrib/thunderbird-patch-inline/appp.sh\n> +++ b/contrib/thunderbird-patch-inline/appp.sh\n> @@ -6,6 +6,9 @@\n>  \n>  # ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2\n>  \n> +# NOTE: You must change some words in this script according to the language\n> +# used by Mozilla Thunderbird, as <Subject>, <To>, <Don't remove this line>.\n> +\n>  CONFFILE=~/.appprc\n>  \n>  SEP=\"-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-\"\n> @@ -26,17 +29,32 @@ fi\n>  cd - > /dev/null\n>  \n>  SUBJECT=`sed -n -e '/^Subject: /p' \"${PATCH}\"`\n> -HEADERS=`sed -e '/^'\"${SEP}\"'$/,$d' $1`\n>  BODY=`sed -e \"1,/${SEP}/d\" $1`\n>  CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' \"${PATCH}\"`\n>  DIFF=`sed -e '1,/^---$/d' \"${PATCH}\"`\n> +MAILHEADER=`sed '/^$/q' \"${PATCH}\"`\n> +PATCHTMP=\"${PATCH}.tmp\"\n> +\n> +echo $MAILHEADER > $PATCHTMP\n> +\n> +export PATCHTMP\n> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n> +print $addr;'`\n> +\n> +TO=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n> +close FILE; $addr = $1 if $text =~ /To: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n> +print $addr;'`\n>  \n> -CCS=`echo -e \"$CMT_MSG\\n$HEADERS\" | sed -n -e 's/^Cc: \\(.*\\)$/\\1,/gp' \\\n> -\t-e 's/^Signed-off-by: \\(.*\\)/\\1,/gp'`\n> +rm -rf $PATCHTMP\n>  \n> +# Change Subject: before next line according to Thunderbird language\n> +# for example:\n> +# SUBJECT=`echo $SUBJECT | sed -e 's/Subject/Oggetto/g'`\n>  echo \"$SUBJECT\" > $1\n> +# Change To: according to Thunderbird language\n> +echo \"To: $TO\" >> $1\n>  echo \"Cc: $CCS\" >> $1\n> -echo \"$HEADERS\" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1\n>  echo \"$SEP\" >> $1\n>  \n>  echo \"$CMT_MSG\" >> $1\n\n\nI also wonder what would happen if To: and Cc: in the input were\nsplit into continuation lines, but that was already present in the\nversion before your patch, so the attached fix-up won't touch that\npart, but you may want to think about it.\n\n contrib/thunderbird-patch-inline/appp.sh | 7 +++----\n 1 file changed, 3 insertions(+), 4 deletions(-)\n\ndiff --git c/contrib/thunderbird-patch-inline/appp.sh w/contrib/thunderbird-patch-inline/appp.sh\nindex 0daeb29..18d8bfa 100755\n--- c/contrib/thunderbird-patch-inline/appp.sh\n+++ w/contrib/thunderbird-patch-inline/appp.sh\n@@ -11,6 +11,7 @@\n \n CONFFILE=~/.appprc\n \n+# Change \"Dont' remove this line\" to what Thunderbird writs for your language\n SEP=\"-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-\"\n if [ -e \"$CONFFILE\" ] ; then\n \tLAST_DIR=`grep -m 1 \"^LAST_DIR=\" \"${CONFFILE}\"|sed -e 's/^LAST_DIR=//'`\n@@ -32,10 +33,8 @@ SUBJECT=`sed -n -e '/^Subject: /p' \"${PATCH}\"`\n BODY=`sed -e \"1,/${SEP}/d\" $1`\n CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' \"${PATCH}\"`\n DIFF=`sed -e '1,/^---$/d' \"${PATCH}\"`\n-MAILHEADER=`sed '/^$/q' \"${PATCH}\"`\n PATCHTMP=\"${PATCH}.tmp\"\n-\n-echo $MAILHEADER > $PATCHTMP\n+sed '/^$/q' \"${PATCH}\" >\"$PATCHTMP\"\n \n export PATCHTMP\n CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n@@ -50,7 +49,7 @@ rm -rf $PATCHTMP\n \n # Change Subject: before next line according to Thunderbird language\n # for example:\n-# SUBJECT=`echo $SUBJECT | sed -e 's/Subject/Oggetto/g'`\n+# SUBJECT=`echo $SUBJECT | sed -e 's/Subject:/Oggetto:/'`\n echo \"$SUBJECT\" > $1\n # Change To: according to Thunderbird language\n echo \"To: $TO\" >> $1\n"},{"id":"198167","messageId":"7vk3wen84a.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"5040C59A.6090303@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-08-31T20:01:41Z","receivedAt":"2012-08-31T20:01:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> +PATCHTMP=\"${PATCH}.tmp\"\n> +\n> +echo $MAILHEADER > $PATCHTMP\n> +\n> +export PATCHTMP\n> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n> +print $addr;'`\n> +\n> +TO=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n> +close FILE; $addr = $1 if $text =~ /To: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n> +print $addr;'`\n>  \n> -CCS=`echo -e \"$CMT_MSG\\n$HEADERS\" | sed -n -e 's/^Cc: \\(.*\\)$/\\1,/gp' \\\n> -\t-e 's/^Signed-off-by: \\(.*\\)/\\1,/gp'`\n> +rm -rf $PATCHTMP\n\nOne thing I forgot to say.  Make sure you quote your variables (when\nin doubt, quote).  Also make it a habit not to say \"rm -r\" when you\nknow you are removing a regular file you created.  I.e.\n\n\trm -f \"$PATCHTMP\"\n"},{"id":"198170","messageId":"50412E2D.7070503@kdbg.org","threadId":"31396","inReplyTo":"5040C59A.6090303@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2012-08-31T21:35:41Z","receivedAt":"2012-08-31T21:35:41Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 31.08.2012 16:09, schrieb Marco Stornelli:\n> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n> +print $addr;'`\n\nThe quoting is broken in this line (sq within sq does not work).\n\nAm I correct that you intend to treat continuation lines with this\nnon-trivial perl script? All this processing gets tedious and\nunreadable. Let me suggest this pattern instead:\n\n# translate to Thunderbird language\nLANG_TO=\"To:\"\nLANG_SUBJ=\"Subject:\"\nLANG_CC=\"Cc:\"\n\nLF=\t# terminates the _previous_ line\nwhile read -r line\ndo\n\tcase $line in\n\t'To: '*)\n\t\tprintf \"${LF}%s\" \"$LANG_TO ${line#To: }\"\n\t\t;;\n\t'Cc: '*) ...similar...\n\t'Subject: '*) ...similar...\n\t' '*)\t# continuation line\n\t\tprintf \"%s\" \"$line\"\n\t\t;;\n\t'')\n\t\tprint \"${LF}\\n\"\n\t\tcat\n\t\t;;\n\tesac\n\tLF='\\n'\ndone <\"$PATCH\" >\"$1\"\n\nInstead of printing right away, you can also accumulate the data in\nvariables and print them right before the 'cat'. I would do that only if\na particular order of To:, Cc:, and Subject: is required in the output.\n\n(I don't know how the \"do not delete this line\" line fits in the\npicture, but I'm sure you can figure it out.)\n\n-- Hannes\n"},{"id":"198179","messageId":"5041BC94.7000304@gmail.com","threadId":"31396","inReplyTo":"50412E2D.7070503@kdbg.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-01T07:43:16Z","receivedAt":"2012-09-01T07:43:16Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"Il 31/08/2012 23:35, Johannes Sixt ha scritto:\n> Am 31.08.2012 16:09, schrieb Marco Stornelli:\n>> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n>> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n>> +print $addr;'`\n>\n> The quoting is broken in this line (sq within sq does not work).\n\nI don't understand what you mean, I'm using this script and it works \nperfectly.\n\n>\n> Am I correct that you intend to treat continuation lines with this\n> non-trivial perl script? All this processing gets tedious and\n> unreadable. Let me suggest this pattern instead:\n\nThe perl script is used to have To: and Cc: email addresses in single \nline, without using \\n. I tried with sed, but it's a little bit \ndifficult (at least for me) because sed usually works on a single line, \nit's tricky with multilines.\n\n>\n> # translate to Thunderbird language\n> LANG_TO=\"To:\"\n> LANG_SUBJ=\"Subject:\"\n> LANG_CC=\"Cc:\"\n>\n> LF=\t# terminates the _previous_ line\n> while read -r line\n> do\n> \tcase $line in\n> \t'To: '*)\n> \t\tprintf \"${LF}%s\" \"$LANG_TO ${line#To: }\"\n> \t\t;;\n> \t'Cc: '*) ...similar...\n> \t'Subject: '*) ...similar...\n> \t' '*)\t# continuation line\n> \t\tprintf \"%s\" \"$line\"\n> \t\t;;\n> \t'')\n> \t\tprint \"${LF}\\n\"\n> \t\tcat\n> \t\t;;\n> \tesac\n> \tLF='\\n'\n> done <\"$PATCH\" >\"$1\"\n>\n> Instead of printing right away, you can also accumulate the data in\n> variables and print them right before the 'cat'. I would do that only if\n> a particular order of To:, Cc:, and Subject: is required in the output.\n>\n> (I don't know how the \"do not delete this line\" line fits in the\n> picture, but I'm sure you can figure it out.)\n>\n> -- Hannes\n>\n>\n"},{"id":"198180","messageId":"5041BED7.201@gmail.com","threadId":"31396","inReplyTo":"7v3933oupe.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-01T07:52:55Z","receivedAt":"2012-09-01T07:52:55Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"Il 31/08/2012 19:08, Junio C Hamano ha scritto:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> The current script has got the following problems:\n>>\n>> 1) It doesn't work if the language used by Thunderbird is not english;\n>> 2) The field To: filled by format-patch is not evaluated;\n>> 3) The field Cc: is loaded from Cc used in the commit message\n>> instead of using the Cc field filled by format-patch in the email\n>> header.\n>>\n>> Added comments for point 1), added parsing of To: for point 2) and\n>> added parsing of Cc: in the email header for point 3), removing the\n>> Cc: parsing from commit message.\n>>\n>> Signed-off-by: Marco Stornelli <marco.stornelli@gmail.com>\n>> ---\n>\n> Thanks. [+cc Lukas].\n>\n> A few new issues your patch introduced:\n>\n>   - MAILHEADER is only set once to read from sed, and then used once\n>     to be echoed to another file.  Just send sed output to the file.\n>\n>   - The \"s/Subject/Oggetto/g\" bit in my previous review.\n>\n> (find the fix-up at the end).\n>\n>>\n>> v4: create a tmp file to allow correct perl parsing\n>> v3: parse only To: and Cc: in the email header, fix some comments\n>> v2: changed the commit message to reflect better the script implementation\n>> v1: first draft\n>>\n>>   contrib/thunderbird-patch-inline/appp.sh |   26 ++++++++++++++++++++++----\n>>   1 files changed, 22 insertions(+), 4 deletions(-)\n>>\n>> diff --git a/contrib/thunderbird-patch-inline/appp.sh b/contrib/thunderbird-patch-inline/appp.sh\n>> index 5eb4a51..0daeb29 100755\n>> --- a/contrib/thunderbird-patch-inline/appp.sh\n>> +++ b/contrib/thunderbird-patch-inline/appp.sh\n>> @@ -6,6 +6,9 @@\n>>\n>>   # ExternalEditor can be downloaded at http://globs.org/articles.php?lng=en&pg=2\n>>\n>> +# NOTE: You must change some words in this script according to the language\n>> +# used by Mozilla Thunderbird, as <Subject>, <To>, <Don't remove this line>.\n>> +\n>>   CONFFILE=~/.appprc\n>>\n>>   SEP=\"-=-=-=-=-=-=-=-=-=# Don't remove this line #=-=-=-=-=-=-=-=-=-\"\n>> @@ -26,17 +29,32 @@ fi\n>>   cd - > /dev/null\n>>\n>>   SUBJECT=`sed -n -e '/^Subject: /p' \"${PATCH}\"`\n>> -HEADERS=`sed -e '/^'\"${SEP}\"'$/,$d' $1`\n>>   BODY=`sed -e \"1,/${SEP}/d\" $1`\n>>   CMT_MSG=`sed -e '1,/^$/d' -e '/^---$/,$d' \"${PATCH}\"`\n>>   DIFF=`sed -e '1,/^---$/d' \"${PATCH}\"`\n>> +MAILHEADER=`sed '/^$/q' \"${PATCH}\"`\n>> +PATCHTMP=\"${PATCH}.tmp\"\n>> +\n>> +echo $MAILHEADER > $PATCHTMP\n>> +\n>> +export PATCHTMP\n>> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n>> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n>> +print $addr;'`\n>> +\n>> +TO=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n>> +close FILE; $addr = $1 if $text =~ /To: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n>> +print $addr;'`\n>>\n>> -CCS=`echo -e \"$CMT_MSG\\n$HEADERS\" | sed -n -e 's/^Cc: \\(.*\\)$/\\1,/gp' \\\n>> -\t-e 's/^Signed-off-by: \\(.*\\)/\\1,/gp'`\n>> +rm -rf $PATCHTMP\n>>\n>> +# Change Subject: before next line according to Thunderbird language\n>> +# for example:\n>> +# SUBJECT=`echo $SUBJECT | sed -e 's/Subject/Oggetto/g'`\n>>   echo \"$SUBJECT\" > $1\n>> +# Change To: according to Thunderbird language\n>> +echo \"To: $TO\" >> $1\n>>   echo \"Cc: $CCS\" >> $1\n>> -echo \"$HEADERS\" | sed -e '/^Subject: /d' -e '/^Cc: /d' >> $1\n>>   echo \"$SEP\" >> $1\n>>\n>>   echo \"$CMT_MSG\" >> $1\n>\n>\n> I also wonder what would happen if To: and Cc: in the input were\n> split into continuation lines, but that was already present in the\n\nDo you mean To: <mail1>,.....<mailN>\\nCc: <mail1>,.....<mailN>?\n\n> version before your patch, so the attached fix-up won't touch that\n> part, but you may want to think about it.\n\nActually I'm trying the script in two ways: with --to and --cc of git \nformat patch => multilines, and with a little script (see below) to have \nautomatically Cc: from other script, in this case get_maintainer.pl from \nLinux kernel source tree, and it works perfectly. In the last case Cc: \nmail addresses are on the same line.\nMaybe we can add even this script, but maybe it's too kernel-specific.\n\n\n#!/bin/bash\n\nif [[ ! $# -eq 1 ]]\nthen\n         echo \"Usage: command <PATH>, where PATH contains kernel and \npatches\"\n         exit\nfi\n\nPATCHPATH=${1%/}\nfor i in `ls $PATCHPATH/*.patch`\ndo\n\n         CCN=`grep \"Cc:\" $i | wc -l`\n         if [ $CCN -ge 1 ]\n         then\n                 echo \"Cc: list already present, skip...\"\n         else\n\n                 CCLIST=`$PATCHPATH/scripts/get_maintainer.pl \n--norolestats --no-git --separator , $i`\n\n                 sed -n -e \"/^$/,9999999 ! p\" $i > $i.new\n                 echo \"Cc: $CCLIST\" >> $i.new\n                 sed -n -e \"/^$/,9999999 p\" $i >> $i.new\n                 mv $i.new $i\n         fi\ndone\n"},{"id":"198189","messageId":"504214AA.9080706@kdbg.org","threadId":"31396","inReplyTo":"5041BC94.7000304@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Johannes Sixt","fromEmail":"j6t@kdbg.org","sentAt":"2012-09-01T13:59:06Z","receivedAt":"2012-09-01T13:59:06Z","isPatch":true,"sender":{"key":"j6t@kdbg.org","avatar":"https://avatars.githubusercontent.com/u/14810926?v=4"},"body":"Am 01.09.2012 09:43, schrieb Marco Stornelli:\n> Il 31/08/2012 23:35, Johannes Sixt ha scritto:\n>> Am 31.08.2012 16:09, schrieb Marco Stornelli:\n>>> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'};\n>>> $text=<FILE>;\n>>> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr\n>>> =~ s/\\n//g;\n>>> +print $addr;'`\n>>\n>> The quoting is broken in this line (sq within sq does not work).\n> \n> I don't understand what you mean, I'm using this script and it works\n> perfectly.\n\nLook how you write:\n\n  perl -e '... $ENV{'PATCHTMP'} ...'\n\nThat is, perl actually sees this script:\n\n  ... $ENV{PATCHTMP} ...\n\n(no quotes around PATCHTMP). That my be perfectly valid perl, but is not\nwhat you intended.\n\n-- Hannes\n"},{"id":"198206","messageId":"50425F8B.5020406@gmail.com","threadId":"31396","inReplyTo":"504214AA.9080706@kdbg.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-01T19:18:35Z","receivedAt":"2012-09-01T19:18:35Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"Il 01/09/2012 15:59, Johannes Sixt ha scritto:\n> Am 01.09.2012 09:43, schrieb Marco Stornelli:\n>> Il 31/08/2012 23:35, Johannes Sixt ha scritto:\n>>> Am 31.08.2012 16:09, schrieb Marco Stornelli:\n>>>> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'};\n>>>> $text=<FILE>;\n>>>> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr\n>>>> =~ s/\\n//g;\n>>>> +print $addr;'`\n>>>\n>>> The quoting is broken in this line (sq within sq does not work).\n>>\n>> I don't understand what you mean, I'm using this script and it works\n>> perfectly.\n>\n> Look how you write:\n>\n>    perl -e '... $ENV{'PATCHTMP'} ...'\n>\n> That is, perl actually sees this script:\n>\n>    ... $ENV{PATCHTMP} ...\n>\n> (no quotes around PATCHTMP). That my be perfectly valid perl, but is not\n> what you intended.\n>\n> -- Hannes\n>\n>\n\nI don't understand what you mean when you say \"is not what you intended\" \nbecause perl and this script does *exactly* what I want and (with the \ntest I've done) it works. Have you got a test case where it doesn't work \nat all? However, since I'm not a perl guru, if someone says that double \nquotes are needed, ok the result is however the same.\n\nGit guys, let me know if a version 6 of the patch is needed, no problem \nto submit another version.\n\nRegards,\n\nMarco\n"},{"id":"198227","messageId":"7vzk58gno2.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"50412E2D.7070503@kdbg.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-02T18:42:23Z","receivedAt":"2012-09-02T18:42:23Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Sixt <j6t@kdbg.org> writes:\n\n> Am 31.08.2012 16:09, schrieb Marco Stornelli:\n>> +CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'}; $text=<FILE>;\n>> +close FILE; $addr = $1 if $text =~ /Cc: (.*?(,\\n .*?)*)\\n/s; $addr =~ s/\\n//g;\n>> +print $addr;'`\n>\n> The quoting is broken in this line (sq within sq does not work).\n\nAs you said later in the thread, perl lets you be loose and say\n$ENV{PATCHTMP} without quoting the string \"PATCHTMP\", so it is not\nquite _broken_ per-se, but the above gives a false impression to\nreaders that the author meant to feed perl\n\n    open FILE, $ENV{'PATCHTMP'};\n\nwhich is not happening, so at least it is misleading.\n\n> Am I correct that you intend to treat continuation lines with this\n> non-trivial perl script?\n\nAs the above regexp seems to try to match\n\n\tCc: marco, git,\n          j6t, other recipient\n\nI think that indeed is the intent.\n\n> All this processing gets tedious and\n> unreadable. Let me suggest this pattern instead:\n>\n> # translate to Thunderbird language\n> LANG_TO=\"To:\"\n> LANG_SUBJ=\"Subject:\"\n> LANG_CC=\"Cc:\"\n>\n> LF=\t# terminates the _previous_ line\n> while read -r line\n> do\n> \tcase $line in\n> \t'To: '*)\n> \t\tprintf \"${LF}%s\" \"$LANG_TO ${line#To: }\"\n> \t\t;;\n> \t'Cc: '*) ...similar...\n> \t'Subject: '*) ...similar...\n> \t' '*)\t# continuation line\n> \t\tprintf \"%s\" \"$line\"\n> \t\t;;\n> \t'')\n> \t\tprint \"${LF}\\n\"\n> \t\tcat\n> \t\t;;\n> \tesac\n> \tLF='\\n'\n> done <\"$PATCH\" >\"$1\"\n\nI think that is much more readable.\n"},{"id":"198226","messageId":"7vtxvggnnz.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"5041BED7.201@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-02T18:44:56Z","receivedAt":"2012-09-02T18:44:56Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n>> I also wonder what would happen if To: and Cc: in the input were\n>> split into continuation lines, but that was already present in the\n>\n> Do you mean To: <mail1>,.....<mailN>\\nCc: <mail1>,.....<mailN>?\n\nNo, I meant \"To: <mail1>,...\\n <mailN>\\n\".\n\nBut see my response to J6t's message.\n"},{"id":"198231","messageId":"7voblognny.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"50425F8B.5020406@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-02T20:42:44Z","receivedAt":"2012-09-02T20:42:44Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> Il 01/09/2012 15:59, Johannes Sixt ha scritto:\n>\n>> Look how you write:\n>>\n>>    perl -e '... $ENV{'PATCHTMP'} ...'\n>>\n>> That is, perl actually sees this script:\n>>\n>>    ... $ENV{PATCHTMP} ...\n>>\n>> (no quotes around PATCHTMP). That my be perfectly valid perl, but is not\n>> what you intended.\n>\n> I don't understand what you mean when you say \"is not what you\n> intended\"...\n\nWhen you wrote this:\n\n    CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'};...\n\nwhich one of the following did you mean to feed Perl?\n\n (1) open FILE, $ENV{'PATCHTMP'};\n (2) open FILE, $ENV{PATCHTMP};\n\nThe patch text makes it look as if you wanted to do (1), but what is\nfed to perl is (2), as Johannes points out.\n\nSaying:\n\n    CCS=`perl -e 'local $/=undef; open FILE, $ENV{PATCHTMP};...\n\nwould have been more natural if you really meant to do (2), don't\nyou think?  So what you wrote is at least misleading.\n\nBut I think I agree with Johannes's rewrite of the loop, so this may\nbe a moot point.\n"},{"id":"198242","messageId":"CANGUGtB26sSfsBayHX9+EXfTDs3XxSEdMj-5pH6zD3i4GPHEdQ@mail.gmail.com","threadId":"31396","inReplyTo":"7voblognny.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-03T10:51:46Z","receivedAt":"2012-09-03T10:51:46Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"2012/9/2 Junio C Hamano <gitster@pobox.com>:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> Il 01/09/2012 15:59, Johannes Sixt ha scritto:\n>>\n>>> Look how you write:\n>>>\n>>>    perl -e '... $ENV{'PATCHTMP'} ...'\n>>>\n>>> That is, perl actually sees this script:\n>>>\n>>>    ... $ENV{PATCHTMP} ...\n>>>\n>>> (no quotes around PATCHTMP). That my be perfectly valid perl, but is not\n>>> what you intended.\n>>\n>> I don't understand what you mean when you say \"is not what you\n>> intended\"...\n>\n> When you wrote this:\n>\n>     CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'};...\n>\n> which one of the following did you mean to feed Perl?\n>\n>  (1) open FILE, $ENV{'PATCHTMP'};\n>  (2) open FILE, $ENV{PATCHTMP};\n>\n> The patch text makes it look as if you wanted to do (1), but what is\n> fed to perl is (2), as Johannes points out.\n>\n> Saying:\n>\n>     CCS=`perl -e 'local $/=undef; open FILE, $ENV{PATCHTMP};...\n>\n> would have been more natural if you really meant to do (2), don't\n> you think?  So what you wrote is at least misleading.\n>\n> But I think I agree with Johannes's rewrite of the loop, so this may\n> be a moot point.\n\nOk, I'll try to rewrite it as Johannes has suggested.\n\nRegards,\n\nMarco\n"},{"id":"198258","messageId":"5044D162.1010608@gmail.com","threadId":"31396","inReplyTo":"7voblognny.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-03T15:48:50Z","receivedAt":"2012-09-03T15:48:50Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"Il 02/09/2012 22:42, Junio C Hamano ha scritto:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> Il 01/09/2012 15:59, Johannes Sixt ha scritto:\n>>\n>>> Look how you write:\n>>>\n>>>     perl -e '... $ENV{'PATCHTMP'} ...'\n>>>\n>>> That is, perl actually sees this script:\n>>>\n>>>     ... $ENV{PATCHTMP} ...\n>>>\n>>> (no quotes around PATCHTMP). That my be perfectly valid perl, but is not\n>>> what you intended.\n>>\n>> I don't understand what you mean when you say \"is not what you\n>> intended\"...\n>\n> When you wrote this:\n>\n>      CCS=`perl -e 'local $/=undef; open FILE, $ENV{'PATCHTMP'};...\n>\n> which one of the following did you mean to feed Perl?\n>\n>   (1) open FILE, $ENV{'PATCHTMP'};\n>   (2) open FILE, $ENV{PATCHTMP};\n>\n> The patch text makes it look as if you wanted to do (1), but what is\n> fed to perl is (2), as Johannes points out.\n>\n> Saying:\n>\n>      CCS=`perl -e 'local $/=undef; open FILE, $ENV{PATCHTMP};...\n>\n> would have been more natural if you really meant to do (2), don't\n> you think?  So what you wrote is at least misleading.\n>\n> But I think I agree with Johannes's rewrite of the loop, so this may\n> be a moot point.\n>\n\nI tried the Johannes's script, but it seems it doesn't work well with \nthe pattern of format-patch (To: <mail1>,\\n   <mail2>,\\n    <mailN>). \nThe multilines are not well managed. I can change my script to double \nquotas (I think perl and regexp are much more powerful rather than the \nwhile loop though it can be less readable), if it's not ok, I let other \ngit shell expert to adjust the script. I hope this thread it will be \nuseful for others.\n\nMarco\n"},{"id":"198268","messageId":"7voblmeua3.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"5044D162.1010608@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-03T20:16:52Z","receivedAt":"2012-09-03T20:16:52Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> I tried the Johannes's script, but it seems it doesn't work well with\n> the pattern of format-patch (To: <mail1>,\\n   <mail2>,\\n\n> <mailN>). The multilines are not well managed.\n\nI am guessing that the reason why Jonahhes's \"copy our headers out\nwith continuation lines intact\" approach does not work is because\nThunderbird does not want to see its own header part (i.e. that\nwhich comes before that $SEP) contain RFC-2822 style continuation\nlines.\n\nCan you grab a typical input (i.e. the contents of what is passed as\n$1 to the appp.sh script) and show us how it looks like here so that\nwe can take a look?  It would be fine to paste the contents, but we\nmight want to protect it from MUA by doing an attachment or a\npastebin URL.\n\nIt appears that the original script tries very hard to keep the\nSubject: line at the beginning, but I am not sure if that is because\nThunderbird wants to read its \"$1\" that way, or it is just that\noriginal appp.sh script happened to be written that way without real\nreason.  If I were updating this script, what I would do would be\nmore like:\n\n    0. Open a temporary output file $OUT, input filehandle $IN from\n       ${PATCH}, and another input filehandle $TEMPLATE from \"$1\"\n\n    1. Read from $IN starting from the second line (i.e. skip the\n       first line \"From [0-9a-f] Mon Sep 17 00:00:00 2001\" magic\n       marker) upto the empty line, coalescing the RFC-2822 style\n       continuation lines into one long line each.\n\n    2. Output the above into $OUT, while applying your \"header field\n       name translation\" (e.g. \"Oggetto\") and remembering what\n       header you wrote out.\n\n    3. Read from $TEMPLATE up to a line that matches the following\n       pattern:\n\n\t/^-=-=-=-=-=-=-=-=-=#.*#=-=-=-=-=-=-=-=-=-$/\n\n       reject headers that step 2. already emitted, and emit other\n       headers to $OUT.  Also emit that line that matched the above\n       SEP pattern to $OUT (by doing so, you do not have to care how\n       \"Don't remove this line\" is spelled in the user's language).\n\n    4. Resume reading from $IN and copy to $OUT, including the patch\n       separator \"---\", and stop copying.\n\n    5. Read the remainder of $TEMPLATE and copy to $OUT.\n\n    6. Read the remainder of $IN and copy to $OUT.\n\n    7. Rename the temporary file that was connected to $OUT to \"$1\".\n\n\n       \n"},{"id":"198276","messageId":"CANGUGtBk7DME4pkhJhcYoaM-q_S+i9_6u_Ku-9N6D41Mx50ghg@mail.gmail.com","threadId":"31396","inReplyTo":"7voblmeua3.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-04T06:37:55Z","receivedAt":"2012-09-04T06:37:55Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"2012/9/3 Junio C Hamano <gitster@pobox.com>:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> I tried the Johannes's script, but it seems it doesn't work well with\n>> the pattern of format-patch (To: <mail1>,\\n   <mail2>,\\n\n>> <mailN>). The multilines are not well managed.\n>\n> I am guessing that the reason why Jonahhes's \"copy our headers out\n> with continuation lines intact\" approach does not work is because\n> Thunderbird does not want to see its own header part (i.e. that\n> which comes before that $SEP) contain RFC-2822 style continuation\n> lines.\n>\n> Can you grab a typical input (i.e. the contents of what is passed as\n> $1 to the appp.sh script) and show us how it looks like here so that\n> we can take a look?  It would be fine to paste the contents, but we\n> might want to protect it from MUA by doing an attachment or a\n> pastebin URL.\n\nI don't have thunderbird now but actually it's really simple:\n\nSubject:\nTo:\nCc:\n$SEP\n\nEach data must be in a signle line, for example \"Cc: <mail1>,.....,<mailN>\"\n\n>\n> It appears that the original script tries very hard to keep the\n> Subject: line at the beginning, but I am not sure if that is because\n> Thunderbird wants to read its \"$1\" that way, or it is just that\n> original appp.sh script happened to be written that way without real\n> reason.  If I were updating this script, what I would do would be\n> more like:\n\nOk, good coding then.\n\nRegards,\n\nMarco\n"},{"id":"198288","messageId":"7v4nneduvj.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"CANGUGtBk7DME4pkhJhcYoaM-q_S+i9_6u_Ku-9N6D41Mx50ghg@mail.gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-04T09:01:36Z","receivedAt":"2012-09-04T09:01:36Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> I don't have thunderbird now but actually it's really simple:\n>\n> Subject:\n> To:\n> Cc:\n> $SEP\n\nThe above is not a very useful \"example\" to advance this discussion,\nI have to say.  For one, where is your Oggetto?  Are these fields\nthe only ones you will ever see?  Are they always empty?\n\nI would expect, at least when you are responding to an existing\nmessage, some of them are filled already (and if so, I think appp.sh\nwants to know exactly how, for example, has RFC2047 quoting already\napplied, or are we supposed to write in UTF-8 and let Thunderbird\nmassage the contents when we give the file back to it?), and also\nthere would appear In-Reply-To: field already filled (possibly there\nmay be References: as well).\n\nAnd if you are replying to an existing message and Thunderbird fills\nTo: or Cc: fields based on the ongoing discussion, I wonder if it is\na mistake to override that based on anything from what we read from\nformat-patch output in the first place.\n"},{"id":"198294","messageId":"CANGUGtChELcXe08JtrJW=rt48xOSSeEd9tCgcJvtHiKaX5GCMQ@mail.gmail.com","threadId":"31396","inReplyTo":"7v4nneduvj.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-04T11:22:18Z","receivedAt":"2012-09-04T11:22:18Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"2012/9/4 Junio C Hamano <gitster@pobox.com>:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> I don't have thunderbird now but actually it's really simple:\n>>\n>> Subject:\n>> To:\n>> Cc:\n>> $SEP\n>\n> The above is not a very useful \"example\" to advance this discussion,\n> I have to say.  For one, where is your Oggetto?\n\n1) Where is your Oggetto?\nI used english template simply because the question was about position\nof each statement, but with translation the positions are the same.\n\n2) Are these fields the only ones you will ever see?\nNo, the template is dynamic according to the settings of plug-in\n\"external editor\". You can have\nSubject, To, Cc, Ccn, In reply to, discussion group (please see\nexternal editor for details).\n\n3)  Are they always empty?\nYes. If they are empty, nothing happens actually. I mean, if you have\nthe field Cc: empty, in the message composition\nThunderbird will use an empty Cc: line, but no problem in sending.\n\n>\n> I would expect, at least when you are responding to an existing\n> message, some of them are filled already (and if so, I think appp.sh\n> wants to know exactly how, for example, has RFC2047 quoting already\n> applied, or are we supposed to write in UTF-8 and let Thunderbird\n> massage the contents when we give the file back to it?), and also\n> there would appear In-Reply-To: field already filled (possibly there\n> may be References: as well).\n\nMessage reply is out of scope of my patch. The goal here is send a\npatch, so the execution flow is to open a new message,\nclik on external editor (configured properly), select patch file and\nsend. It was the scope of the old script and it is the scope of my\npatch. Usually you don't send a patch as reply, however even if you\nwant to send patch as proof-of-concept as reply, there is no\nproblem, you can copy&paste the patch body. The script, instead, is\nvery useful to load all patch info, pre-formatting it and filling with\nall To: and Cc. So IMHO the in-reply-to case is simply overkilling for\nthis script. In addition, I think all this discussion is overkilling\nfor a simple script like that, if a thing can be improved ok I agree\nto improve it, but what are we talking about? About a little script\nthat is only an external utility for this project, not a core\nfunctionality.\n\nMarco\n"},{"id":"198307","messageId":"7vd321dc0e.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"CANGUGtChELcXe08JtrJW=rt48xOSSeEd9tCgcJvtHiKaX5GCMQ@mail.gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-04T15:49:05Z","receivedAt":"2012-09-04T15:49:05Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> 2012/9/4 Junio C Hamano <gitster@pobox.com>:\n>\n>> I would expect, at least when you are responding to an existing\n>> message, some of them are filled already (and if so, I think appp.sh\n>> wants to know exactly how, for example, has RFC2047 quoting already\n>> applied, or are we supposed to write in UTF-8 and let Thunderbird\n>> massage the contents when we give the file back to it?), and also\n>> there would appear In-Reply-To: field already filled (possibly there\n>> may be References: as well).\n>\n> Message reply is out of scope of my patch. The goal here is send a\n> patch, so the execution flow is to open a new message,\n> clik on external editor (configured properly), select patch file and\n> send. It was the scope of the old script and it is the scope of my\n> patch.\n\nI certainly can understand that you updated the script for that use\ncase and that use case only, but given that the original tries very\nhard to preserve:\n\n - what was in $HEADERS (by only replacing Subject);\n - the recipients CC'ed in $HEADERS (by grabbing them into $CCS); and\n - the body of the message in $BODY (i.e. what came after $SEP),\n\nI find it hard to believe that it was meant to work on a freshly\ncreated empty message and nothing else.  If people were depending on\nthe recipients listed on Cc that are taken from $1 to be preserved,\nyour patch will introduce a regression for them, no?\n"},{"id":"198324","messageId":"50464FA8.3020104@gmail.com","threadId":"31396","inReplyTo":"7vd321dc0e.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-04T18:59:52Z","receivedAt":"2012-09-04T18:59:52Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"Il 04/09/2012 17:49, Junio C Hamano ha scritto:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> 2012/9/4 Junio C Hamano <gitster@pobox.com>:\n>>\n>>> I would expect, at least when you are responding to an existing\n>>> message, some of them are filled already (and if so, I think appp.sh\n>>> wants to know exactly how, for example, has RFC2047 quoting already\n>>> applied, or are we supposed to write in UTF-8 and let Thunderbird\n>>> massage the contents when we give the file back to it?), and also\n>>> there would appear In-Reply-To: field already filled (possibly there\n>>> may be References: as well).\n>>\n>> Message reply is out of scope of my patch. The goal here is send a\n>> patch, so the execution flow is to open a new message,\n>> clik on external editor (configured properly), select patch file and\n>> send. It was the scope of the old script and it is the scope of my\n>> patch.\n>\n> I certainly can understand that you updated the script for that use\n> case and that use case only, but given that the original tries very\n> hard to preserve:\n>\n>   - what was in $HEADERS (by only replacing Subject);\n>   - the recipients CC'ed in $HEADERS (by grabbing them into $CCS); and\n>   - the body of the message in $BODY (i.e. what came after $SEP),\n>\n> I find it hard to believe that it was meant to work on a freshly\n> created empty message and nothing else.  If people were depending on\n> the recipients listed on Cc that are taken from $1 to be preserved,\n> your patch will introduce a regression for them, no?\n>\n\nI think all the process is different. Current script rely on the user to \nfill Cc: and To: in message composition window, it does a union of what \nfound in commit message as signed-off-by (adding own address in cc?!) \nand Cc (usually not filled in the commit message and we should even \ncount acked-by, tested-by and so on). My vision of things: the user can \ncreate a patch *already* with all information using --to and --cc. If \nyou want to add optional addresses, you can of course add them in the \ncomposition window. In addition, with this approach is really easy to \nuse external script as get_maintainer.pl of linux kernel, load the patch \nand send, really easy. So I don't think it's a regression, it's only a \nchange in the work flow.\n\nMarco\n"},{"id":"198335","messageId":"7va9x5a8z8.fsf@alter.siamese.dyndns.org","threadId":"31396","inReplyTo":"50464FA8.3020104@gmail.com","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2012-09-04T19:22:51Z","receivedAt":"2012-09-04T19:22:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Marco Stornelli <marco.stornelli@gmail.com> writes:\n\n> kernel, load the patch and send, really easy. So I don't think it's a\n> regression, it's only a change in the work flow.\n\nAny change that forces the user to change an established work flow\nsupporteed by the existing tool we gave them _is_ a regression, even\nif the person who forces that change believes the new way is better.\n"},{"id":"198357","messageId":"CANGUGtAEE-W2_D9H4htr3SccW6et3p5tSK5h0mQtbTUemVVROQ@mail.gmail.com","threadId":"31396","inReplyTo":"7va9x5a8z8.fsf@alter.siamese.dyndns.org","subject":"Re: [PATCH v4] Thunderbird: fix appp.sh format problems","fromName":"Marco Stornelli","fromEmail":"marco.stornelli@gmail.com","sentAt":"2012-09-05T06:30:27Z","receivedAt":"2012-09-05T06:30:27Z","isPatch":true,"sender":{"key":"marco.stornelli@gmail.com","avatar":null},"body":"2012/9/4 Junio C Hamano <gitster@pobox.com>:\n> Marco Stornelli <marco.stornelli@gmail.com> writes:\n>\n>> kernel, load the patch and send, really easy. So I don't think it's a\n>> regression, it's only a change in the work flow.\n>\n> Any change that forces the user to change an established work flow\n> supporteed by the existing tool we gave them _is_ a regression, even\n> if the person who forces that change believes the new way is better.\n\nA change of this kind in external script like this, it isn't an\nAPI/ABI change for me, your sentence is really opinable. With this\npolicy every application can't be changed to improve them (note here\nwe are talking about to change a work flow not to remove a feature).\nIf for you it is a problem, we can close this never ending thread\nhere. I'm happy with my script.\n\nMarco\n"}]}