[RFC PATCH 0/5] cli: notmuch new scandir rework
authorJani Nikula <jani@nikula.org>
Fri, 15 Apr 2016 19:29:14 +0000 (22:29 +0300)
committerW. Trevor King <wking@tremily.us>
Sat, 20 Aug 2016 23:21:38 +0000 (16:21 -0700)
b0/f2f7098134af9027e1086f144337f6ca508289 [new file with mode: 0644]

diff --git a/b0/f2f7098134af9027e1086f144337f6ca508289 b/b0/f2f7098134af9027e1086f144337f6ca508289
new file mode 100644 (file)
index 0000000..4a5dae9
--- /dev/null
@@ -0,0 +1,108 @@
+Return-Path: <jani@nikula.org>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+ by arlo.cworth.org (Postfix) with ESMTP id 860E26DE00EB\r
+ for <notmuch@notmuchmail.org>; Fri, 15 Apr 2016 12:30:46 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at cworth.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.556\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.556 tagged_above=-999 required=5 tests=[AWL=0.164,\r
+  DKIM_SIGNED=0.1, DKIM_VALID=-0.1, RCVD_IN_DNSWL_LOW=-0.7,\r
+ RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01] autolearn=disabled\r
+Received: from arlo.cworth.org ([127.0.0.1])\r
+ by localhost (arlo.cworth.org [127.0.0.1]) (amavisd-new, port 10024)\r
+ with ESMTP id nEYz8wgo23LO for <notmuch@notmuchmail.org>;\r
+ Fri, 15 Apr 2016 12:30:37 -0700 (PDT)\r
+Received: from mail-wm0-f67.google.com (mail-wm0-f67.google.com\r
+ [74.125.82.67]) by arlo.cworth.org (Postfix) with ESMTPS id B5A4A6DE00F5 for\r
+ <notmuch@notmuchmail.org>; Fri, 15 Apr 2016 12:30:37 -0700 (PDT)\r
+Received: by mail-wm0-f67.google.com with SMTP id n3so8629323wmn.1\r
+ for <notmuch@notmuchmail.org>; Fri, 15 Apr 2016 12:30:37 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=nikula-org.20150623.gappssmtp.com; s=20150623;\r
+ h=from:to:cc:subject:date:message-id;\r
+ bh=gTA4HllegNCu2L0ydg4xINdI+VnfmxpVrbUzRT5HHBo=;\r
+ b=0+IrOQV0MPGESSxhj3bdTuoOJhgUcpgRyC2vJLseAcKPc62hfmPpL6upEvYRefiKSE\r
+ S2G3CUlrstFLaF1xK/uBEdpaYXh6RqWSdqFcuDVE31nNiSqjROHeOh3+aYiQcRd0hkFE\r
+ wjrm6SszLiTVlDaFJL4y3lKNsx7XNl0iRXjcTfYhNJ+3fhy5cofRRqCrnbB422YXOoi0\r
+ lfLHb9rbftwPOdUlAXNP3dZP3k2bx/Ag1ct8sO0FUKj1tOcg5L6aMQ+HCKddJGKPMagk\r
+ cMEshahndrhQp5qg1nLfgsHIBNmKBJf5jLchZkpT1jmzqTN2tp/iJp9G3uJv+CObhopQ\r
+ wtGQ==\r
+X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;\r
+ d=1e100.net; s=20130820;\r
+ h=x-gm-message-state:from:to:cc:subject:date:message-id;\r
+ bh=gTA4HllegNCu2L0ydg4xINdI+VnfmxpVrbUzRT5HHBo=;\r
+ b=P9SONMWuYHPCg0P95R1S4oXMgEbkLTJFmVrW3wKby/EyuPKhTGY0r0fkgGCqCaqSOc\r
+ /5zKjGDJSjXi3QaX1JFXfQZo81YYvIvSGOjUJYY8XmMuub8i3LbxlGiXo5SDOhzk/Enq\r
+ nm+tH9Q9lda8hPvJQLWOofcprFmeD/U+4MCI0bB7hbaw7MUMEqjZ8US2roZowYQE8dck\r
+ Zi1c7BplzEUZcU7Ufw97pcrDpfbYXdn/QKqCCHFu+5fAXBWxQVLRGO4ehUgkhjRc2piH\r
+ pcCtzmeLyzX50XKjhnKb1QcZMF1cU+DAKX4CXW26FpfOZvBYoqaIjdI9CUHx6/CvD8mA\r
+ /GXQ==\r
+X-Gm-Message-State:\r
+ AOPr4FWc7BKHLlTnPoDGqGr6F9HCyKEtgRtepaWdPkeMwPBWF4rlKdWs3nmNVv+G/VkpCw==\r
+X-Received: by 10.194.144.10 with SMTP id si10mr22992574wjb.180.1460748634560;\r
+  Fri, 15 Apr 2016 12:30:34 -0700 (PDT)\r
+Received: from localhost (mobile-access-bcee7f-102.dhcp.inet.fi.\r
+ [188.238.127.102])\r
+ by smtp.gmail.com with ESMTPSA id i5sm50411782wjx.15.2016.04.15.12.30.33\r
+ (version=TLSv1/SSLv3 cipher=OTHER);\r
+ Fri, 15 Apr 2016 12:30:33 -0700 (PDT)\r
+From: Jani Nikula <jani@nikula.org>\r
+To: notmuch@notmuchmail.org\r
+Subject: [RFC PATCH 0/5] cli: notmuch new scandir rework\r
+Date: Fri, 15 Apr 2016 22:29:14 +0300\r
+Message-Id: <cover.1460748142.git.jani@nikula.org>\r
+X-Mailer: git-send-email 2.1.4\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.20\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+ <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <https://notmuchmail.org/mailman/options/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=unsubscribe>\r
+List-Archive: <http://notmuchmail.org/pipermail/notmuch/>\r
+List-Post: <mailto:notmuch@notmuchmail.org>\r
+List-Help: <mailto:notmuch-request@notmuchmail.org?subject=help>\r
+List-Subscribe: <https://notmuchmail.org/mailman/listinfo/notmuch>,\r
+ <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Fri, 15 Apr 2016 19:30:46 -0000\r
+\r
+David gave some feedback to my old series to add globbing to new.ignore\r
+[1]. One thing that annoyed me in that series was that we have to do the\r
+ignore check in several places. I thought it would be nice to use the\r
+filter parameter to scandir(3) but alas you can't pass a context\r
+parameter there.\r
+\r
+I ended up experimenting with that, and here's the result. Maybe this\r
+makes it easier to read and understand the add_files() function, and\r
+this centralizes the new.ignore handling, but is this really worth it?\r
+I'm unsure.\r
+\r
+Patch 1 is trivial and should be pushed no matter what.\r
+\r
+BR,\r
+Jani.\r
+\r
+\r
+[1] id:871t6efgdt.fsf@maritornes.cs.unb.ca\r
+\r
+Jani Nikula (5):\r
+  cli: remove leftover dir variable\r
+  cli: drop inode sort order on directories unknown to the database\r
+  util: add a homebrew scandir implementation\r
+  cli: use homebrew scandir in notmuch new add_files\r
+  cli: convert count_files to new scandir\r
+\r
+ notmuch-new.c       | 382 ++++++++++++++++++++++++++++------------------------\r
+ util/Makefile.local |   2 +-\r
+ util/scandir.c      |  87 ++++++++++++\r
+ util/scandir.h      |  11 ++\r
+ 4 files changed, 305 insertions(+), 177 deletions(-)\r
+ create mode 100644 util/scandir.c\r
+ create mode 100644 util/scandir.h\r
+\r
+-- \r
+2.1.4\r
+\r