unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Teemu Likonen <tlikonen@iki.fi>
To: Daniel Kahn Gillmor <dkg@fifthhorseman.net>,
	Notmuch Mail <notmuch@notmuchmail.org>
Cc: "Antoine Beaupré" <anarcat@orangeseeds.org>
Subject: Re: proposing "notmuch purge"
Date: Tue, 14 Jan 2020 07:01:08 +0200	[thread overview]
Message-ID: <87d0bm1vjf.fsf@iki.fi> (raw)
In-Reply-To: <87wo9vhtyh.fsf@fifthhorseman.net>

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

Daniel Kahn Gillmor [2020-01-13T17:28:38-05] wrote:

> So i'm proposing "notmuch purge", which could be something as simple as
> the equivalent of:
>
>    notmuch search --output=files --format=text0 tag:deleted | \
>       xargs --null --no-run-if-empty rm && \
>          notmuch new --no-hooks
>
> (credit for the pipeline above goes to anarcat, in Cc; i added the
> "notmuch new --no-hooks" part, because i would want the items gone from
> the db as well)

I agree with the proposal but I would like to add one important point to
the discussion and semantics. If the implementation goes through
"notmuch search" we should understand what search.exclude_tags does.

Let's say a user has this settings: "search.exclude_tags=deleted;spam".
Then "notmuch search tag:deleted" will not find messages which have both
of the excluded tags, "deleted" and "spam". We would need "notmuch
search --exclude=false tag:deleted" to really find all messages with
tag:deleted. So here's the search semantics I propose:

    notmuch search --exclude=false --output=files \
        --format=text0 SEARCH-TERMS

I think that the "SEARCH-TERMS" part should be configurable, not
hard-coded. A user could have setting like
"search.purge_tags=deleted;spam" and that would lead to search terms
"tag:deleted OR tag:spam" in the purge operation.

-- 
///  OpenPGP key: 4E1055DC84E9DFF613D78557719D69D324539450
//  https://keys.openpgp.org/search?q=tlikonen@iki.fi
/  https://keybase.io/tlikonen  https://github.com/tlikonen

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 694 bytes --]

  parent reply	other threads:[~2020-01-14  5:01 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-01-13 22:28 proposing "notmuch purge" Daniel Kahn Gillmor
2020-01-13 22:33 ` Antoine Beaupré
2020-01-14  5:01 ` Teemu Likonen [this message]
2020-01-14  5:36   ` Teemu Likonen
2020-01-14 19:23   ` Daniel Kahn Gillmor
2020-01-14 19:55     ` Jameson Graef Rollins
2020-01-14 20:03       ` Antoine Beaupré
2020-01-14 22:25         ` Daniel Kahn Gillmor
2020-01-15  5:36       ` Teemu Likonen
2020-01-15  9:58         ` Örjan Ekeberg
2020-01-14 22:48 ` Ryan Tate
2020-01-14 23:08   ` Jameson Graef Rollins
2020-01-15  1:43   ` Antoine Beaupré
2020-01-14 22:59 ` Brian May
2020-01-14 23:24   ` Daniel Kahn Gillmor

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=87d0bm1vjf.fsf@iki.fi \
    --to=tlikonen@iki.fi \
    --cc=anarcat@orangeseeds.org \
    --cc=dkg@fifthhorseman.net \
    --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).