unofficial mirror of notmuch@notmuchmail.org
 help / color / mirror / code / Atom feed
* [PATCH 1/3] remove Makefile.config from source to allow for custom config.
@ 2009-11-22 21:58 Jameson Graef Rollins
  2009-11-22 21:58 ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Jameson Graef Rollins
  2009-11-26  3:23 ` [PATCH 1/3] remove Makefile.config from source to allow for custom config Carl Worth
  0 siblings, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-22 21:58 UTC (permalink / raw)
  To: notmuch

Modified ./configure script to generate a Makefile.config if it
doesn't exist.  This will allow people to maintain custom
Makefile.config files without causing conflicts with the repository.
---
 Makefile.config |    2 --
 configure       |    8 ++++++++
 2 files changed, 8 insertions(+), 2 deletions(-)
 delete mode 100644 Makefile.config

diff --git a/Makefile.config b/Makefile.config
deleted file mode 100644
index d72a39e..0000000
--- a/Makefile.config
+++ /dev/null
@@ -1,2 +0,0 @@
-prefix = /usr/local
-bash_completion_dir = /etc/bash_completion.d
diff --git a/configure b/configure
index fe46c8e..c63f70d 100755
--- a/configure
+++ b/configure
@@ -109,6 +109,14 @@ configure again to ensure the packages can be found, or simply run
 EOF
     exit 1
 else
+
+if [ ! -e Makefile.config ] ; then
+    cat <<EOF >Makefile.config
+prefix = /usr/local
+bash_completion_dir = /etc/bash_completion.d
+EOF
+fi
+
 cat <<EOF
 
 All required packages were found. You may now run the following
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails.
  2009-11-22 21:58 [PATCH 1/3] remove Makefile.config from source to allow for custom config Jameson Graef Rollins
@ 2009-11-22 21:58 ` Jameson Graef Rollins
  2009-11-22 21:58   ` [PATCH 3/3] change config file location to be ~/.notmuch/config Jameson Graef Rollins
  2009-11-26  3:24   ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Carl Worth
  2009-11-26  3:23 ` [PATCH 1/3] remove Makefile.config from source to allow for custom config Carl Worth
  1 sibling, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-22 21:58 UTC (permalink / raw)
  To: notmuch

This fixes a small bug in notmuch_setup_command such that it returned
OK and output the setup message footer even if the config file write
step failed.
---
 notmuch-setup.c |   13 +++++++------
 1 files changed, 7 insertions(+), 6 deletions(-)

diff --git a/notmuch-setup.c b/notmuch-setup.c
index 482efd2..68788e1 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -155,10 +155,11 @@ notmuch_setup_command (unused (void *ctx),
 	notmuch_config_set_database_path (config, absolute_path);
     }
 
