[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

Re: two questions (and a proposed patch) regarding svn:ignore

From: Julian Foad <julianfoad_at_btopenworld.com>
Date: Wed, 03 Feb 2010 00:11:09 +0000

On Tue, 2010-02-02, 'Stefan Sperling' wrote:
> On Tue, Feb 02, 2010 at 09:12:42PM +0100, Bert Huijben wrote:
> > In this libsvn_client_addX() case it would be adding an extra boolean to
> > pass to the new svn_client_addX() function... And passing the right value
> > from the wrapper in deprecated.c.
>
> Right, no problem. So we add svn_client_add5, with boolean
> 'no_global_ignores' and 'no_svn_ignores' (better name anyone?).

While we're revving it, consider this API design point. We pass the list
of global ignores in to the function through the CTX parameter. It seems
stupid to have an additional parameter that says whether to ignore the
global ignores. Instead, the caller should set
CTX->config['config:miscellany:global-ignores'] to empty before calling
this function.

Makes sense?

The caller would look something like this (untested):
[[[
Index: subversion/svn/add-cmd.c
===================================================================
--- subversion/svn/add-cmd.c (revision 905836)
+++ subversion/svn/add-cmd.c (working copy)
@@ -66,6 +66,15 @@
 
   SVN_ERR(svn_opt_eat_peg_revisions(&targets, targets, pool));
 
+ if (opt_state->no_ignore)
+ {
+ svn_config_t *config = apr_hash_get(ctx->config, "config",
+ APR_HASH_KEY_STRING);
+
+ if (config)
+ svn_config_set(config, "miscellany", "global-ignores", NULL);
+ }
+
   subpool = svn_pool_create(pool);
   for (i = 0; i < targets->nelts; i++)
     {
]]]

(The call to svn_client_add5() would then pass just the new
"no_svn_ignores" parameter that you suggest.)

It could be argued that it's "easier" for a caller to pass a
"no-ignores" flag that overrides part of the config, but the same could
be said about all parts of the config and that would be silly. If we
want to use separate parameters, let's just use separate parameters. If
we want to pass a config structure, let's use it.

- Julian

> The old API would be interpreted as always passing no_svn_ignores = FALSE,
> and setting no_global_ignores based on svn_client_add4's no_ignore
> parameter. Would that be OK?
>
> Stefan
Received on 2010-02-03 01:11:50 CET

This is an archived mail posted to the Subversion Dev mailing list.