unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* proposing "notmuch purge"
@ 2020-01-13 22:28 Daniel Kahn Gillmor
  2020-01-13 22:33 ` Antoine Beaupré
                   ` (3 more replies)
  0 siblings, 4 replies; 15+ messages in thread
From: Daniel Kahn Gillmor @ 2020-01-13 22:28 UTC (permalink / raw)
  To: Notmuch Mail; +Cc: Antoine Beaupré

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

This e-mail proposes a new notmuch subcommand "purge", which actually
removes explicitly deleted messages from the mailstore.

Notmuch currently never deletes mail, but notmuch-emacs makes it easy to
tag mail with "deleted" (via the "d") key, and "notmuch setup"
automatically adds "deleted" to the search.exclude_tags setting.

Users typically do actually want to delete messages, and they want them
gone from their filesystem and from the index.

while everyone who has used notmuch for a while probably has a clever
way of doing this, those techniques are all probably slightly different
(and possibly buggy), and the cognitive burden of figuring out how to do
this sensibly for new users seems like something we should avoid.

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)

If i was to implement this, i'd probably implement it directly in C, not
as a shell script, because this lets us drop messages from the db as we
unlink() the files.

Inevitably, someone will come up with some more clever
options/generalizations (i can already think of at least one), but if we
have a particular implementation to hang these proposals on, it should
help us to build something sensibly robust with a wider consensus, and
new users can pick up and use that functionality easily/safely/with
confidence.

I note that this is a divergence from the historical expectation of
having all "notmuch" subcommands not directly tamper with the
mailstore.  I think given the context that divergence is OK.

Any objections to this approach?

    --dkg

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

^ permalink raw reply	[flat|nested] 15+ messages in thread

end of thread, other threads:[~2020-01-15  9:59 UTC | newest]

Thread overview: 15+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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
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

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).