unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
From: Ben Gamari <bgamari.foss@gmail.com>
To: notmuch@notmuchmail.org
Subject: [PATCH 2/3] Produce status messages during compacting
Date: Mon, 20 Aug 2012 11:31:43 -0400	[thread overview]
Message-ID: <1345476704-17091-3-git-send-email-bgamari.foss@gmail.com> (raw)
In-Reply-To: <1345476704-17091-1-git-send-email-bgamari.foss@gmail.com>

---
 lib/database.cc |   15 ++++++++++++++-
 1 file changed, 14 insertions(+), 1 deletion(-)

diff --git a/lib/database.cc b/lib/database.cc
index 6e83a61..49aa36d 100644
--- a/lib/database.cc
+++ b/lib/database.cc
@@ -780,11 +780,24 @@ notmuch_database_close (notmuch_database_t *notmuch)
     notmuch->value_range_processor = NULL;
 }
 
+class NotmuchCompactor : public Xapian::Compactor
+{
+public:
+    virtual void
+    set_status (const std::string &table, const std::string &status)
+    {
+	if (status.length() == 0)
+	    fprintf (stderr, "compacting table %s:\n", table.c_str());
+	else
+	    fprintf (stderr, "     %s\n", status.c_str());
+    }
+};
+
 void
 notmuch_database_close_compact (notmuch_database_t *notmuch)
 {
     void *local = talloc_new (NULL);
-    Xapian::Compactor compactor;
+    NotmuchCompactor compactor;
     char *notmuch_path, *xapian_path, *compact_xapian_path, *old_xapian_path;
 
 #if HAVE_XAPIAN_COMPACT
-- 
1.7.9.5

  parent reply	other threads:[~2012-08-20 15:31 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-20 15:31 [PATCH RFC?] Compactification support Ben Gamari
2012-08-20 15:31 ` [PATCH 1/3] Add notmuch_database_close_compact Ben Gamari
2012-08-21  7:35   ` Tomi Ollila
2012-08-21 14:49     ` Ben Gamari
2012-08-22  6:07       ` Tomi Ollila
2012-08-23  5:56         ` Kim Minh Kaplan
2012-08-23  6:26           ` Tomi Ollila
2012-08-20 15:31 ` Ben Gamari [this message]
2012-08-20 15:31 ` [PATCH 3/3] Add notmuch compact command Ben Gamari
2012-08-21  8:07 ` [PATCH RFC?] Compactification support Jani Nikula
2012-08-21 14:48   ` Ben Gamari
2012-08-21 15:25     ` Tomi Ollila
  -- strict thread matches above, loose matches on Subject: below --
2012-10-17 15:28 [PATCH] notmuch compact support Ben Gamari
2012-10-17 15:28 ` [PATCH 2/3] Produce status messages during compacting Ben Gamari
2012-10-17 18:59   ` Jani Nikula

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://notmuchmail.org/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1345476704-17091-3-git-send-email-bgamari.foss@gmail.com \
    --to=bgamari.foss@gmail.com \
    --cc=notmuch@notmuchmail.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).