-    notmuch_config_save (config);
-
-    if (is_new)
-	welcome_message_post_setup ();
-
-    return 0;
+    if (! notmuch_config_save (config)) {
+	if (is_new)
+	  welcome_message_post_setup ();
+	return 0;
+    } else {
+	return 1;
+    }
 }
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 21:58 ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Jameson Graef Rollins
@ 2009-11-22 21:58   ` Jameson Graef Rollins
  2009-11-22 22:15     ` Jameson Graef Rollins
  2009-11-26  3:27     ` Carl Worth
  2009-11-26  3:24   ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Carl Worth
  1 sibling, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-22 21:58 UTC (permalink / raw)
  To: notmuch

This change creates a ~/.notmuch config directory where the config
file is stored when created with the "setup" command.  The use of a
~/.notmuch config directory creates one place where all notmuch config
files and data can be stored, which will greatly simplify managing
notmuch, and reduce cluter of user dot files.
---
 notmuch-config.c |   21 ++++++++++++++++++---
 notmuch-setup.c  |    2 +-
 notmuch.1        |    4 ++--
 notmuch.c        |    2 +-
 4 files changed, 22 insertions(+), 7 deletions(-)

diff --git a/notmuch-config.c b/notmuch-config.c
index 7252a19..321c880 100644
--- a/notmuch-config.c
+++ b/notmuch-config.c
@@ -22,9 +22,11 @@
 
 #include <pwd.h>
 #include <netdb.h>
+#include <libgen.h>
+#include <sys/stat.h>
 
 static const char toplevel_config_comment[] =
-    " .notmuch-config - Configuration file for the notmuch mail system\n"
+    " .notmuch/config - Configuration file for the notmuch mail system\n"
     "\n"
     " For more information about notmuch, see http://notmuchmail.org";
 
@@ -134,7 +136,7 @@ get_username_from_passwd_file (void *ctx)
 
 /* Open the named notmuch configuration file. A filename of NULL will
  * be interpreted as the default configuration file
- * ($HOME/.notmuch-config).
+ * ($HOME/.notmuch/config).
  *
  * If any error occurs, (out of memory, or a permission-denied error,
  * etc.), this function will print a message to stderr and return
@@ -183,7 +185,7 @@ notmuch_config_open (void *ctx,
     if (filename)
 	config->filename = talloc_strdup (config, filename);
     else
-	config->filename = talloc_asprintf (config, "%s/.notmuch-config",
+	config->filename = talloc_asprintf (config, "%s/.notmuch/config",
 					    getenv ("HOME"));
 
     config->key_file = g_key_file_new ();
@@ -297,14 +299,27 @@ notmuch_config_save (notmuch_config_t *config)
 {
     size_t length;
     char *data;
+    char buf[256];
     GError *error = NULL;
 
+    struct stat statbuf;
+
     data = g_key_file_to_data (config->key_file, &length, NULL);
     if (data == NULL) {
 	fprintf (stderr, "Out of memory.\n");
 	return 1;
     }
 
+    /* Create config directory if it doesn't already exist */
+    snprintf(buf, sizeof buf, "%s", config->filename);
+    dirname(buf);
+    if (stat(buf, &statbuf) < 0) {
+      if (mkdir(buf, 0755) < 0) {
+	fprintf (stderr, "Could not create directory '%s'\n.", buf);
+	return 1;
+      }
+    }
+
     if (! g_file_set_contents (config->filename, data, length, &error)) {
 	fprintf (stderr, "Error saving configuration to %s: %s\n",
 		 config->filename, error->message);
diff --git a/notmuch-setup.c b/notmuch-setup.c
index 68788e1..76e104c 100644
--- a/notmuch-setup.c
+++ b/notmuch-setup.c
@@ -74,7 +74,7 @@ welcome_message_post_setup (void)
 {
     printf ("\n"
 "Notmuch is now configured, and the configuration settings are saved in\n"
-"a file in your home directory named .notmuch-config . If you'd like to\n"
+"a file in your home directory named .notmuch/config . If you'd like to\n"
 "change the configuration in the future, you can either edit that file\n"
 "directly or run \"notmuch setup\".\n\n"
 
diff --git a/notmuch.1 b/notmuch.1
index 8a3fb40..9ea1d42 100644
--- a/notmuch.1
+++ b/notmuch.1
@@ -53,7 +53,7 @@ Interactively sets up notmuch for first use.
 The setup command will prompt for your full name, your primary email
 address, any alternate email addresses you use, and the directory
 containing your email archives. Your answers will be written to a
-configuration file in ${HOME}/.notmuch-config . This configuration
+configuration file in ${HOME}/.notmuch/config . This configuration
 file will be created with descriptive comments, making it easy to edit
 by hand later to change the configuration. Or you can run
 .B "notmuch setup"
@@ -245,7 +245,7 @@ takes an existing set of messages and constructs a suitable mail
 template. The Reply-to header (if any, otherwise From:) is used for
 the To: address. Vales from the To: and Cc: headers are copied, but
 not including any of the current user's email addresses (as configured
-in primary_mail or other_email in the .notmuch-config file) in the
+in primary_mail or other_email in the .notmuch/config file) in the
 recipient list
 
 It also builds a suitable new subject, including Re: at the front (if
diff --git a/notmuch.c b/notmuch.c
index 5cc8e4c..2d19a91 100644
--- a/notmuch.c
+++ b/notmuch.c
@@ -98,7 +98,7 @@ command_t commands[] = {
       "\t\tThe setup command will prompt for your full name, your primary\n"
       "\t\temail address, any alternate email addresses you use, and the\n"
       "\t\tdirectory containing your email archives. Your answers will be\n"
-      "\t\twritten to a configuration file in ${HOME}/.notmuch-config .\n"
+      "\t\twritten to a configuration file in ${HOME}/.notmuch/config .\n"
       "\n"
       "\t\tThis configuration file will be created with descriptive\n"
       "\t\tcomments, making it easy to edit by hand later to change the\n"
-- 
1.6.5

^ permalink raw reply related	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 21:58   ` [PATCH 3/3] change config file location to be ~/.notmuch/config Jameson Graef Rollins
@ 2009-11-22 22:15     ` Jameson Graef Rollins
  2009-11-22 22:24       ` Bart Trojanowski
  2009-11-26  3:27     ` Carl Worth
  1 sibling, 1 reply; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-22 22:15 UTC (permalink / raw)
  To: notmuch

[-- Attachment #1: Type: text/plain, Size: 6943 bytes --]

Hi, folks.  I wanted to comment on this patch request.

I personally think it makes a lot of sense to use config directories.
This makes things much neater, since all config files can be kept in
one place without clutter the config name space.  I can imagine down
the line that there may be more notmuch config files, and it would be
nicer to have a config directory rather than a bunch of ~/.notmuch-*
files in the user dot file config space.

I also imagine this config directory as a place to store the notmuch
database files.  I would rather keep all the notmuch data and config
files together in one place, and keep my mail directories completely
untouched (only read) by notmuch, if possible.

I realize, however, there is a transition problem associated with
moving the config file, which is why I propose it be moved sooner
rather than later.  If folks are interested in this change, and are
worried about transition even at this early stage, we can try to come
up with some smoother transition code.

Finally, I am (maybe clearly) *not* particularly adept at c
programming.  I'm still learning.  I think I already have better ways
to improve this patch.  I will try to make some improvements and send
those along as well.

jamie.

PS. I'm sure this has already been discussed on the list, but if this
is not the best way to send patches, please let me know.  I would be
happy to send a pointer to my notmuch git repo if it would be
preferable to just pull from it directly.


On Sun, Nov 22, 2009 at 04:58:36PM -0500, Jameson Graef Rollins wrote:
> This change creates a ~/.notmuch config directory where the config
> file is stored when created with the "setup" command.  The use of a
> ~/.notmuch config directory creates one place where all notmuch config
> files and data can be stored, which will greatly simplify managing
> notmuch, and reduce cluter of user dot files.
> ---
>  notmuch-config.c |   21 ++++++++++++++++++---
>  notmuch-setup.c  |    2 +-
>  notmuch.1        |    4 ++--
>  notmuch.c        |    2 +-
>  4 files changed, 22 insertions(+), 7 deletions(-)
> 
> diff --git a/notmuch-config.c b/notmuch-config.c
> index 7252a19..321c880 100644
> --- a/notmuch-config.c
> +++ b/notmuch-config.c
> @@ -22,9 +22,11 @@
>  
>  #include <pwd.h>
>  #include <netdb.h>
> +#include <libgen.h>
> +#include <sys/stat.h>
>  
>  static const char toplevel_config_comment[] =
> -    " .notmuch-config - Configuration file for the notmuch mail system\n"
> +    " .notmuch/config - Configuration file for the notmuch mail system\n"
>      "\n"
>      " For more information about notmuch, see http://notmuchmail.org";
>  
> @@ -134,7 +136,7 @@ get_username_from_passwd_file (void *ctx)
>  
>  /* Open the named notmuch configuration file. A filename of NULL will
>   * be interpreted as the default configuration file
> - * ($HOME/.notmuch-config).
> + * ($HOME/.notmuch/config).
>   *
>   * If any error occurs, (out of memory, or a permission-denied error,
>   * etc.), this function will print a message to stderr and return
> @@ -183,7 +185,7 @@ notmuch_config_open (void *ctx,
>      if (filename)
>  	config->filename = talloc_strdup (config, filename);
>      else
> -	config->filename = talloc_asprintf (config, "%s/.notmuch-config",
> +	config->filename = talloc_asprintf (config, "%s/.notmuch/config",
>  					    getenv ("HOME"));
>  
>      config->key_file = g_key_file_new ();
> @@ -297,14 +299,27 @@ notmuch_config_save (notmuch_config_t *config)
>  {
>      size_t length;
>      char *data;
> +    char buf[256];
>      GError *error = NULL;
>  
> +    struct stat statbuf;
> +
>      data = g_key_file_to_data (config->key_file, &length, NULL);
>      if (data == NULL) {
>  	fprintf (stderr, "Out of memory.\n");
>  	return 1;
>      }
>  
> +    /* Create config directory if it doesn't already exist */
> +    snprintf(buf, sizeof buf, "%s", config->filename);
> +    dirname(buf);
> +    if (stat(buf, &statbuf) < 0) {
> +      if (mkdir(buf, 0755) < 0) {
> +	fprintf (stderr, "Could not create directory '%s'\n.", buf);
> +	return 1;
> +      }
> +    }
> +
>      if (! g_file_set_contents (config->filename, data, length, &error)) {
>  	fprintf (stderr, "Error saving configuration to %s: %s\n",
>  		 config->filename, error->message);
> diff --git a/notmuch-setup.c b/notmuch-setup.c
> index 68788e1..76e104c 100644
> --- a/notmuch-setup.c
> +++ b/notmuch-setup.c
> @@ -74,7 +74,7 @@ welcome_message_post_setup (void)
>  {
>      printf ("\n"
>  "Notmuch is now configured, and the configuration settings are saved in\n"
> -"a file in your home directory named .notmuch-config . If you'd like to\n"
> +"a file in your home directory named .notmuch/config . If you'd like to\n"
>  "change the configuration in the future, you can either edit that file\n"
>  "directly or run \"notmuch setup\".\n\n"
>  
> diff --git a/notmuch.1 b/notmuch.1
> index 8a3fb40..9ea1d42 100644
> --- a/notmuch.1
> +++ b/notmuch.1
> @@ -53,7 +53,7 @@ Interactively sets up notmuch for first use.
>  The setup command will prompt for your full name, your primary email
>  address, any alternate email addresses you use, and the directory
>  containing your email archives. Your answers will be written to a
> -configuration file in ${HOME}/.notmuch-config . This configuration
> +configuration file in ${HOME}/.notmuch/config . This configuration
>  file will be created with descriptive comments, making it easy to edit
>  by hand later to change the configuration. Or you can run
>  .B "notmuch setup"
> @@ -245,7 +245,7 @@ takes an existing set of messages and constructs a suitable mail
>  template. The Reply-to header (if any, otherwise From:) is used for
>  the To: address. Vales from the To: and Cc: headers are copied, but
>  not including any of the current user's email addresses (as configured
> -in primary_mail or other_email in the .notmuch-config file) in the
> +in primary_mail or other_email in the .notmuch/config file) in the
>  recipient list
>  
>  It also builds a suitable new subject, including Re: at the front (if
> diff --git a/notmuch.c b/notmuch.c
> index 5cc8e4c..2d19a91 100644
> --- a/notmuch.c
> +++ b/notmuch.c
> @@ -98,7 +98,7 @@ command_t commands[] = {
>        "\t\tThe setup command will prompt for your full name, your primary\n"
>        "\t\temail address, any alternate email addresses you use, and the\n"
>        "\t\tdirectory containing your email archives. Your answers will be\n"
> -      "\t\twritten to a configuration file in ${HOME}/.notmuch-config .\n"
> +      "\t\twritten to a configuration file in ${HOME}/.notmuch/config .\n"
>        "\n"
>        "\t\tThis configuration file will be created with descriptive\n"
>        "\t\tcomments, making it easy to edit by hand later to change the\n"
> -- 
> 1.6.5
> 

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 22:15     ` Jameson Graef Rollins
@ 2009-11-22 22:24       ` Bart Trojanowski
  2009-11-22 23:14         ` Jameson Graef Rollins
  0 siblings, 1 reply; 12+ messages in thread
