Re: [PATCH v4 16/16] add "notmuch reindex" subcommand
[notmuch-archives.git] / ac / 2be82a3d6b736f989007438963d67973381886
1 Return-Path: <Sebastian@SSpaeth.de>\r
2 X-Original-To: notmuch@notmuchmail.org\r
3 Delivered-To: notmuch@notmuchmail.org\r
4 Received: from localhost (localhost [127.0.0.1])\r
5         by olra.theworths.org (Postfix) with ESMTP id 28AA4418C25\r
6         for <notmuch@notmuchmail.org>; Thu, 15 Apr 2010 23:38:56 -0700 (PDT)\r
7 X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
8 X-Spam-Flag: NO\r
9 X-Spam-Score: -1.9\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5\r
12         tests=[BAYES_00=-1.9] autolearn=ham\r
13 Received: from olra.theworths.org ([127.0.0.1])\r
14         by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
15         with ESMTP id OFHdufeZ+JM1 for <notmuch@notmuchmail.org>;\r
16         Thu, 15 Apr 2010 23:38:55 -0700 (PDT)\r
17 Received: from homiemail-a20.g.dreamhost.com (caiajhbdcbhh.dreamhost.com\r
18         [208.97.132.177])\r
19         by olra.theworths.org (Postfix) with ESMTP id 188D4431FC1\r
20         for <notmuch@notmuchmail.org>; Thu, 15 Apr 2010 23:38:55 -0700 (PDT)\r
21 Received: from localhost.localdomain (unknown [195.190.188.219])\r
22         by homiemail-a20.g.dreamhost.com (Postfix) with ESMTPA id E8CCA7EC061; \r
23         Thu, 15 Apr 2010 23:38:53 -0700 (PDT)\r
24 From: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
25 To: Notmuch developer list <notmuch@notmuchmail.org>\r
26 Subject: [PATCH 2/3] notmuch-search: Introduce --sort=unsorted\r
27 Date: Fri, 16 Apr 2010 08:38:47 +0200\r
28 Message-Id: <1271399928-6166-2-git-send-email-Sebastian@SSpaeth.de>\r
29 X-Mailer: git-send-email 1.7.0.4\r
30 In-Reply-To: <87eiifj433.fsf@SSpaeth.de>\r
31 References: <87eiifj433.fsf@SSpaeth.de>\r
32 X-BeenThere: notmuch@notmuchmail.org\r
33 X-Mailman-Version: 2.1.13\r
34 Precedence: list\r
35 List-Id: "Use and development of the notmuch mail system."\r
36         <notmuch.notmuchmail.org>\r
37 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
38         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
39 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
40 List-Post: <mailto:notmuch@notmuchmail.org>\r
41 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
42 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
43         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
44 X-List-Received-Date: Fri, 16 Apr 2010 06:38:56 -0000\r
45 \r
46 In some cases, we might not be interested in any special sort order, so\r
47 this introduces a --sort=unsorted command line option together with its\r
48 documentation.\r
49 \r
50 Signed-off-by: Sebastian Spaeth <Sebastian@SSpaeth.de>\r
51 ---\r
52  notmuch-search.c |    2 ++\r
53  notmuch.1        |   10 ++++++----\r
54  notmuch.c        |    7 ++++---\r
55  3 files changed, 12 insertions(+), 7 deletions(-)\r
56 \r
57 diff --git a/notmuch-search.c b/notmuch-search.c\r
58 index 4e3514b..854a9ae 100644\r
59 --- a/notmuch-search.c\r
60 +++ b/notmuch-search.c\r
61 @@ -217,6 +217,8 @@ notmuch_search_command (void *ctx, int argc, char *argv[])\r
62                 sort = NOTMUCH_SORT_OLDEST_FIRST;\r
63             } else if (strcmp (opt, "newest-first") == 0) {\r
64                 sort = NOTMUCH_SORT_NEWEST_FIRST;\r
65 +           } else if (strcmp (opt, "unsorted") == 0) {\r
66 +               sort = NOTMUCH_SORT_UNSORTED;\r
67             } else {\r
68                 fprintf (stderr, "Invalid value for --sort: %s\n", opt);\r
69                 return 1;\r
70 diff --git a/notmuch.1 b/notmuch.1\r
71 index 86830f4..6d4beaf 100644\r
72 --- a/notmuch.1\r
73 +++ b/notmuch.1\r
74 @@ -152,12 +152,14 @@ Presents the results in either JSON or plain-text (default).\r
75  .RE\r
76  .RS 4\r
77  .TP 4\r
78 -.BR \-\-sort= ( newest\-first | oldest\-first )\r
79 +.BR \-\-sort= ( newest\-first | oldest\-first | unsorted)\r
80  \r
81  This option can be used to present results in either chronological order\r
82 -.RB ( oldest\-first )\r
83 -or reverse chronological order\r
84 -.RB ( newest\-first ).\r
85 +.RB ( oldest\-first ),\r
86 +reverse chronological order\r
87 +.RB ( newest\-first )\r
88 +or without any defined sort order\r
89 +.RB ( unsorted ).\r
90  \r
91  Note: The thread order will be distinct between these two options\r
92  (beyond being simply reversed). When sorting by\r
93 diff --git a/notmuch.c b/notmuch.c\r
94 index dcfda32..e31dd88 100644\r
95 --- a/notmuch.c\r
96 +++ b/notmuch.c\r
97 @@ -165,11 +165,12 @@ command_t commands[] = {\r
98        "\t\tPresents the results in either JSON or\n"\r
99        "\t\tplain-text (default)\n"\r
100        "\n"\r
101 -      "\t--sort=(newest-first|oldest-first)\n"\r
102 +      "\t--sort=(newest-first|oldest-first|unsorted)\n"\r
103        "\n"\r
104        "\t\tPresent results in either chronological order\n"\r
105 -      "\t\t(oldest-first) or reverse chronological order\n"\r
106 -      "\t\t(newest-first), which is the default.\n"\r
107 +      "\t\t(oldest-first),reverse chronological order\n"\r
108 +      "\t\t(newest-first), which is the default or\n"\r
109 +      "\t\t(unsorted) without any special sort order.\n"\r
110        "\n"\r
111        "\tSee \"notmuch help search-terms\" for details of the search\n"\r
112        "\tterms syntax." },\r
113 -- \r
114 1.7.0.4\r
115 \r