You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@subversion.apache.org by David Glasser <gl...@davidglasser.net> on 2007/09/28 22:37:00 UTC
[PATCH] global-ignores line too long in config
Currently, the global-ignores line in the autogenerated ~/.svn/config
file is 108 characters long! Ick. Instead it should wrap (and be a
nice example of continuation lines anyway).
This change isn't quite trivial, since the code that prints it uses
the SVN_CONFIG_DEFAULT_GLOBAL_IGNORES #define, and you don't want to
put the newline and # in that variable. I have a patch that "works",
but might be too ugly. What do you think?
--dave
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
Index: subversion/include/svn_config.h
===================================================================
--- subversion/include/svn_config.h (revision 26831)
+++ subversion/include/svn_config.h (working copy)
@@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
/*** Configuration Default Values ***/
/* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
+/* We want this to be printed on two lines in the generated config file,
+ * but we don't want the # character to end up in the variable.
+ */
+#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
+ "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
+#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
+ "*.rej *~ #*# .#* .*.swp .DS_Store"
+
#define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
- "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
- " *.rej *~ #*# .#* .*.swp .DS_Store"
+ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
+ SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
#define SVN_CONFIG_TRUE "true"
#define SVN_CONFIG_FALSE "false"
Index: subversion/libsvn_subr/config_file.c
===================================================================
--- subversion/libsvn_subr/config_file.c (revision 26846)
+++ subversion/libsvn_subr/config_file.c (working copy)
@@ -962,7 +962,8 @@ svn_config_ensure(const char *config_dir
"### which Subversion will ignore in its 'status' output, and" NL
"### while importing or adding files and directories." NL
"### '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'." NL
- "# global-ignores = " SVN_CONFIG_DEFAULT_GLOBAL_IGNORES "" NL
+ "# global-ignores = " SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 NL
+ "# " SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 NL
"### Set log-encoding to the default encoding for log messages" NL
"# log-encoding = latin1" NL
"### Set use-commit-times to make checkout/update/switch/revert" NL
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] global-ignores line too long in config
Posted by David Glasser <gl...@davidglasser.net>.
On 10/1/07, David Glasser <gl...@davidglasser.net> wrote:
> On 10/1/07, Daniel Rall <dl...@collab.net> wrote:
> > On Sat, 29 Sep 2007, David Glasser wrote:
> >
> > > On 9/28/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> > > > On Fri, 28 Sep 2007, David Glasser wrote:
> > > > ...
> > > > > Index: subversion/include/svn_config.h
> > > > > ===================================================================
> > > > > --- subversion/include/svn_config.h (revision 26831)
> > > > > +++ subversion/include/svn_config.h (working copy)
> > > > > @@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
> > > > > /*** Configuration Default Values ***/
> > > > >
> > > > > /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
> > > > > +/* We want this to be printed on two lines in the generated config file,
> > > > > + * but we don't want the # character to end up in the variable.
> > > > > + */
> > > > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
> > > > > + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
> > > > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
> > > > > + "*.rej *~ #*# .#* .*.swp .DS_Store"
> > > > > +
> > > > > #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
> > > > > - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
> > > > > - " *.rej *~ #*# .#* .*.swp .DS_Store"
> > > > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
> > > > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
> > > >
> > > > I'd rather not see more double-underscore symbols -- and these
> > > > #defines in particular -- in a public header file.
> > > > You could put them into a new include/private/ header instead.
> > > >
> > > > The patch looks reasonable to me, other than that. (The ugliness
> > > > is intrinsic, unfortunately.)
> > >
> > > I guess. So should the private header be included right there inside
> > > svn_config.h? That also leads to the value not being visible in the
> > > header, which is a shame.
> >
> > Bah. Perhaps it's not worth it. :-\
>
> OK. In that case, I'm going to go with ugliness in the
> developer-visible file (ie, the patch I posted) rather than ugliness
> in the user-visible config file (ie, the status quo).
Committed in r26912.
--dave
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] global-ignores line too long in config
Posted by David Glasser <gl...@davidglasser.net>.
On 10/1/07, Daniel Rall <dl...@collab.net> wrote:
> On Sat, 29 Sep 2007, David Glasser wrote:
>
> > On 9/28/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> > > On Fri, 28 Sep 2007, David Glasser wrote:
> > > ...
> > > > Index: subversion/include/svn_config.h
> > > > ===================================================================
> > > > --- subversion/include/svn_config.h (revision 26831)
> > > > +++ subversion/include/svn_config.h (working copy)
> > > > @@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
> > > > /*** Configuration Default Values ***/
> > > >
> > > > /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
> > > > +/* We want this to be printed on two lines in the generated config file,
> > > > + * but we don't want the # character to end up in the variable.
> > > > + */
> > > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
> > > > + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
> > > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
> > > > + "*.rej *~ #*# .#* .*.swp .DS_Store"
> > > > +
> > > > #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
> > > > - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
> > > > - " *.rej *~ #*# .#* .*.swp .DS_Store"
> > > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
> > > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
> > >
> > > I'd rather not see more double-underscore symbols -- and these
> > > #defines in particular -- in a public header file.
> > > You could put them into a new include/private/ header instead.
> > >
> > > The patch looks reasonable to me, other than that. (The ugliness
> > > is intrinsic, unfortunately.)
> >
> > I guess. So should the private header be included right there inside
> > svn_config.h? That also leads to the value not being visible in the
> > header, which is a shame.
>
> Bah. Perhaps it's not worth it. :-\
OK. In that case, I'm going to go with ugliness in the
developer-visible file (ie, the patch I posted) rather than ugliness
in the user-visible config file (ie, the status quo).
--dave
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] global-ignores line too long in config
Posted by Daniel Rall <dl...@collab.net>.
On Sat, 29 Sep 2007, David Glasser wrote:
> On 9/28/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> > On Fri, 28 Sep 2007, David Glasser wrote:
> > ...
> > > Index: subversion/include/svn_config.h
> > > ===================================================================
> > > --- subversion/include/svn_config.h (revision 26831)
> > > +++ subversion/include/svn_config.h (working copy)
> > > @@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
> > > /*** Configuration Default Values ***/
> > >
> > > /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
> > > +/* We want this to be printed on two lines in the generated config file,
> > > + * but we don't want the # character to end up in the variable.
> > > + */
> > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
> > > + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
> > > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
> > > + "*.rej *~ #*# .#* .*.swp .DS_Store"
> > > +
> > > #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
> > > - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
> > > - " *.rej *~ #*# .#* .*.swp .DS_Store"
> > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
> > > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
> >
> > I'd rather not see more double-underscore symbols -- and these
> > #defines in particular -- in a public header file.
> > You could put them into a new include/private/ header instead.
> >
> > The patch looks reasonable to me, other than that. (The ugliness
> > is intrinsic, unfortunately.)
>
> I guess. So should the private header be included right there inside
> svn_config.h? That also leads to the value not being visible in the
> header, which is a shame.
Bah. Perhaps it's not worth it. :-\
Re: [PATCH] global-ignores line too long in config
Posted by David Glasser <gl...@davidglasser.net>.
On 9/28/07, Daniel L. Rall <dl...@finemaltcoding.com> wrote:
> On Fri, 28 Sep 2007, David Glasser wrote:
> ...
> > Index: subversion/include/svn_config.h
> > ===================================================================
> > --- subversion/include/svn_config.h (revision 26831)
> > +++ subversion/include/svn_config.h (working copy)
> > @@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
> > /*** Configuration Default Values ***/
> >
> > /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
> > +/* We want this to be printed on two lines in the generated config file,
> > + * but we don't want the # character to end up in the variable.
> > + */
> > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
> > + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
> > +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
> > + "*.rej *~ #*# .#* .*.swp .DS_Store"
> > +
> > #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
> > - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
> > - " *.rej *~ #*# .#* .*.swp .DS_Store"
> > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
> > + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
>
> I'd rather not see more double-underscore symbols -- and these
> #defines in particular -- in a public header file.
> You could put them into a new include/private/ header instead.
>
> The patch looks reasonable to me, other than that. (The ugliness
> is intrinsic, unfortunately.)
I guess. So should the private header be included right there inside
svn_config.h? That also leads to the value not being visible in the
header, which is a shame.
--dave
--
David Glasser | glasser@davidglasser.net | http://www.davidglasser.net/
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@subversion.tigris.org
For additional commands, e-mail: dev-help@subversion.tigris.org
Re: [PATCH] global-ignores line too long in config
Posted by "Daniel L. Rall" <dl...@finemaltcoding.com>.
On Fri, 28 Sep 2007, David Glasser wrote:
...
> Index: subversion/include/svn_config.h
> ===================================================================
> --- subversion/include/svn_config.h (revision 26831)
> +++ subversion/include/svn_config.h (working copy)
> @@ -121,9 +121,17 @@ typedef struct svn_config_t svn_config_t
> /*** Configuration Default Values ***/
>
> /* '*' matches leading dots, e.g. '*.rej' matches '.foo.rej'. */
> +/* We want this to be printed on two lines in the generated config file,
> + * but we don't want the # character to end up in the variable.
> + */
> +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 \
> + "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo"
> +#define SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2 \
> + "*.rej *~ #*# .#* .*.swp .DS_Store"
> +
> #define SVN_CONFIG_DEFAULT_GLOBAL_IGNORES \
> - "*.o *.lo *.la *.al .libs *.so *.so.[0-9]* *.a *.pyc *.pyo" \
> - " *.rej *~ #*# .#* .*.swp .DS_Store"
> + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_1 " " \
> + SVN_CONFIG__DEFAULT_GLOBAL_IGNORES_LINE_2
I'd rather not see more double-underscore symbols -- and these
#defines in particular -- in a public header file.
You could put them into a new include/private/ header instead.
The patch looks reasonable to me, other than that. (The ugliness
is intrinsic, unfortunately.)