monotone-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Monotone-devel] Feature Request: enhanced .mtn-ignore


From: Rob Schoening
Subject: Re: [Monotone-devel] Feature Request: enhanced .mtn-ignore
Date: Fri, 4 Aug 2006 11:11:02 -0700

I will add that, as a user, I've been slightly mystified by .mtn-ignore myself. 
 
I'm not aware of where the syntax is documented, but it seems to be different than .cvsignore.  Maybe it uses regular expressions and not just simple wildcards.
 
Also, on several occasions I've found that a blank line in .mtn-ignore caused it to ignore everything in my workspace which was very confusing the first time it happened.
 
I think it's probably more of a documentation issue (and/or user error) than a defect, but I'm not sure....

RS
 
On 8/4/06, Jonathan S. Shapiro <address@hidden> wrote:
Monotone seems to have borrowed the .cvsignore idea directly
for .mtn-ignore. When we did this for OpenCM, we introduced a small,
backwards-compatible change that users really seem to like. I'ld like to
propose that Monotone adopt what we did. It's useful, backwards
compatible, simple to do, and I'ld be willing to supply the patch if
people agree.

The difference is that in OpenCM, we can explicitly *include* files.
Rules are processed top to bottom. Here is a comparative example:

  .mtn-ignore                     .opencm-rules
   ====================           =====================
   *~                             exclude *~
   *.o                            exclude *.o
                                  include anexception.o

We don't use the include feature very often, but when we do it is very
useful. The include feature lets us do two things:

1. It lets us override default rules. For example, OpenCM has the
    built-in default rule "exclude *.o". If a project needs to save
    object files they can override this by putting

      include *.o

    in their .opencm-rules file. Conceptually, the way OpenCM handles
    default rules is exactly as if they appeared as the first few lines
    in every .opencm-rules file.

2. In a couple of strange corner cases, it lets us do things more
    concisely and maintainably (like the case in the example: exclude
    all object files except for this one)

I would like to see monotone adopt this. I haven't looked at the
monotone code at all, but this shouldn't be hard and I'ld be willing to
supply the patch.

Specifically, I propose that .mtn-ignore files should be processed top
to bottom (as in OpenCM), and that the legal input lines in
a .mtn-ignore file should now be:

  <RE>           -- processed as "exclude <RE>"
  exclude <RE>   -- exclude files matching <RE>
  include <RE>   -- include files matching <RE>

This can be done compatibly, because unescaped white space is not legal
in the current .mtn-ignore file syntax. It also might allow monotone to
extend this file in the future to handle certain types of attributes
(e.g. binary/text), which is why the OpenCM version was
called .opencm-rules. Monotone has other ways to do that, so I'm not
sure how useful that is for monotone, and I'm not really pushing for it
as an attribute mechanism, but I thought I should mention it.

So:

1. First, is my description of the proposal clear? Questions about it?

2. Does anybody think this is a bad idea for some reason? Our experience
  using it in OpenCM has been very positive.

3. Might it be adopted if I supplied the appropriate patch?


shap



_______________________________________________
Monotone-devel mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/monotone-devel


reply via email to

[Prev in Thread] Current Thread [Next in Thread]