Re: [PATCH] Ignore file filter
From: David Greaves <hidden>
Date: 2016-06-15 22:41:57
Petr Baudis wrote:
Dear diary, on Sat, May 14, 2005 at 11:01:49AM CEST, I got a letter where Junio C Hamano [off-list ref] told me that...quoted
quoted
quoted
quoted
quoted
quoted
"DG" == David Greaves [off-list ref] writes:if [[ $file =~ $patt ]]; thenI'm sorry but this is really nothing my bash-2.05.0(1)-release supports.DG> OK DG> I don't know how to do that. Is that regexp or shell glob? If regexp, expr is your friend, like this: if expr "$file" : "$patt" >/dev/null; thenOh, this looks nice. I didn't know expr can do that. :-) Still, I'd prefer the old-fashioned globs as primary matching mechanism.
OK I was wondering about supporting _both_ globs and re's right now my ignore file has a # to precede comment lines maybe re: precedes regexp lines and unadorned lines are globs. However the re's provided by regex(7) are too weedy to be worth bothering with. If however, there is a serious plan to go to perl, it may be worth providing for this now in the ignore syntax. Additionally this causes problems with sharing the same exclude file as used by git. However... I really think git's exclude file capability and cogito's are different. Cogito is aiming to provide full-blown SCM capabilities - git isn't I am also concerned that a centralised ignore file is not flexible enough. Certainly limiting if we support globs only. It may be that you want different rules in different trees - someone on lkml mentioned that excludes vary in different parts of the source. Eg .s files may be generally ignored - but not in the asm parts of the tree. Also... you haven't mentioned perl for a while - can you give us an update? I personally think we're making life needlessly unpleasant by sticking with shell. David --