unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Jameson Graef Rollins <jrollins@finestructure.net>
To: Austin Clements <amdragon@MIT.EDU>, notmuch@notmuchmail.org
Subject: Re: [PATCH 5/5] show: Convert raw format to the new self-recursive style
Date: Sat, 03 Mar 2012 14:05:58 -0800	[thread overview]
Message-ID: <87zkbxqr09.fsf@servo.finestructure.net> (raw)
In-Reply-To: <1330752025-2542-6-git-send-email-amdragon@mit.edu>

[-- Attachment #1: Type: text/plain, Size: 3667 bytes --]

Hey, Austin.  As always, thank you so much for your hard work on this
rewrite.  It looks like things are definitely moving the right
direction.

I haven't done a full review of this patch set, and I've been pretty out
of the loop on this stuff recently, but I do notice that there are some
changes to the tests that don't look right to me.

On Sat,  3 Mar 2012 00:20:25 -0500, Austin Clements <amdragon@MIT.EDU> wrote:
> This is fully compatible for root and leaf parts, but drops support
> for interior parts.  Showing interior parts in raw has always been
> braindead broken, so I don't think anyone will miss this.  Tests have
> been updated to reflect this.

I think I'm confused about this "drop support for interior parts".  What
constitutes an "interior part"?  Aren't all parts interior?  It looks
From the patch that maybe you're referring specifically to rfc822 parts?

I can understand not supporting output of multipart parts in raw; it's
unclear what a "raw" multipart even is.  But I think we do need to
support common-sense handling of rfc822 parts, even if it requires
special casing.  These following two test modifications illustrate the
issue:

>  test_begin_subtest "--format=raw --part=3, rfc822 part"
> -test_subtest_known_broken
> -
> -notmuch show --format=raw --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
> -test_expect_equal_file OUTPUT embedded_message
> +notmuch show --format=raw --part=3 'id:87liy5ap00.fsf@yoom.home.cworth.org' >&OUTPUT
> +cat <<EOF >EXPECTED
> +Error: Raw only supports root and leaf parts
> +EOF
> +test_expect_equal_file OUTPUT EXPECTED

I pretty strongly think that this test needs to remain how it was.  If
someone forwards me a message as a rfc822 part I should be able to
retrieve the full forwarded message directly, by e.g. redirecting it to
a file and recreating the original message exactly intact.  That's why I
constructed this test the way I did originally, and left it
known_broken.  If we can't support this now that's fine, but I still
think this test describes an important needed functionality that we
should strive to support at some point.  Maybe it needs an entirely new
output formatter, or some special casing, but I still think it's
reasonable to expect that we should support this.

>  test_begin_subtest "--format=raw --part=4, rfc822's html part"
> -notmuch show --format=raw --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >OUTPUT
> +notmuch show --format=raw --part=4 'id:87liy5ap00.fsf@yoom.home.cworth.org' >&OUTPUT
>  cat <<EOF >EXPECTED
> -<p>This is an embedded message, with a multipart/alternative part.</p>
> -This is an embedded message, with a multipart/alternative part.
> +Error: Raw only supports root and leaf parts
>  EOF
>  test_expect_equal_file OUTPUT EXPECTED

Maybe this is ultimately a limitation of what we can expect the raw
formatter to do, but isn't this a leaf part?  As with whole rfc822
parts, I also expect that we should be able to retrieve interior leaf
parts of rfc822 message parts.  So I think I would prefer that this test
just move to test_subtest_known_broken until a better way to handle this
is figured out.

Without looking into the details of your whole show rewrite, I'm
guessing that we just can't reasonably expect the raw formatter to
handle rfc822 parts the way we need.  Is that correct?  Is there some
other formatter that might be better suited for this?  Like I say, I
think it's ok if we have to have some special casing for this particular
type of part.  But either way I think we should try to support handling
rfc822 parts in a useful way.

jamie.

[-- Attachment #2: Type: application/pgp-signature, Size: 835 bytes --]

  reply	other threads:[~2012-03-03 22:06 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-03  5:20 [PATCH 0/5] Rewrite mbox and raw show formats Austin Clements
2012-03-03  5:20 ` [PATCH 1/5] show: Allow formatters to return errors Austin Clements
2012-03-03  5:20 ` [PATCH 2/5] show: Move format_message_mbox with the other new-style formats Austin Clements
2012-03-03  5:20 ` [PATCH 3/5] show: Convert mbox format to new self-recursive style Austin Clements
2012-03-03  5:20 ` [PATCH 4/5] show: Move format_part_content_raw with the other new-style formats Austin Clements
2012-03-03  5:20 ` [PATCH 5/5] show: Convert raw format to the new self-recursive style Austin Clements
2012-03-03 22:05   ` Jameson Graef Rollins [this message]
2012-03-06 18:43     ` Austin Clements
2012-03-03  8:18 ` [PATCH 0/5] Rewrite mbox and raw show formats Tomi Ollila
2012-03-06 18:48 ` [PATCH v2 0/8] " Austin Clements
2012-03-06 18:48   ` [PATCH v2 1/8] test: Fix typo in test description Austin Clements
2012-03-06 18:48   ` [PATCH v2 2/8] test: Fix malformed multipart message Austin Clements
2012-03-06 18:48   ` [PATCH v2 3/8] show: Allow formatters to return errors Austin Clements
2012-03-06 21:22     ` Mark Walters
2012-03-07 20:18       ` Tomi Ollila
2012-03-11 23:34       ` Austin Clements
2012-03-06 18:48   ` [PATCH v2 4/8] show: Move format_message_mbox with the other new-style formats Austin Clements
2012-03-06 18:48   ` [PATCH v2 5/8] show: Convert mbox format to new self-recursive style Austin Clements
2012-03-06 18:48   ` [PATCH v2 6/8] show: Move format_part_content_raw with the other new-style formats Austin Clements
2012-03-06 18:48   ` [PATCH v2 7/8] show: Convert raw format to the new self-recursive style, properly support interior parts Austin Clements
2012-03-06 18:48   ` [PATCH v2 8/8] man: Update raw format documentation Austin Clements
2012-03-09  3:25   ` [PATCH v2 0/8] Rewrite mbox and raw show formats Adam Wolfe Gordon
2012-03-18 12:51   ` David Bremner

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

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87zkbxqr09.fsf@servo.finestructure.net \
    --to=jrollins@finestructure.net \
    --cc=amdragon@MIT.EDU \
    --cc=notmuch@notmuchmail.org \
    /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.
Code repositories for project(s) associated with this public inbox

	https://yhetil.org/notmuch.git/

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 read-only IMAP folder(s) and NNTP newsgroup(s).