Re: [PATCH 1/3] Add notmuch_database_close_compact
authorBen Gamari <bgamari.foss@gmail.com>
Tue, 21 Aug 2012 14:49:47 +0000 (10:49 +2000)
committerW. Trevor King <wking@tremily.us>
Fri, 7 Nov 2014 17:49:10 +0000 (09:49 -0800)
90/7e12c2733f290344415c2ce9860d4943d9409b [new file with mode: 0644]

diff --git a/90/7e12c2733f290344415c2ce9860d4943d9409b b/90/7e12c2733f290344415c2ce9860d4943d9409b
new file mode 100644 (file)
index 0000000..cb989ba
--- /dev/null
@@ -0,0 +1,162 @@
+Return-Path: <bgamari.foss@gmail.com>\r
+X-Original-To: notmuch@notmuchmail.org\r
+Delivered-To: notmuch@notmuchmail.org\r
+Received: from localhost (localhost [127.0.0.1])\r
+       by olra.theworths.org (Postfix) with ESMTP id EAD83431FAF\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Aug 2012 07:49:49 -0700 (PDT)\r
+X-Virus-Scanned: Debian amavisd-new at olra.theworths.org\r
+X-Spam-Flag: NO\r
+X-Spam-Score: -0.799\r
+X-Spam-Level: \r
+X-Spam-Status: No, score=-0.799 tagged_above=-999 required=5\r
+       tests=[DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1,\r
+       FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7] autolearn=disabled\r
+Received: from olra.theworths.org ([127.0.0.1])\r
+       by localhost (olra.theworths.org [127.0.0.1]) (amavisd-new, port 10024)\r
+       with ESMTP id 6rHkW5d8C4V3 for <notmuch@notmuchmail.org>;\r
+       Tue, 21 Aug 2012 07:49:49 -0700 (PDT)\r
+Received: from mail-vc0-f181.google.com (mail-vc0-f181.google.com\r
+       [209.85.220.181]) (using TLSv1 with cipher RC4-SHA (128/128 bits))\r
+       (No client certificate requested)\r
+       by olra.theworths.org (Postfix) with ESMTPS id 41355431FAE\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Aug 2012 07:49:49 -0700 (PDT)\r
+Received: by vcbfl17 with SMTP id fl17so6836798vcb.26\r
+       for <notmuch@notmuchmail.org>; Tue, 21 Aug 2012 07:49:48 -0700 (PDT)\r
+DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;\r
+       h=from:to:subject:in-reply-to:references:user-agent:date:message-id\r
+       :mime-version:content-type;\r
+       bh=6CKf4619w2jvc/UZ2Fw9HGcbkRAtZQ/PDG36Fj2qz+k=;\r
+       b=0ia0z0GDaf0nac5rdujX/6xZd7Rbzz3Br05wr3OxleVFMZgWd5I9WeU94c0j6oJVbm\r
+       KjXmLSi56uCGOcXHckDgwbuX950aD5oc+IVCOZJHlLirZYsYt+co8xIQvi3ElT96y0lp\r
+       5ClMw9NgdSfpP0dFv3tpDVmCg/ogU5S/byLhFs1PZ3xed9IrigxGmpOfh+Q6Wfz0fk/3\r
+       tPF3gBovRrj2F2m6WHjFLgqb0djB7ypDMgRvr963F/yB0FlNy8WzFiube76b+zQsDCK5\r
+       MR+vxotAgHWb/ALOYN+baVws39xdLmiHf6PmtjfP28CjiZMcmo8V4oxq4keYuGWnVrOd\r
+       7zCw==\r
+Received: by 10.220.148.210 with SMTP id q18mr13684647vcv.6.1345560588715;\r
+       Tue, 21 Aug 2012 07:49:48 -0700 (PDT)\r
+Received: from localhost (pool-108-8-230-85.spfdma.east.verizon.net.\r
+       [108.8.230.85])\r
+       by mx.google.com with ESMTPS id br15sm763977vdb.13.2012.08.21.07.49.47\r
+       (version=TLSv1/SSLv3 cipher=OTHER);\r
+       Tue, 21 Aug 2012 07:49:48 -0700 (PDT)\r
+From: Ben Gamari <bgamari.foss@gmail.com>\r
+To: Tomi Ollila <tomi.ollila@iki.fi>, notmuch <notmuch@notmuchmail.org>\r
+Subject: Re: [PATCH 1/3] Add notmuch_database_close_compact\r
+In-Reply-To: <m27gssitot.fsf@guru.guru-group.fi>\r
+References: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com>\r
+       <1345476704-17091-2-git-send-email-bgamari.foss@gmail.com>\r
+       <m27gssitot.fsf@guru.guru-group.fi>\r
+User-Agent: Notmuch/0.13.2+137~g3dc1094 (http://notmuchmail.org) Emacs/23.3.1\r
+       (x86_64-pc-linux-gnu)\r
+Date: Tue, 21 Aug 2012 10:49:47 -0400\r
+Message-ID: <87y5l8z4dw.fsf@gmail.com>\r
+MIME-Version: 1.0\r
+Content-Type: text/plain; charset=us-ascii\r
+X-BeenThere: notmuch@notmuchmail.org\r
+X-Mailman-Version: 2.1.13\r
+Precedence: list\r
+List-Id: "Use and development of the notmuch mail system."\r
+       <notmuch.notmuchmail.org>\r
+List-Unsubscribe: <http://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: <http://notmuchmail.org/mailman/listinfo/notmuch>,\r
+       <mailto:notmuch-request@notmuchmail.org?subject=subscribe>\r
+X-List-Received-Date: Tue, 21 Aug 2012 14:49:50 -0000\r
+\r
+Tomi Ollila <tomi.ollila@iki.fi> writes:\r
+\r
+> On Mon, Aug 20 2012, Ben Gamari <bgamari.foss@gmail.com> wrote:\r
+>\r
+>> ---\r
+>>  configure       |   25 ++++++++++++++++++++++++-\r
+>>  lib/database.cc |   54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++\r
+>>  lib/notmuch.h   |   14 ++++++++++++++\r
+>>  3 files changed, 92 insertions(+), 1 deletion(-)\r
+>>\r
+>> diff --git a/configure b/configure\r
+>> index dc0dba4..370fedd 100755\r
+>> --- a/configure\r
+>> +++ b/configure\r
+>> @@ -270,7 +270,8 @@ printf "Checking for Xapian development files... "\r
+>>  have_xapian=0\r
+>>  for xapian_config in ${XAPIAN_CONFIG}; do\r
+>>      if ${xapian_config} --version > /dev/null 2>&1; then\r
+>> -   printf "Yes (%s).\n" $(${xapian_config} --version | sed -e 's/.* //')\r
+>> +   xapian_version=$(${xapian_config} --version | sed -e 's/.* //')\r
+>> +   printf "Yes (%s).\n" ${xapian_version}\r
+>>     have_xapian=1\r
+>>     xapian_cxxflags=$(${xapian_config} --cxxflags)\r
+>>     xapian_ldflags=$(${xapian_config} --libs)\r
+>> @@ -282,6 +283,24 @@ if [ ${have_xapian} = "0" ]; then\r
+>>      errors=$((errors + 1))\r
+>>  fi\r
+>>  \r
+>> +have_xapian_compact=0\r
+>> +if [ ${have_xapian} = "1" ]; then\r
+>> +    printf "Checking for Xapian compact support... "\r
+>> +    IFS='.'\r
+>> +    old_args=$@\r
+>> +    set -- ${xapian_version}\r
+>> +    xapian_major_version=$1\r
+>> +    xapian_minor_version=$2\r
+>> +    xapian_subminor_version=$3\r
+>> +    set -- ${old_args}\r
+>\r
+> The part above breaks the argument vector in case there are spaces in \r
+> args (I though $IFS chars, but try the script), execute:\r
+>\r
+Hmmm, I suppose so.\r
+\r
+> $ echo '#!/bin/bash\r
+> IFS=.\r
+> for x in "$@"; do echo $x; done; echo\r
+> foo=$@\r
+> for x in $foo; do echo $x; done; echo\r
+> set -- $foo\r
+> for x in "$@"; do echo $x; done; echo\r
+> ' > foo.bash\r
+>\r
+> $ bash foo.bash a "b c" d\r
+>\r
+> Also, after processing, IFS is not restored (to $DEFAULT_IFS)\r
+>\r
+I assumed this would be alright since IFS is set in the next \r
+\r
+> an alternative is to put the code in function like the following\r
+> way:\r
+>\r
+Sounds good to me.\r
+\r
+> Hmm, I guess the check above is to determine whether xapian version is\r
+> 1.2.6 or newer, but is there xapian version 1.1.6 or 1.0.6 or 0.3.0 or so ?\r
+>\r
+Eh? 1.2.6 is the first Xapian release to have Compactor exposed in the\r
+public API.\r
+\r
+> I am not qualified to comment about compaction itself :)\r
+>\r
+Nor am I really. I just noticed that this functionality was blocking on\r
+library support which is now in place. It seemed that a pretty\r
+straightforward thing to implement and it hasn't broken my index yet.\r
+\r
+> In the last patch you give copyright to Carl (which is OK). However I'd\r
+> debate whether it is good practise to declare Carl as author; I'd say that\r
+> is OK if he agrees to claim authorship to your potentially shi^H^H^Hperfect\r
+> code ;)\r
+>\r
+Yikes. That certainly wasn't intentional. I'll fix this in the next\r
+iteration.\r
+\r
+> There are at least a few style issues below: e.g. no space between function\r
+> name and opening parenthesis.\r
+>\r
+Duly noted.\r
+\r
+Thanks!\r
+\r
+Cheers,\r
+\r
+- Ben\r