Performance testing of ignore changes?

John Whitley whitley at bangpath.org
Mon Jan 4 18:53:00 GMT 2010


Hi all,

I'm working on ignore exclusions[1] and would like to be able to do some
performance tests to measure the impacts of the changes I'm making.  I didn't
find much info on performance testing in the developer docs in bzr.dev.  I'd
appreciate pointers, either to docs I missed, or suggestions for test approaches
for this change.  FYI, the code in my working branch[2] works and has new tests,
but isn't yet complete.  Feel free to look around the branch and comment here or
directly to me via email.

Notes on remaining work on this feature:

The current branch handles basic ignore exclusions, where an '!' is prefixed to
an ignore pattern to cause matched files to not be ignored.  Exclusion patterns
take precedence over regular ignore patterns, regardless of order in .bzrignore.

This works OK for basic file-centric patterns such as this:
--- sample .bzrignore ---
# ignore generated HTML files
*.html
# but not a few kinds of hand-maintained HTML files
!foo.html
!bar.html
--- end sample ---

But it doesn't capture the more complex use case of making ignores useful when
overlaying a repository on an existing directory with non-versioned files, for
example when versioning partial contents of one's home directory or /etc. 
Example of a homedir .bzrignore file:

--- sample .bzrignore #2 ---
# ignore everything
*
# but not the stuff we manage by-hand
# ~/local is versioned
!./local
!./local/**/*
# zsh dirs and files are versioned
!RE:^\.z.*
--- end sample #2 ---

But what happens when we note that .zcompdump is a file generated by zsh, which
shouldn't be versioned?  Ideally we'd like to ignore it.  In the second example,
we're really creating a filter for files to consider as versioned, with a desire
for vanilla ignore capability under that.  I have a few ideas as to how this
could work.  The simplest is to allow double-negation, assigning highest
matching priority to double-negated patterns:

--- sample .bzrignore #3 ---
# ignore everything
*
# except this stuff
!./local
!./local/**/*
!RE:^\.z.*
# but we really didn't want this
!!./.zcompdump
--- end sample #3 ---

This is a pretty straightforward extension of the work I've already done.  I'd
really like feedback on the proposal illustrated in sample #3 -- what do folks
think?

Thanks,
John

[1] https://bugs.launchpad.net/bzr/+bug/428031
[2] lp:~whitley/bzr/ignore-exclusions




More information about the bazaar mailing list