git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Marco Stornelli <marco.stornelli@gmail.com>
Cc: Johannes Sixt <j6t@kdbg.org>, git@vger.kernel.org
Subject: Re: [PATCH v4] Thunderbird: fix appp.sh format problems
Date: Mon, 03 Sep 2012 13:16:52 -0700	[thread overview]
Message-ID: <7voblmeua3.fsf@alter.siamese.dyndns.org> (raw)
In-Reply-To: <5044D162.1010608@gmail.com> (Marco Stornelli's message of "Mon, 03 Sep 2012 17:48:50 +0200")

Marco Stornelli <marco.stornelli@gmail.com> writes:

> I tried the Johannes's script, but it seems it doesn't work well with
> the pattern of format-patch (To: <mail1>,\n   <mail2>,\n
> <mailN>). The multilines are not well managed.

I am guessing that the reason why Jonahhes's "copy our headers out
with continuation lines intact" approach does not work is because
Thunderbird does not want to see its own header part (i.e. that
which comes before that $SEP) contain RFC-2822 style continuation
lines.

Can you grab a typical input (i.e. the contents of what is passed as
$1 to the appp.sh script) and show us how it looks like here so that
we can take a look?  It would be fine to paste the contents, but we
might want to protect it from MUA by doing an attachment or a
pastebin URL.

It appears that the original script tries very hard to keep the
Subject: line at the beginning, but I am not sure if that is because
Thunderbird wants to read its "$1" that way, or it is just that
original appp.sh script happened to be written that way without real
reason.  If I were updating this script, what I would do would be
more like:

    0. Open a temporary output file $OUT, input filehandle $IN from
       ${PATCH}, and another input filehandle $TEMPLATE from "$1"

    1. Read from $IN starting from the second line (i.e. skip the
       first line "From [0-9a-f] Mon Sep 17 00:00:00 2001" magic
       marker) upto the empty line, coalescing the RFC-2822 style
       continuation lines into one long line each.

    2. Output the above into $OUT, while applying your "header field
       name translation" (e.g. "Oggetto") and remembering what
       header you wrote out.

    3. Read from $TEMPLATE up to a line that matches the following
       pattern:

	/^-=-=-=-=-=-=-=-=-=#.*#=-=-=-=-=-=-=-=-=-$/

       reject headers that step 2. already emitted, and emit other
       headers to $OUT.  Also emit that line that matched the above
       SEP pattern to $OUT (by doing so, you do not have to care how
       "Don't remove this line" is spelled in the user's language).

    4. Resume reading from $IN and copy to $OUT, including the patch
       separator "---", and stop copying.

    5. Read the remainder of $TEMPLATE and copy to $OUT.

    6. Read the remainder of $IN and copy to $OUT.

    7. Rename the temporary file that was connected to $OUT to "$1".


       

  reply	other threads:[~2012-09-03 20:17 UTC|newest]

Thread overview: 21+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 14:09 [PATCH v4] Thunderbird: fix appp.sh format problems Marco Stornelli
2012-08-31 17:08 ` Junio C Hamano
2012-09-01  7:52   ` Marco Stornelli
2012-09-02 18:44     ` Junio C Hamano
2012-08-31 20:01 ` Junio C Hamano
2012-08-31 21:35 ` Johannes Sixt
2012-09-01  7:43   ` Marco Stornelli
2012-09-01 13:59     ` Johannes Sixt
2012-09-01 19:18       ` Marco Stornelli
2012-09-02 20:42         ` Junio C Hamano
2012-09-03 10:51           ` Marco Stornelli
2012-09-03 15:48           ` Marco Stornelli
2012-09-03 20:16             ` Junio C Hamano [this message]
2012-09-04  6:37               ` Marco Stornelli
2012-09-04  9:01                 ` Junio C Hamano
2012-09-04 11:22                   ` Marco Stornelli
2012-09-04 15:49                     ` Junio C Hamano
2012-09-04 18:59                       ` Marco Stornelli
2012-09-04 19:22                         ` Junio C Hamano
2012-09-05  6:30                           ` Marco Stornelli
2012-09-02 18:42   ` 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=7voblmeua3.fsf@alter.siamese.dyndns.org \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=j6t@kdbg.org \
    --cc=marco.stornelli@gmail.com \
    /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).