Per branch ignore exclusions

John Whitley whitley at
Fri Sep 11 00:13:09 BST 2009

John Arbash Meinel <john <at>> writes:
> Stephen J. Turnbull wrote:
> > John Arbash Meinel writes:
> > 
> >  > find . -name '*.a' -o -name '*.o' | xargs bzr add
> >  > 
> >  > bzr add *.a */*.a */*/*.a *.o */*.o */*/*.o
> >  > 
> >  > I realize these aren't exactly what you are looking for, but they
> >  > generally work pretty well.
> > 
> > I agree, it's not friendly.  OTOH, you only need one *nix geek to do
> > this incantation once, and then it's in the repo for everybody else.

Perhaps for this specific case, this is fine.  But there are cases where this
sort of usage doesn't really cut it and ignore exclusions rock.  Specifically,
cases where one wants to version part of a "live" directory, such as rcfiles in
one's homedir, a subset of system configuration files, etc.

I was looking for ignore exclusions earlier in the week, didn't find them, and
eventually realized that git has a syntax that I want to poach: any line
prepended with an '!' becomes an ignore exclusion.

--- hypothetical .bzrignore ---
# We must be explicit about versioned paths
# under $HOME for sanity.  Ignore everything
# except the exclusions below.
# This gets .zshrc and friends and
# files and dirs specific to my setup, such as 
# .zglobalfns, .zlocal/, and .zfunctions/
# also version ~/local
--- end ---

I have it in mind to author and submit a patch, but have been sidetracked with a
bug and patch-in-progress for the fastimport plugin.

-- John

More information about the bazaar mailing list