List for cgit developers and users
 help / color / mirror / Atom feed
From: jamie.couture at gmail.com (Jamie Couture)
Subject: [PATCH] ui-tree.c: check source filter if set globally
Date: Wed, 30 Jul 2014 21:05:38 -0400	[thread overview]
Message-ID: <20140731010538.GA9902@neptune> (raw)
In-Reply-To: <20140730211417.GK26927@serenity.lan>

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


  reply	other threads:[~2014-07-31  1:05 UTC|newest]

Thread overview: 15+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-07-28 21:14 source-filter isn't getting applied njn2118
2014-07-28 22:38 ` john
     [not found]   ` <CA+TJm37SY1PwBuYgTpn=bQz0D7LcGdwwSZb=38ZbHK_DX1j5JA@mail.gmail.com>
2014-07-29  3:59     ` Fwd: " njn2118
2014-07-29  7:37       ` john
2014-07-30  4:17         ` njn2118
2014-07-30  4:21           ` njn2118
2014-07-30  7:57           ` john
2014-07-30 18:53 ` [PATCH] ui-tree.c: check source filter if set globally jamie.couture
2014-07-30 19:23   ` john
2014-07-30 20:47     ` jamie.couture
2014-07-30 21:06       ` jamie.couture
2014-07-30 21:14       ` john
2014-07-31  1:05         ` jamie.couture [this message]
2014-07-31  1:08           ` jamie.couture
2014-08-01 15:38             ` Jason

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20140731010538.GA9902@neptune \
    --to=cgit@lists.zx2c4.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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 NNTP newsgroup(s).