On Thu, 12 Aug 2010, Stephen Paul Weber wrote: > For me: > > $ delve -t XFROMsingpolyma xapian > term `XFROMsingpolyma' not in database > $ delve -t XFROMdenver xapian > term `XFROMdenver' not in database > $ delve -V -r 1 xapian > Values for record #1: 0:à\Æ.¾p > Term List for record #1: XDIRECTORY > $ delve -V -r 2 xapian > Values for record #2: > Error: DocNotFoundError: Document 2 not found. Hmm, so you do not have the messages in the database. On which platform (and filesystem) you are? Could you run notmuch new through strace and/or apply the patch bellow and send the output? -Michal diff --git a/notmuch-new.c b/notmuch-new.c index 8818728..2fef9d1 100644 --- a/notmuch-new.c +++ b/notmuch-new.c @@ -298,6 +298,9 @@ add_files_recursive (notmuch_database_t *notmuch, } next = talloc_asprintf (notmuch, "%s/%s", path, entry->d_name); + + printf ("Pass 1 recursing into : %s = %s\n", entry->d_name, next); + status = add_files_recursive (notmuch, next, state); if (status && ret == NOTMUCH_STATUS_SUCCESS) ret = status; @@ -307,8 +310,10 @@ add_files_recursive (notmuch_database_t *notmuch, /* If this directory hasn't been modified since the last * "notmuch new", then we can skip the second pass entirely. */ - if (fs_mtime <= db_mtime) + if (fs_mtime <= db_mtime) { + printf ("Skipping pass 2 (old mtime)\n"); goto DONE; + } /* Pass 2: Scan for new files, removed files, and removed directories. */ for (i = 0; i < num_fs_entries; i++) @@ -318,6 +323,8 @@ add_files_recursive (notmuch_database_t *notmuch, entry = fs_entries[i]; + printf ("Pass 2 looking at: %s\n", entry->d_name); + /* Check if we've walked past any names in db_files or * db_subdirs. If so, these have been deleted. */ while (notmuch_filenames_valid (db_files) && @@ -380,6 +387,7 @@ add_files_recursive (notmuch_database_t *notmuch, if (notmuch_filenames_valid (db_files) && strcmp (notmuch_filenames_get (db_files), entry->d_name) == 0) { + printf ("Pass 2 skipping: %s (already added)\n", entry->d_name); notmuch_filenames_move_to_next (db_files); continue; }