Re: [PATCH 2/3] notmuch-mutt: support for messages that lack Message-ID headers
[notmuch-archives.git] / f9 / 0b04f53d3d0e9d4754409ee6603f804ad21ab9
1 Return-Path: <amdragon@mit.edu>\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 DE3C5429E29\r
6         for <notmuch@notmuchmail.org>; Thu, 24 May 2012 15:01:30 -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: -0.7\r
10 X-Spam-Level: \r
11 X-Spam-Status: No, score=-0.7 tagged_above=-999 required=5\r
12         tests=[RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\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 XbRHno5qo8Hi for <notmuch@notmuchmail.org>;\r
16         Thu, 24 May 2012 15:01:29 -0700 (PDT)\r
17 Received: from dmz-mailsec-scanner-3.mit.edu (DMZ-MAILSEC-SCANNER-3.MIT.EDU\r
18         [18.9.25.14])\r
19         by olra.theworths.org (Postfix) with ESMTP id 26340431E84\r
20         for <notmuch@notmuchmail.org>; Thu, 24 May 2012 15:01:23 -0700 (PDT)\r
21 X-AuditID: 1209190e-b7fd86d0000008b4-a3-4fbeafb32bc3\r
22 Received: from mailhub-auth-2.mit.edu ( [18.7.62.36])\r
23         by dmz-mailsec-scanner-3.mit.edu (Symantec Messaging Gateway) with SMTP\r
24         id 74.77.02228.3BFAEBF4; Thu, 24 May 2012 18:01:23 -0400 (EDT)\r
25 Received: from outgoing.mit.edu (OUTGOING-AUTH.MIT.EDU [18.7.22.103])\r
26         by mailhub-auth-2.mit.edu (8.13.8/8.9.2) with ESMTP id q4OM1N5B021199; \r
27         Thu, 24 May 2012 18:01:23 -0400\r
28 Received: from drake.mit.edu (26-4-163.dynamic.csail.mit.edu [18.26.4.163])\r
29         (authenticated bits=0)\r
30         (User authenticated as amdragon@ATHENA.MIT.EDU)\r
31         by outgoing.mit.edu (8.13.6/8.12.4) with ESMTP id q4OM1MrS009166\r
32         (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=NOT);\r
33         Thu, 24 May 2012 18:01:23 -0400 (EDT)\r
34 Received: from amthrax by drake.mit.edu with local (Exim 4.77)\r
35         (envelope-from <amdragon@mit.edu>)\r
36         id 1SXg5w-00064c-I9; Thu, 24 May 2012 18:01:20 -0400\r
37 From: Austin Clements <amdragon@MIT.EDU>\r
38 To: notmuch@notmuchmail.org\r
39 Subject: [PATCH v4 4/4] new: Unify add_files and add_files_recursive\r
40 Date: Thu, 24 May 2012 18:01:13 -0400\r
41 Message-Id: <1337896873-23253-5-git-send-email-amdragon@mit.edu>\r
42 X-Mailer: git-send-email 1.7.10\r
43 In-Reply-To: <1337896873-23253-1-git-send-email-amdragon@mit.edu>\r
44 References: <1337887922-13163-1-git-send-email-amdragon@mit.edu>\r
45         <1337896873-23253-1-git-send-email-amdragon@mit.edu>\r
46 X-Brightmail-Tracker:\r
47  H4sIAAAAAAAAA+NgFtrMIsWRmVeSWpSXmKPExsUixG6nort5/T5/g1uLtCyu35zJ7MDo8WzV\r
48         LeYAxigum5TUnMyy1CJ9uwSujAebp7AWPOGruHl7LlsD41PuLkZODgkBE4mGnqXMELaYxIV7\r
49         69m6GLk4hAT2MUqsPrQQytnAKHH43D5GCOc4k8Scdw/YIZxZjBKnT9xlAelnE9CQ2LZ/OSOI\r
50         LSIgLbHz7mzWLkYODmYBNYk/XSogYWEBF4mPa1+ClbMIqEps2tbBBmLzCjhIvPk5jQniDHmJ\r
51         p/f7wOKcAo4Sj8/+AhspJFAucfnGXJYJjPwLGBlWMcqm5Fbp5iZm5hSnJusWJyfm5aUW6Rrr\r
52         5WaW6KWmlG5iBIUNpyTfDsavB5UOMQpwMCrx8LJE7/MXYk0sK67MPcQoycGkJMr7YzVQiC8p\r
53         P6UyI7E4I76oNCe1+BCjBAezkgivYCRQjjclsbIqtSgfJiXNwaIkzrtKc7e/kEB6Yklqdmpq\r
54         QWoRTFaGg0NJgvfgOqBGwaLU9NSKtMycEoQ0EwcnyHAeoOH660GGFxck5hZnpkPkTzEqSonz\r
55         PgFpFgBJZJTmwfXC4voVozjQK8K830GqeIApAa77FdBgJqDBWx7vBRlckoiQkmpgnL0+pzH5\r
56         gZbelNaTG0rM9bs/GC63Mvp/VU1/h4jV9H0HZ767FOWl9j+T4dr8jLrAlZfeN2xaHdHisU1N\r
57         xna6pPLZDy+1Gaf1J+UwKpmZvX5WHlVpv9tp/8IprE4rLqlITuz+1J/72mN+Kg+LE6tVXMpT\r
58         xfCgTmFHwcS4H1/9Zt8rEWubmlusxFKckWioxVxUnAgAdjcpJMYCAAA=\r
59 X-BeenThere: notmuch@notmuchmail.org\r
60 X-Mailman-Version: 2.1.13\r
61 Precedence: list\r
62 List-Id: "Use and development of the notmuch mail system."\r
63         <notmuch.notmuchmail.org>\r
64 List-Unsubscribe: <http://notmuchmail.org/mailman/options/notmuch>,\r
65         <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
66 List-Archive: <http://notmuchmail.org/pipermail/notmuch>\r
67 List-Post: <mailto:notmuch@notmuchmail.org>\r
68 List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
69 List-Subscribe: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
70         <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
71 X-List-Received-Date: Thu, 24 May 2012 22:01:31 -0000\r
72 \r
73 Since starting at the top of a directory tree and recursing within\r
74 that tree are now identical operations, there's no need for both\r
75 add_files and add_files_recursive.  This eliminates add_files (which\r
76 did nothing more than call add_files_recursive after the previous\r
77 patch) and renames add_files_recursive to add_files.\r
78 ---\r
79  notmuch-new.c |   18 ++++--------------\r
80  1 file changed, 4 insertions(+), 14 deletions(-)\r
81 \r
82 diff --git a/notmuch-new.c b/notmuch-new.c\r
83 index 2b05605..938ae29 100644\r
84 --- a/notmuch-new.c\r
85 +++ b/notmuch-new.c\r
86 @@ -281,9 +281,9 @@ _entry_in_ignore_list (const char *entry, add_files_state_t *state)\r
87   *     if fs_mtime isn't the current wall-clock time.\r
88   */\r
89  static notmuch_status_t\r
90 -add_files_recursive (notmuch_database_t *notmuch,\r
91 -                    const char *path,\r
92 -                    add_files_state_t *state)\r
93 +add_files (notmuch_database_t *notmuch,\r
94 +          const char *path,\r
95 +          add_files_state_t *state)\r
96  {\r
97      DIR *dir = NULL;\r
98      struct dirent *entry = NULL;\r
99 @@ -377,7 +377,7 @@ add_files_recursive (notmuch_database_t *notmuch,\r
100         }\r
101  \r
102         next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name);\r
103 -       status = add_files_recursive (notmuch, next, state);\r
104 +       status = add_files (notmuch, next, state);\r
105         if (status) {\r
106             ret = status;\r
107             goto DONE;\r
108 @@ -647,16 +647,6 @@ stop_progress_printing_timer (void)\r
109  }\r
110  \r
111  \r
112 -/* This is the top-level entry point for add_files. It does a couple\r
113 - * of error checks and then calls into the recursive function. */\r
114 -static notmuch_status_t\r
115 -add_files (notmuch_database_t *notmuch,\r
116 -          const char *path,\r
117 -          add_files_state_t *state)\r
118 -{\r
119 -    return add_files_recursive (notmuch, path, state);\r
120 -}\r
121 -\r
122  /* XXX: This should be merged with the add_files function since it\r
123   * shares a lot of logic with it. */\r
124  /* Recursively count all regular files in path and all sub-directories\r
125 -- \r
126 1.7.10\r
127 \r