Proposed Patch to hgignore

Matt Mackall mpm at selenic.com
Thu Mar 6 14:00:19 CST 2008


On Thu, Mar 06, 2008 at 08:42:42PM +0100, Peter Arrenbrecht wrote:
> On Thu, Mar 6, 2008 at 10:57 AM,  <pistazienfresser at web.de> wrote:
> > Hello.
> >
> >  I would like to propose an addition to the syntax of the .hgignore file,
> >  namely, the possibility to _not_ ignore files matching a wildcard or regular
> >  expression.
> >
> >  This change is similar to the .gitignore semantics, and is very helpful for
> >  example to track changes to varios dotfiles.
> >
> >  one would use for example
> >
> >  syntax: glob
> >  *
> >  !^.bashrc
> >  !^.emacs
> >  !^.emacs.d/*
> >  !^.muttrc
> >
> >  to only track .bashrc, .muttrc, .emacs and everything below .emacs.d
> >
> >  Implementing this behaviour with the current syntax might be possible but would
> >  involve complicated regular expressions.
> 
> +1 on the feature.

As discussed in the distant past, this feature is very difficult to
implement in a way that is simultaneously correct and easy to
understand, nevermind fast. Even though it looks simple on paper.

Ever wonder why regexes themselves don't have a negation operator?
It's the sort of deep result that computer science professors tend to
skim over but could easily fill a book or two.

-- 
Mathematics is the supreme nostalgia of our time.


More information about the Mercurial-devel mailing list