* A few patches @ 2010-01-21 20:42 Mike Kelly 2010-02-26 19:24 ` Carl Worth 0 siblings, 1 reply; 5+ messages in thread From: Mike Kelly @ 2010-01-21 20:42 UTC (permalink / raw) To: notmuch I've got a few patches available in my notmuch repo: http://git.pioto.org/gitweb/notmuch.git The 'noarg-count' branch makes `notmuch count` without any argument simply return the total number of messages in the database. This seems like it could be useful. The 'new-unread' branch makes `notmuch new` only tag messages as 'unread' if they don't have a maildir 'seen' flag. This shouldn't affect anyones existing database, but should make initial imports for people migrating from other mail setups (like me) go much better. -- Mike Kelly ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: A few patches 2010-01-21 20:42 A few patches Mike Kelly @ 2010-02-26 19:24 ` Carl Worth 2010-02-27 10:37 ` David Edmondson 0 siblings, 1 reply; 5+ messages in thread From: Carl Worth @ 2010-02-26 19:24 UTC (permalink / raw) To: Mike Kelly, notmuch [-- Attachment #1: Type: text/plain, Size: 2629 bytes --] Hi Mike, welcome to notmuch! On Thu, 21 Jan 2010 15:42:00 -0500 (EST), "Mike Kelly" <pioto@pioto.org> wrote: > I've got a few patches available in my notmuch repo: > > http://git.pioto.org/gitweb/notmuch.git Thanks for sharing these! I really like how the distributed nature of git makes it so easy for us to mix and match patches like this. > The 'noarg-count' branch makes `notmuch count` without any argument > simply return the total number of messages in the database. This seems > like it could be useful. The functionality does seem very useful, but I'd like it to be a tiny bit more general. There are cases where it would be useful to return all results from any the various search-based commands, (notmuch search, notmuch show, etc.). But I think it would be unkind if "notmuch show" with no arguments spewed the entire contents of the mail collection at the user. So what I would like to see is that any of these commands given no argument would instead give some helpful information---I think it should be either the information currently available in "notmuch help search-terms" or perhaps an abbreviated version of it. Then, I'd like to have a new, succinct and explicit syntax to indicate a search that should return all results. For example, we could use '*' but that has the issue that it would need escaping from the shell. But the idea would be to be able to run: notmuch count '*' to count everything. Anyone have a better option for what the give-me-everything syntax should be? > The 'new-unread' branch makes `notmuch new` only tag messages as > 'unread' if they don't have a maildir 'seen' flag. This shouldn't affect > anyones existing database, but should make initial imports for people > migrating from other mail setups (like me) go much better. One of the longest-standing items on our TODO list has been to provide proper support for these maildir flags. In fact, look at the top of our current TODO file: Fix the things that are causing the most pain to new users ---------------------------------------------------------- 1. A new import is tagging all messages as "inbox" -- total pain There are various proposals and patches on the list already, and we need to figure out exactly what we want, (it's easy to get bogged down once we think about handling changes to these flags later, whether notmuch should changes the maildir flag when the tags are changed, etc.). Perhaps just starting with a patch like yours and going from there is the right plan. Would you please send it to the list so I've got a reminder about it here, and can reply with any review? Thanks, -Carl [-- Attachment #2: Type: application/pgp-signature, Size: 189 bytes --] ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: A few patches 2010-02-26 19:24 ` Carl Worth @ 2010-02-27 10:37 ` David Edmondson 2010-03-01 13:13 ` Sebastian Spaeth 0 siblings, 1 reply; 5+ messages in thread From: David Edmondson @ 2010-02-27 10:37 UTC (permalink / raw) To: Carl Worth, Mike Kelly, notmuch On Fri, 26 Feb 2010 11:24:44 -0800, Carl Worth <cworth@cworth.org> wrote: > Then, I'd like to have a new, succinct and explicit syntax to indicate a > search that should return all results. For example, we could use '*' but > that has the issue that it would need escaping from the shell. But the > idea would be to be able to run: > > notmuch count '*' > > to count everything. Anyone have a better option for what the > give-me-everything syntax should be? notmuch count '' The search patterns limit the matched messages/folders. An empty pattern should match everything. dme. -- David Edmondson, http://dme.org ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: A few patches 2010-02-27 10:37 ` David Edmondson @ 2010-03-01 13:13 ` Sebastian Spaeth 2010-03-02 3:54 ` Mike Kelly 0 siblings, 1 reply; 5+ messages in thread From: Sebastian Spaeth @ 2010-03-01 13:13 UTC (permalink / raw) To: Notmuch development list > > to count everything. Anyone have a better option for what the > > give-me-everything syntax should be? > > notmuch count '' > > The search patterns limit the matched messages/folders. An empty pattern > should match everything. I agree that '' should work, but then I would expect to have '*' work as well. Is there a reason not to have both at the same time? Both make sense. Sebastian ^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: A few patches 2010-03-01 13:13 ` Sebastian Spaeth @ 2010-03-02 3:54 ` Mike Kelly 0 siblings, 0 replies; 5+ messages in thread From: Mike Kelly @ 2010-03-02 3:54 UTC (permalink / raw) To: notmuch [-- Attachment #1.1: Type: text/plain, Size: 569 bytes --] On Mon, 01 Mar 2010 14:13:05 +0100 "Sebastian Spaeth" <Sebastian@SSpaeth.de> wrote: > > > to count everything. Anyone have a better option for what the > > > give-me-everything syntax should be? > > > > notmuch count '' > > > > The search patterns limit the matched messages/folders. An empty > > pattern should match everything. > > I agree that '' should work, but then I would expect to have '*' work > as well. Is there a reason not to have both at the same time? Both > make sense. Try out this patch. It works both ways. -- Mike Kelly [-- Warning: decoded text below may be mangled, UTF-8 assumed --] [-- Attachment #1.2: 0001-Support-notmuch-count-with-no-args-or.patch --] [-- Type: text/x-patch, Size: 798 bytes --] From 861a52ecaf87da6d95aabad05fd4ed3a2609a246 Mon Sep 17 00:00:00 2001 From: Mike Kelly <pioto@pioto.org> Date: Mon, 1 Mar 2010 22:51:44 -0500 Subject: [PATCH] Support notmuch-count with no args, '', or '*' All of these will return the total count of messages. --- notmuch-count.c | 2 +- 1 files changed, 1 insertions(+), 1 deletions(-) diff --git a/notmuch-count.c b/notmuch-count.c index cc84a69..97242ab 100644 --- a/notmuch-count.c +++ b/notmuch-count.c @@ -90,7 +90,7 @@ notmuch_count_command (void *ctx, int argc, char *argv[]) fprintf (stderr, "Out of memory.\n"); return 1; } - if (*query_str == '\0') { + if (*query_str == '\0' || (*query_str == '*' && *(query_str+1) == '\0')) { query_str = talloc_strdup (ctx, ""); } -- 1.7.0.1 [-- Attachment #2: signature.asc --] [-- Type: application/pgp-signature, Size: 198 bytes --] ^ permalink raw reply related [flat|nested] 5+ messages in thread
end of thread, other threads:[~2010-03-02 3:55 UTC | newest] Thread overview: 5+ messages (download: mbox.gz follow: Atom feed -- links below jump to the message on this page -- 2010-01-21 20:42 A few patches Mike Kelly 2010-02-26 19:24 ` Carl Worth 2010-02-27 10:37 ` David Edmondson 2010-03-01 13:13 ` Sebastian Spaeth 2010-03-02 3:54 ` Mike Kelly
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).