bugGNU arch -- a revision control system - Bugs: bug #6059, support for per-directory...

 
 

bug #6059: support for per-directory categorization regexps

Submitted by:  Invalid User ID <Invalid User ID>
Submitted on:  Sun 19 Oct 2003 11:21:21 PM UTC  
 
Category: tlaSeverity: 3 - Normal
Item Group: small feature ideaStatus: Fixed
Privacy: PublicOpen/Closed: Closed
Release: lord@emf.net--2003b/tla--devo--1.1--patch-188
Fixed Release: 
Merge Request?: yes -- merge from my archive
Your Archive Name: robin.farine@terminus.org--arch-2003
Your Archive Location: 
Assigned to: None

Add a New Comment(Rich Markup)
   

You are not logged in

Please log in, so followups can be emailed to you.

 

Tue 25 Nov 2003 09:15:33 PM UTC, comment #5:

merged into lord@emf.net--2003b/tla--devo--1.1--patch-217

Robert Collins <robertc>
Sun 09 Nov 2003 12:27:46 AM UTC, comment #4:

Well, I've been convinced that the current approach is reasonable. Following is the irc log for posterity

<lifeless> mine is: because the global defaults aren't present, doing general regexes will be a headache using this code.
<erg> II want the global regexps to handle the common cases, then in one dir I can just add source ^core$ ...
<erg> to include core in the source category Otherwise, any change to the common
<erg> regexps could potentially invalidate local definitions.
<lifeless> sure they can.
<erg> forget this.
<lifeless> my point is that just adding ^core$ ... ?
<erg> if I add source ^core$ in a subdir, 'tutu' still matches the common source regexp so its simple and easy to ...
<erg> handle exceptions
<erg> by adding them to the appropriate regexps locally
<erg> .
<lifeless> my point is that you don't lose out by bring the globals down implicitly, and you do gain when things change.
<lifeless> i.e. to make core source in a subdir, you override unrecognized, not source.
<lifeless> because it was unrecognized that was overriding it.
--> walters (walters@verbum.org) has joined #arch
<lifeless> hmm, lets step though this.
<lifeless> if the globals don't apply, then each individual test that is overridden must match every exception.
<lifeless> a change in global can still affect the local dir's tag contents.
<lifeless> if you make more things unrecognized that will work.
<lifeless> if you try to relax regexs that won't work.
<erg> yes, if you want to relax regexp it won't work. But if see local regexps as a means of dealing with exceptions, it's easier to just add the exception in the category you want it. And it's also easier to read.
<lifeless> mmm. ok.
<lifeless> for now :}.
<erg> mmmm here too ;)

Robert Collins <robertc>
Sat 08 Nov 2003 11:00:29 PM UTC, comment #3:

I had misread the code a little bit (gulp), thinking you did the same logic for all the patterns... You are testing the dir regexps first, then the globals, except for excludes.

So whats happenning is that because there is not a per dir source regex in the test case, it falls back. It seems to me that the least maintenance approach for regexs is to have globally specified regexps used when no local one is specified.

i.e. in the test case, the exclude, junk, source, backup and precious regexps would be copied down from the global at runtime. This would reduce domino effects across customised dirs, and be more predictable to the user.

As far as immunity to changes: I don't see this being an issue. Anyone changing global regexps will need to do a treelint regardless...

Robert Collins <robertc>
Sat 08 Nov 2003 08:36:42 PM UTC, comment #2:

Actions speak louder than words: I've extended your test cases in rbtcollins@hotmail.com--barch/tla--integration--1.1--patch-5 (your tests will never fail I realise - you need to rework your test script - see the bottom test I've added as an example) to test for regexp relaxation. In the test I setup an environment where 'core' should be considered source - and it is still considered unrecognized.

And yes, I do mean that all local regexps should be tested before all global regexps - but it's not how I read the source, and it's not how my test case suggests it operates.

Robert Collins <robertc>
Sat 08 Nov 2003 10:59:40 AM UTC, comment #1:

Merged into rbtcollins@hotmail.com--barch/tla--integration--1.1--patch-2 and -3. On a code style note, it appears to me that the evaluation of the per dir and global regexs may be 'wrong'.

i.e. currently you evaluate:
dir, global X, for X in excludes, junk, backup etc etc.

This means that a per dir regex that is less strict for excludes cannot override a more strict global excludes (and likewise for backup, source etc).

So, I suggest that you change the order:
dir X for all X, followed by global X, for all X.

This could be neatly implemented via a subroutine that takes a pointer to the regexps struct, extracted appropriately from arch_inventory_traversal_internal.

I've merged your code anyway, to give folk 'out there' a starting point for experimentation.

Robert Collins <robertc>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach File(s):
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

CC list is empty

 

Do you think this task is very important?
If so, you can click here to add your encouragement to it.
This task has 0 encouragements so far.

Only logged-in users can vote.

 

Please enter the title of George Orwell's famous dystopian book (it's a date):

 

 

Follow 2 latest changes.

Date Changed By Updated Field Previous Value => Replaced By
Tue 25 Nov 2003 09:15:33 PM UTCrobertcStatusNone=>(Error - Not Found)
  Open/ClosedOpen=>(Error - Not Found)

Back to the top


Powered by Savane 3.1-cleanup1