unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Michael J Gruber <michaeljgruber+grubix+git@gmail.com>
To: Carl Worth <cworth@cworth.org>
Cc: "Renaud B." <renaudbussieres@gmail.com>, notmuch@notmuchmail.org
Subject: Re: I don't understand the results of this search query, is this a bug?
Date: Tue, 14 May 2024 10:19:13 +0200	[thread overview]
Message-ID: <CAA19uiSRSDDhA120DDfmE0=nSoyQLbx3W5xsH_Lx6NThNm=sRw@mail.gmail.com> (raw)
In-Reply-To: <87o799mlz1.fsf@wondoo.home.cworth.org>

Am Mo., 13. Mai 2024 um 23:38 Uhr schrieb Carl Worth <cworth@cworth.org>:
>
> Hi Renaud,
>
> I was able to see similar behavior in my own mail store. And I agree
> that this behavior is confusing!
>
> The documentation for the --files option of notmuch search documents the
> cause (and predicts that this will be confusing):
>
....
> In general, I'm not a fan of software documenting "this may be
> confusing". That suggests the authors of the documentation know that the

:-)

> software is not behaving as the user intends, so it would be preferable
> for the software to behave as intended. That said, I also understand the
> implementation details that lead to this behavior. So I wouldn't be
> opposed to improving the behavior of notmuch to reduce this behavior,
> (but that implementation might not be trivial or even fully feasible).

I wouldn't call it an implementation detail in this case, though,
rather than the guiding principle of notmuch: it is all about
*messages* as identified by a mid.

Consequently, notmuch stores information by message, searches by
message and outputs information by message. This in turn has
consequences, for better or worse, e.g. when different mail files with
the same mid have different (maildir) flags. But without grasping the
main guiding principle you'll get confused sooner or later.

As soon as you introduce "do what I mean" into the CLI design the
outcome depends on the "I" implementing it, who may "mean" very
different things compared to the "I" using the CLI. This creates
confusion which cannot be resolved by pointing out a guiding
principle, but rather "when we do x it is often convenient to imply y
and that's why do z". You can witness that to some extent in git's
CLI.

Also, dwim'ing in the case at hand seems difficult - you'd have to
extract "path:" tokens from a possibly complex query, track logical
operators applying to them and filter the output accordingly. Compare
that to "find -type f dirWhichIWant" which would have solved OP's use
case ...

Cheers
Michael

  reply	other threads:[~2024-05-14  8:34 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-05-13 19:43 I don't understand the results of this search query, is this a bug? Renaud B.
2024-05-13 21:38 ` Carl Worth
2024-05-14  8:19   ` Michael J Gruber [this message]
2024-05-15 13:53     ` Renaud B.

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='CAA19uiSRSDDhA120DDfmE0=nSoyQLbx3W5xsH_Lx6NThNm=sRw@mail.gmail.com' \
    --to=michaeljgruber+grubix+git@gmail.com \
    --cc=cworth@cworth.org \
    --cc=notmuch@notmuchmail.org \
    --cc=renaudbussieres@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.
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).