Re: [PATCH] cli/show: add --format=pretty

2021-07-05 Thread Hannu Hartikainen
Hi!

Thanks for starting discussion on the matter. Do feel free to tell me if
I have the completely wrong idea about project goals.

On Sun, 04 Jul 2021 11:38:45 -0300, David Bremner  wrote:
> This is not really directed at Hannu, but at the notmuch community. As
> you can imagine I'm not super enthusiastic an every growing number of
> output formats to maintain.

I can appreciate that. I've maintained open source software before and I
know people come up with the weirdest feature requests that simply don't
fit the scenario I'm building the software for. If this text format that
I personally like to use isn't good for the project, it definitely
should not be merged.

What do you see as the mission statement for notmuch-cli? I'd like to
make it ergonomic enough to be usable without a MUA, and it's really
close already. But if notmuch-cli is meant to be something completely
different I might just have my own set of patches or consider starting
my own project.

> One thing the old format did not do, but a generically useful on the
> command-line format probably should is deal with signature verification
> and decryption. There is obviously potential for visual spoofing, but
> maybe color can help.

I'm pretty sure you can embed ANSI escapes in email and
they'll be displayed by `notmuch show` as color in a typical terminal.
Not sure if anyone should be worried about attacks specifically against
notmuch users, though.

> In my experience, notmuch show --format=raw works pretty well
> for this. There was an issue with encoded line endings but that is fixed
> in git 2.32. What advantage does this new format bring for patches?

--format=pretty is not any better than --format=raw for use with git-am
but the point is that it's as good. I have the shell alias ns="notmuch
show --format=pretty" and I can use something like `ns tag:unread` for
reading and `ns id:some-id | git am` for applying patches. I personally
really, really like simple things that work for multiple purposes.

For human consumption the pretty format is nicer than the raw format,
and it also supports showing multiple messages.

Hannu
___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org


Re: [PATCH] cli/show: add --format=pretty

2021-07-04 Thread David Bremner
Hannu Hartikainen  writes:

> The rationale for this feature is twofold:
>
> 1. It is useful to be able to view messages in as human-friendly format
>as possible.
> 2. The same format should still be machine-readable, too.

This is not really directed at Hannu, but at the notmuch community. As
you can imagine I'm not super enthusiastic an every growing number of
output formats to maintain.

The usual argument for keeping --format=text is that it useful for
scripting. There is also the vim UI, but afaict that is no longer using
--format=text.  It would be nice if a new text like format could
(eventually) replace the old one. So what would the new format need to
do so that we could at least deprecate the old one?

One thing the old format did not do, but a generically useful on the
command-line format probably should is deal with signature verification
and decryption. There is obviously potential for visual spoofing, but
maybe color can help.

>
> While human readability is the main goal, another design goal was that
> piping the output to `git am` works, at least for individual messages
> sent with `git send-email`.
> ---

In my experience, notmuch show --format=raw works pretty well
for this. There was an issue with encoded line endings but that is fixed
in git 2.32. What advantage does this new format bring for patches?

d


___
notmuch mailing list -- notmuch@notmuchmail.org
To unsubscribe send an email to notmuch-le...@notmuchmail.org