]> git.notmuchmail.org Git - notmuch/commitdiff
lib/config: add config keys for git-remote-notmuch.
authorDavid Bremner <david@tethera.net>
Sat, 12 Oct 2024 00:58:41 +0000 (21:58 -0300)
committerDavid Bremner <david@tethera.net>
Sat, 9 Aug 2025 11:19:43 +0000 (08:19 -0300)
The precise function will be explained in a future update to
notmuch-config(1).

lib/config.cc
lib/notmuch.h
test/T030-config.sh
test/T055-path-config.sh
test/T590-libconfig.sh

index 8fbd7336ce9ec4e3f9b811233022189a69ae8a3c..d231c8931f739af8a7184089a45d9ede777b2eaf 100644 (file)
@@ -608,6 +608,12 @@ _notmuch_config_key_to_string (notmuch_config_key_t key)
        return "search.authors_matched_separator";
     case NOTMUCH_CONFIG_INDEX_AS_TEXT:
        return "index.as_text";
+    case NOTMUCH_CONFIG_GIT_FAIL_ON_MISSING:
+       return "git.fail_on_missing";
+    case NOTMUCH_CONFIG_GIT_METADATA_PREFIX:
+       return "git.metadata_prefix";
+    case NOTMUCH_CONFIG_GIT_REF:
+       return "git.ref";
     default:
        return NULL;
     }
@@ -636,6 +642,7 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
     case NOTMUCH_CONFIG_NEW_TAGS:
        return "unread;inbox";
     case NOTMUCH_CONFIG_SYNC_MAILDIR_FLAGS:
+    case NOTMUCH_CONFIG_GIT_FAIL_ON_MISSING:
        return "true";
     case NOTMUCH_CONFIG_USER_NAME:
        name = getenv ("NAME");
@@ -660,6 +667,10 @@ _notmuch_config_default (notmuch_database_t *notmuch, notmuch_config_key_t key)
        return ", ";
     case NOTMUCH_CONFIG_AUTHORS_MATCHED_SEPARATOR:
        return "| ";
+    case NOTMUCH_CONFIG_GIT_METADATA_PREFIX:
+       return "_notmuch_metadata";
+    case NOTMUCH_CONFIG_GIT_REF:
+       return "refs/heads/master";
     case NOTMUCH_CONFIG_EXTRA_HEADERS:
     case NOTMUCH_CONFIG_HOOK_DIR:
     case NOTMUCH_CONFIG_BACKUP_DIR:
index 95918fc291f9d87dee7c88c2698fa216092d976b..7f520c49967c8177b9b25f9045972b9562a3bf2b 100644 (file)
@@ -2635,6 +2635,9 @@ typedef enum {
     NOTMUCH_CONFIG_INDEX_AS_TEXT,
     NOTMUCH_CONFIG_AUTHORS_SEPARATOR,
     NOTMUCH_CONFIG_AUTHORS_MATCHED_SEPARATOR,
+    NOTMUCH_CONFIG_GIT_FAIL_ON_MISSING,
+    NOTMUCH_CONFIG_GIT_METADATA_PREFIX,
+    NOTMUCH_CONFIG_GIT_REF,
     NOTMUCH_CONFIG_LAST
 } notmuch_config_key_t;
 
index 1d2b7df8def6c605fe82841abb25fe7f57edb065..ce6653ee2bde1a0f0027b74807aab0ce6be60ddf 100755 (executable)
@@ -59,6 +59,9 @@ database.mail_root=MAIL_DIR
 database.path=MAIL_DIR
 foo.list=this;is another;list value;
 foo.string=this is another string value
+git.fail_on_missing=true
+git.metadata_prefix=_notmuch_metadata
+git.ref=refs/heads/master
 index.as_text=
 maildir.synchronize_flags=true
 new.ignore=
index 049b745e0a6d807218ad5c0c6526b8e59116ea34..4d1edec0ef4376b3bcdab983d542b1299e43b4eb 100755 (executable)
@@ -299,6 +299,9 @@ database.backup_dir
 database.hook_dir
 database.mail_root=MAIL_DIR
 database.path
+git.fail_on_missing=true
+git.metadata_prefix=_notmuch_metadata
+git.ref=refs/heads/master
 index.as_text=
 maildir.synchronize_flags=true
 new.ignore=
@@ -325,6 +328,9 @@ database.backup_dir
 database.hook_dir
 database.mail_root
 database.path
+git.fail_on_missing
+git.metadata_prefix
+git.ref
 maildir.synchronize_flags
 new.tags
 search.authors_matched_separator
index 9b3648957b6a10eb1963815078f4bbf056ff2c80..e893fd1f4ca4da0df9954620986583378166af3d 100755 (executable)
@@ -443,6 +443,9 @@ cat <<'EOF' >EXPECTED
 13: ''
 14: ', '
 15: '| '
+16: 'true'
+17: '_notmuch_metadata'
+18: 'refs/heads/master'
 == stderr ==
 EOF
 unset MAILDIR
@@ -760,6 +763,9 @@ cat <<'EOF' >EXPECTED
 13: 'text/'
 14: ', '
 15: '| '
+16: 'true'
+17: '_notmuch_metadata'
+18: 'refs/heads/master'
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT
@@ -797,6 +803,9 @@ cat <<'EOF' >EXPECTED
 13: ''
 14: ', '
 15: '| '
+16: 'true'
+17: '_notmuch_metadata'
+18: 'refs/heads/master'
 == stderr ==
 EOF
 test_expect_equal_file EXPECTED OUTPUT.clean
@@ -868,6 +877,9 @@ database.backup_dir MAIL_DIR/.notmuch/backups
 database.hook_dir MAIL_DIR/.notmuch/hooks
 database.mail_root MAIL_DIR
 database.path MAIL_DIR
+git.fail_on_missing true
+git.metadata_prefix _notmuch_metadata
+git.ref refs/heads/master
 index.as_text text/
 key with spaces value, with, spaces!
 maildir.synchronize_flags true