From: Bart Trojanowski @ 2009-11-22 22:24 UTC (permalink / raw)
  To: Jameson Graef Rollins; +Cc: notmuch

I totally agree with Jamie about the config rename.  I don't know if I
agree with the database location change... but I might just need some
convincing.

Would it be enough to just read .notmuch/config and fall back to
.notmuch-config otherwise?

-Bart

* Jameson Graef Rollins <jrollins@finestructure.net> [091122 17:15]:
> Hi, folks.  I wanted to comment on this patch request.
> 
> I personally think it makes a lot of sense to use config directories.
> This makes things much neater, since all config files can be kept in
> one place without clutter the config name space.  I can imagine down
> the line that there may be more notmuch config files, and it would be
> nicer to have a config directory rather than a bunch of ~/.notmuch-*
> files in the user dot file config space.
> 
> I also imagine this config directory as a place to store the notmuch
> database files.  I would rather keep all the notmuch data and config
> files together in one place, and keep my mail directories completely
> untouched (only read) by notmuch, if possible.
> 
> I realize, however, there is a transition problem associated with
> moving the config file, which is why I propose it be moved sooner
> rather than later.  If folks are interested in this change, and are
> worried about transition even at this early stage, we can try to come
> up with some smoother transition code.
> 
> Finally, I am (maybe clearly) *not* particularly adept at c
> programming.  I'm still learning.  I think I already have better ways
> to improve this patch.  I will try to make some improvements and send
> those along as well.
> 
> jamie.
> 
> PS. I'm sure this has already been discussed on the list, but if this
> is not the best way to send patches, please let me know.  I would be
> happy to send a pointer to my notmuch git repo if it would be
> preferable to just pull from it directly.
> 
> 
> On Sun, Nov 22, 2009 at 04:58:36PM -0500, Jameson Graef Rollins wrote:
> > This change creates a ~/.notmuch config directory where the config
> > file is stored when created with the "setup" command.  The use of a
> > ~/.notmuch config directory creates one place where all notmuch config
> > files and data can be stored, which will greatly simplify managing
> > notmuch, and reduce cluter of user dot files.
> > ---
> >  notmuch-config.c |   21 ++++++++++++++++++---
> >  notmuch-setup.c  |    2 +-
> >  notmuch.1        |    4 ++--
> >  notmuch.c        |    2 +-
> >  4 files changed, 22 insertions(+), 7 deletions(-)
> > 
> > diff --git a/notmuch-config.c b/notmuch-config.c
> > index 7252a19..321c880 100644
> > --- a/notmuch-config.c
> > +++ b/notmuch-config.c
> > @@ -22,9 +22,11 @@
> >  
> >  #include <pwd.h>
> >  #include <netdb.h>
> > +#include <libgen.h>
> > +#include <sys/stat.h>
> >  
> >  static const char toplevel_config_comment[] =
> > -    " .notmuch-config - Configuration file for the notmuch mail system\n"
> > +    " .notmuch/config - Configuration file for the notmuch mail system\n"
> >      "\n"
> >      " For more information about notmuch, see http://notmuchmail.org";
> >  
> > @@ -134,7 +136,7 @@ get_username_from_passwd_file (void *ctx)
> >  
> >  /* Open the named notmuch configuration file. A filename of NULL will
> >   * be interpreted as the default configuration file
> > - * ($HOME/.notmuch-config).
> > + * ($HOME/.notmuch/config).
> >   *
> >   * If any error occurs, (out of memory, or a permission-denied error,
> >   * etc.), this function will print a message to stderr and return
> > @@ -183,7 +185,7 @@ notmuch_config_open (void *ctx,
> >      if (filename)
> >  	config->filename = talloc_strdup (config, filename);
> >      else
> > -	config->filename = talloc_asprintf (config, "%s/.notmuch-config",
> > +	config->filename = talloc_asprintf (config, "%s/.notmuch/config",
> >  					    getenv ("HOME"));
> >  
> >      config->key_file = g_key_file_new ();
> > @@ -297,14 +299,27 @@ notmuch_config_save (notmuch_config_t *config)
> >  {
> >      size_t length;
> >      char *data;
> > +    char buf[256];
> >      GError *error = NULL;
> >  
> > +    struct stat statbuf;
> > +
> >      data = g_key_file_to_data (config->key_file, &length, NULL);
> >      if (data == NULL) {
> >  	fprintf (stderr, "Out of memory.\n");
> >  	return 1;
> >      }
> >  
> > +    /* Create config directory if it doesn't already exist */
> > +    snprintf(buf, sizeof buf, "%s", config->filename);
> > +    dirname(buf);
> > +    if (stat(buf, &statbuf) < 0) {
> > +      if (mkdir(buf, 0755) < 0) {
> > +	fprintf (stderr, "Could not create directory '%s'\n.", buf);
> > +	return 1;
> > +      }
> > +    }
> > +
> >      if (! g_file_set_contents (config->filename, data, length, &error)) {
> >  	fprintf (stderr, "Error saving configuration to %s: %s\n",
> >  		 config->filename, error->message);
> > diff --git a/notmuch-setup.c b/notmuch-setup.c
> > index 68788e1..76e104c 100644
> > --- a/notmuch-setup.c
> > +++ b/notmuch-setup.c
> > @@ -74,7 +74,7 @@ welcome_message_post_setup (void)
> >  {
> >      printf ("\n"
> >  "Notmuch is now configured, and the configuration settings are saved in\n"
> > -"a file in your home directory named .notmuch-config . If you'd like to\n"
> > +"a file in your home directory named .notmuch/config . If you'd like to\n"
> >  "change the configuration in the future, you can either edit that file\n"
> >  "directly or run \"notmuch setup\".\n\n"
> >  
> > diff --git a/notmuch.1 b/notmuch.1
> > index 8a3fb40..9ea1d42 100644
> > --- a/notmuch.1
> > +++ b/notmuch.1
> > @@ -53,7 +53,7 @@ Interactively sets up notmuch for first use.
> >  The setup command will prompt for your full name, your primary email
> >  address, any alternate email addresses you use, and the directory
> >  containing your email archives. Your answers will be written to a
> > -configuration file in ${HOME}/.notmuch-config . This configuration
> > +configuration file in ${HOME}/.notmuch/config . This configuration
> >  file will be created with descriptive comments, making it easy to edit
> >  by hand later to change the configuration. Or you can run
> >  .B "notmuch setup"
> > @@ -245,7 +245,7 @@ takes an existing set of messages and constructs a suitable mail
> >  template. The Reply-to header (if any, otherwise From:) is used for
> >  the To: address. Vales from the To: and Cc: headers are copied, but
> >  not including any of the current user's email addresses (as configured
> > -in primary_mail or other_email in the .notmuch-config file) in the
> > +in primary_mail or other_email in the .notmuch/config file) in the
> >  recipient list
> >  
> >  It also builds a suitable new subject, including Re: at the front (if
> > diff --git a/notmuch.c b/notmuch.c
> > index 5cc8e4c..2d19a91 100644
> > --- a/notmuch.c
> > +++ b/notmuch.c
> > @@ -98,7 +98,7 @@ command_t commands[] = {
> >        "\t\tThe setup command will prompt for your full name, your primary\n"
> >        "\t\temail address, any alternate email addresses you use, and the\n"
> >        "\t\tdirectory containing your email archives. Your answers will be\n"
> > -      "\t\twritten to a configuration file in ${HOME}/.notmuch-config .\n"
> > +      "\t\twritten to a configuration file in ${HOME}/.notmuch/config .\n"
> >        "\n"
> >        "\t\tThis configuration file will be created with descriptive\n"
> >        "\t\tcomments, making it easy to edit by hand later to change the\n"
> > -- 
> > 1.6.5
> > 



> _______________________________________________
> notmuch mailing list
> notmuch@notmuchmail.org
> http://notmuchmail.org/mailman/listinfo/notmuch


-- 
				WebSig: http://www.jukie.net/~bart/sig/

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 22:24       ` Bart Trojanowski
@ 2009-11-22 23:14         ` Jameson Graef Rollins
  2009-11-23  4:55           ` Carl Worth
  2009-11-26  3:29           ` Carl Worth
  0 siblings, 2 replies; 12+ messages in thread
From: Jameson Graef Rollins @ 2009-11-22 23:14 UTC (permalink / raw)
  To: Bart Trojanowski; +Cc: notmuch

[-- Attachment #1: Type: text/plain, Size: 1713 bytes --]

On Sun, Nov 22, 2009 at 05:24:53PM -0500, Bart Trojanowski wrote:
> I totally agree with Jamie about the config rename.  I don't know if I
> agree with the database location change... but I might just need some
> convincing.

So I don't really like having the database stored in the maildir.
There are a couple reasons for this:

- I would prefer to keep all notmuch stuff together, including all
  config files, data files, etc.  In my opinion, this just makes
  things easier to keep track of.  No need to guess where any relevant
  notmuch data is if it's all stored together in one place.

- I would prefer to not clutter my mail directories with anything
  that's not mail.  The notmuch database is definitely related to my
  mail, but it's not exactly my mail, so I'd rather keep it somewhere
  else.  (I think there's a whole other thread to be started about
  this, because I think the config should also hold the location of
  the maildir to be indexed, not the path to the index itself, which
  then makes implicit assumptions about where the maildir is.)  This
  point is also probably related to the fact that I've had to change
  MUAs too many times to trust one indefinitely.  So basically I want
  to keep my mail wholly separate from anything that's processing it.

I think Carl said he wanted to keep the ability to specify exactly
where the database is stored, so if we could move away from something
that makes any implicit assumptions about relative paths between the
database and the maildir, then all should be ok.

> Would it be enough to just read .notmuch/config and fall back to
> .notmuch-config otherwise?

Yes, this is a good idea.  I'll try to come up with a patch for this.

jamie.

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 836 bytes --]

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 23:14         ` Jameson Graef Rollins
@ 2009-11-23  4:55           ` Carl Worth
  2009-11-24 10:55             ` Jan Janak
  2009-11-26  3:29           ` Carl Worth
  1 sibling, 1 reply; 12+ messages in thread
From: Carl Worth @ 2009-11-23  4:55 UTC (permalink / raw)
  To: Jameson Graef Rollins, Bart Trojanowski; +Cc: notmuch

On Sun, 22 Nov 2009 18:14:20 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> I think Carl said he wanted to keep the ability to specify exactly
> where the database is stored, so if we could move away from something
> that makes any implicit assumptions about relative paths between the
> database and the maildir, then all should be ok.

Well, I chose the relative-path assumptions intentionally. The idea is
that if I move my mail from ~/Mail to ~/mail then the .notmuch directory
moves with it and everything continues to work just fine.

Compare the way .git works and the database stays with the source files
compared to the way cvs works, (where I always seemed to end up with
source files disconnected from the database).

So I might need more convincing to move the database away from the mail.

-Carl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-23  4:55           ` Carl Worth
@ 2009-11-24 10:55             ` Jan Janak
  0 siblings, 0 replies; 12+ messages in thread
From: Jan Janak @ 2009-11-24 10:55 UTC (permalink / raw)
  To: Carl Worth; +Cc: Bart Trojanowski, notmuch

On Mon, Nov 23, 2009 at 5:55 AM, Carl Worth <cworth@cworth.org> wrote:
> On Sun, 22 Nov 2009 18:14:20 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>> I think Carl said he wanted to keep the ability to specify exactly
>> where the database is stored, so if we could move away from something
>> that makes any implicit assumptions about relative paths between the
>> database and the maildir, then all should be ok.
>
> Well, I chose the relative-path assumptions intentionally. The idea is
> that if I move my mail from ~/Mail to ~/mail then the .notmuch directory
> moves with it and everything continues to work just fine.

Yeah, having relative paths in the database is a really good thing,
IMHO. I was pleasantly surprised that notmuch continued working after
I moved my mail from one directory to another :-).

  -- Jan

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 1/3] remove Makefile.config from source to allow for custom config.
  2009-11-22 21:58 [PATCH 1/3] remove Makefile.config from source to allow for custom config Jameson Graef Rollins
  2009-11-22 21:58 ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Jameson Graef Rollins
@ 2009-11-26  3:23 ` Carl Worth
  1 sibling, 0 replies; 12+ messages in thread
From: Carl Worth @ 2009-11-26  3:23 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

On Sun, 22 Nov 2009 16:58:34 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> Modified ./configure script to generate a Makefile.config if it
> doesn't exist.  This will allow people to maintain custom
> Makefile.config files without causing conflicts with the repository.

It's definitely a good idea to get the generated Makefile.config out of
the repository so that users can maintain their own versions without
conflicts.

In order to do this, we'll need to fix the Makefile to have a rule to
generate Makefile.config if it doesn't exist by running configure, (and
it could also give a message letting the user know that it's running
configure without arguments, and the user can run it explicitly with
arguments if desired[*]).

-Carl

[*] Of course, that's not *really* necessary until our configure script
actually *does* accept arguments, but we really should add at least
--prefix right away.

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails.
  2009-11-22 21:58 ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Jameson Graef Rollins
  2009-11-22 21:58   ` [PATCH 3/3] change config file location to be ~/.notmuch/config Jameson Graef Rollins
@ 2009-11-26  3:24   ` Carl Worth
  1 sibling, 0 replies; 12+ messages in thread
From: Carl Worth @ 2009-11-26  3:24 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

On Sun, 22 Nov 2009 16:58:35 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> This fixes a small bug in notmuch_setup_command such that it returned
> OK and output the setup message footer even if the config file write
> step failed.

Thanks for the fix. This is pushed.

-Carl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 21:58   ` [PATCH 3/3] change config file location to be ~/.notmuch/config Jameson Graef Rollins
  2009-11-22 22:15     ` Jameson Graef Rollins
@ 2009-11-26  3:27     ` Carl Worth
  1 sibling, 0 replies; 12+ messages in thread
From: Carl Worth @ 2009-11-26  3:27 UTC (permalink / raw)
  To: Jameson Graef Rollins, notmuch

On Sun, 22 Nov 2009 16:58:36 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
> This change creates a ~/.notmuch config directory where the config
> file is stored when created with the "setup" command.  The use of a
> ~/.notmuch config directory creates one place where all notmuch config
> files and data can be stored, which will greatly simplify managing
> notmuch, and reduce cluter of user dot files.

As discussed downthread, we should really make this fallback to load
~/.notmuch-config in case ~/.notmuch/config doesn't exist.

But as soon as we have that backwards compatibility in place, then
there's no rush for this change at all. We can wait until we actually
have a second file to store in here before we move from a single
.notmuch-config file to a ~/.notmuch/config file within a directory.

-Carl

^ permalink raw reply	[flat|nested] 12+ messages in thread

* Re: [PATCH 3/3] change config file location to be ~/.notmuch/config
  2009-11-22 23:14         ` Jameson Graef Rollins
  2009-11-23  4:55           ` Carl Worth
@ 2009-11-26  3:29           ` Carl Worth
  1 sibling, 0 replies; 12+ messages in thread
From: Carl Worth @ 2009-11-26  3:29 UTC (permalink / raw)
  To: Jameson Graef Rollins, Bart Trojanowski; +Cc: notmuch

On Sun, 22 Nov 2009 18:14:20 -0500, Jameson Graef Rollins <jrollins@finestructure.net> wrote:
>   else.  (I think there's a whole other thread to be started about
>   this, because I think the config should also hold the location of
>   the maildir to be indexed, not the path to the index itself, which
>   then makes implicit assumptions about where the maildir is.)

For what it's worth, the configuration *does* hold the location of the
maildir to be indexed, (and then makes an implicit assumption about
where the index is).

-Carl

^ permalink raw reply	[flat|nested] 12+ messages in thread

end of thread, other threads:[~2009-11-26  3:29 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-11-22 21:58 [PATCH 1/3] remove Makefile.config from source to allow for custom config Jameson Graef Rollins
2009-11-22 21:58 ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Jameson Graef Rollins
2009-11-22 21:58   ` [PATCH 3/3] change config file location to be ~/.notmuch/config Jameson Graef Rollins
2009-11-22 22:15     ` Jameson Graef Rollins
2009-11-22 22:24       ` Bart Trojanowski
2009-11-22 23:14         ` Jameson Graef Rollins
2009-11-23  4:55           ` Carl Worth
2009-11-24 10:55             ` Jan Janak
2009-11-26  3:29           ` Carl Worth
2009-11-26  3:27     ` Carl Worth
2009-11-26  3:24   ` [PATCH 2/3] modify notmuch_setup_command to return 1 if config file write fails Carl Worth
2009-11-26  3:23 ` [PATCH 1/3] remove Makefile.config from source to allow for custom config Carl Worth

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).