lib: add better diagnostics for over long filenames. Previously we just crashed with an internal error. With this change, the caller can handle it better. Update notmuch-new so that it doesn't crash with "unknown error code" because of this change.
cli/new: only ignore .notmuch at top level Since the bug was first reported in [1], notmuch has gained the ability to have the database located outside the mail root, hence this this change differs slightly from Jani's proposed solution [2] in not using notmuch_database_get_path, but rather the already retrieved mail_root. [1]: id:87mwhifu9a.fsf@trouble.defaultvalue.org [2]: id:87ios5v59p.fsf@nikula.org
CLI: move indexopts variable out of shared options block This reduces the amount of global state. Furthermore, index options can be set (in principle) in several ways, not just in the one function for processing indexing command line options.
CLI: make variable n_requested_db_uuid file scope. It turns out that now that we pass an open database into the subcommands, it is easy to check any requested uuid against the database at the same time as we process the other shared arguments. This results in overall less boilerplate code, as well as making a CLI scope function and variable file scope in notmuch.c.
CLI/new: check status of notmuch_message_maildir_flags_to_tags This improves error reporting since it prints the specifics of the exception.
CLI: make static message strings const This is both a bit clearer and avoids the possibility of modification.
CLI: drop notmuch_config_t from subcommand interface. At this point it is unused in all subcommands.
CLI/new: use configuration variable for backup directory The stat is essentially replaced by the mkdir for error detection purposes. This changes the default location for backups to make things tidier, even in non-split configurations. Hopefully there is not too many user scripts relying on the previous location. Because the default location may not exist, replace the use of stat for error detection with a call to mkdir.
CLI/new: support split database and mail location This adds new state variable for the mail root, and uses it most places db_path was used. The notable exception is dumps from backups. The latter will be dealt with properly in a future commit.
CLI/new: drop the write lock to run the pre-new hook. This fixes a bug reported in [1]. In principle it could be possible avoid one of these reopens, but it complicates the logic in main with respect to creating new databases. [1]: id:9C1993DF-84BD-4199-A9C8-BADA98498812@bubblegen.co.uk
cli: run uncrustify This is the result of running $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h in the top level source directory Line breaks were then adjusted manually to keep argc and argv together.
CLI: use configured hook directory This enables support for hooks outside the database directory. It relies strongly on configuration information being usable between closing the database and destroying it.
cli/new: convert to new config framework In addition to the same type of changes as converting other subcommands, add the possibility of creating a database at the top level. It would probably make sense to use this for insert as well.
cli/new: refactor database upgrade code Move to a separate function. This is essentially just code movement.
CLI: add (unused) database argument to subcommands. This will allow transitioning individual subcommands to the new configuration framework. Eventually when they are all converted we can remove the notmuch_config_t * argument. For now, live with the parameter shadowing in some some subcommands; it will go away when they are converted.
cli/new: replace newly deprecated n_m_has_maildir_flag Boolean return values have no out-of-band-values to signal errors. The change here is that a (somewhat unlikely) fatal error after indexing will now be caught.
cli: run uncrustify This is the result of running $ uncrustify --replace --config devel/uncrustify.cfg *.c *.h in the top level source directory
gmime-cleanup: drop all arguments unused in GMime 3 This means dropping GMimeCryptoContext and notmuch_config arguments. All the argument changes are to internal functions, so this is not an API or ABI break. We also get to drop the #define for g_mime_3_unused. signed-off-by: Daniel Kahn Gillmor <dkg@fifthhorseman.net>
CLI/new: add full-scan option By default notmuch-new uses directory mtimes to optimize the scanning of directories for new mail. This option allows turning that optimization off e.g. for testing or debugging.
cli/new: support /<regex>/ in new.ignore Add support for using /<regex>/ style regular expressions in new.ignore, mixed with the old style verbatim file and directory basenames. The regex is matched against the relative path from the database path.