[PATCH] ui-tree.c: check source filter if set globally

Jamie Couture jamie.couture at gmail.com
Thu Jul 31 03:05:38 CEST 2014


On Wed, Jul 30, 2014 at 10:14:17PM +0100, John Keeping wrote:
> > Well, 'everything except source-filter' isn't really the case.
> 
> It is the case that all repo-specific settings except source-filter
> would be ignored if they come after the repository is loaded.
> 

Okay.

> > 
> > Maybe we do if users are having issues?  
> 
> Currently we support something like this:
> 
> 	scan-path=/path/to/world-a
> 	source-filter=/path/to/source-filter.sh
> 	scan-path=/path/to/world-b
> 
> Where the source filter isn't applied to "world-a".  I don't know if
> anyone makes use of this, but the current scheme does give quite a lot
> of flexibility.
> 

You got me.

This is a situation I have not considered to be a use-case others
may actually *want*.  I am not aware of anyone who does this in
practise, I know I do not do anything like that, but in
consideration of being most flexible we would lose that ability.

> > > Perhaps we would be better off making the documentation clearer rather
> > > than trying to fix some particular cases?
> > > 
> > 
> > I'm okay with this change, as long as it avoids problems for the
> > user. I don't think it introdces any sort of unwanted or unexpected
> > behaviour.  However, it should try to be more complete with the
> > remaining filter options.
> > 
> > I'm fine with this being turfed, but we do get a lot of questions
> > about scan-path problems.
> 
> I tend to think that shows that the documentation is lacking rather than
> the implementation, but I dunno.  Maybe I just don't want to deal with
> making sure that all repo variables fall back to the global one if it's
> set after scan-path or repo.url.

Indeed.  A solution, even to try and defer processing of
scan-path/scan-tree after we do parse_configfile() is awkward and
would defeat the use-case you mention above.

I'm not sure if the following adds much more value to the docs,
because it assumes people are going to configure cgitrc in a
specific way.

Maybe it would be better to include a _troubleshooting_ section to
README?  There we could repeat and assert that any global setting
defined after scan-path will not be defined.

-- 8< --
--- a/cgitrc.5.txt
+++ b/cgitrc.5.txt
@@ -378,6 +378,10 @@ scan-path::
        before the scan-path directive will be applied to each repository.
        Default value: none. See also: cache-scanrc-ttl, project-list,
        "MACRO EXPANSION".
++
+[NOTE]
+    It is general practise to define scan-path at the end of a cgitrc
+    file to ensure the global settings are used.

 section::
        The name of the current repository section - all repositories defined
-- 8< --


More information about the CGit mailing list