discussing ignore rules

Jan Hudec bulb at ucw.cz
Thu May 11 10:43:19 BST 2006


On Wed, May 10, 2006 at 17:37:57 -0700, John A Meinel wrote:
> Wayne Davison wrote:
> > I would like to see a way to specify ignore rules that apply to all bzr
> > projects because I have some file names that I use in my personal habits
> > that need to be ignored by bzr (e.g. I output diff info to a file named
> > "x.patch"), but these rules shouldn't get added a project's .bzrignore
> > file (because other folks don't need to ignore my personal filenames).
> > 
> > Earlier this year some folks discussed moving all the DEFAULT_IGNORE
> > values into each project's .bzrignore file, but I don't think that all
> > ignores should go into that file.  To me there is a division of rules
> > that affect the current project because of how it is built (such as *.o
> > files that derive from *.c files), and rules that ignore files because
> > of the tools and/or temp-file names that are personal to the user (such
> > as ".*.swp", "CVS", etc.).  So, if folks still think we should create a
> > .bzrignore file when "bzr init" is run, I think that it should only
> > contain the rules that are for project-oriented generated files.
> > 
> > One way to handle this division would be to honor a file named
> > ~/.bazaar/ignore that lets each user configure what files they need to
> > ignore that are not project specific.  The presence of this file could
> > override the inclusion of the DEFAULT_IGNORE rules (or perhaps half of
> > the default ignores if they were split into the categories detailed
> > above).
> > 
> > I have added support for the ~/.bazaar/ignore file to my version of bzr,
> > and have attached a patch for this.  In this version, the presence of
> > this ignore file disables the inclusion of the DEFAULT_IGNORE rules.
> > 
> > I also attempted to separate the DEFAULT_IGNORE list into my two
> > categories, and attached "ignore" for the file that should go into
> > ~/.bazaar, and "bzrignore" for the file that should get installed by
> > "bzr init" (I had to guess at some of the rules, so I may have mis-
> > classified something).
> > 
> > Finally, two comments about the DEFAULT_IGNORE list in bzrlib/__init__.py:
> > There are two rules to ignore *.o, and the .jamdeps line doesn't have a
> > trailing comma after the closing single-quote.
> > 
> > ..wayne..
> > 
> 
> The problem with per-user ignores is that it becomes very easy to use
> them to ignore whatever you want, but then other people grab a copy of
> your branch, and suddenly 'bzr add' adds all of the object files.
> 
> *I* would like to see customizable defaults. Such that when you do 'bzr
> init' it has a default set of ignores that can be customized.

See the use-case 5 on http://bazaar-vcs.org/NewIgnoreRulesSpec. We need
something like that. It should be done a bit differently though IMHO.

> Your patch has an interesting way of handling it. But realize that we
> are seriously thinking to change ignores from being a physical file,
> into being a 'versioned property', like inventory files are. (Not
> directly editable by users, just guaranteed to be remembered).

The versioned property pertains to the project ignore list. The user ignore
list can--and has to--be handled separately.

I don't, however, like the patch on different grounds. It adds yet another
config file. I would like to see a section in the bazaar.conf file instead.

> Robert has a very strong feeling that the files that are ignored need to
> be exactly the same as what they used to be. (So even though bzr has
> been upgraded, it will still ignore the same things when you check out
> revision 1 of your project).

Yes--I have the same feeling. That's why the new scheme is proposed to
initialize the property value to the default and than only use that.

However, the user ignores are still orthogonal to that. IMHO it would be
appropriate to have following keys in bazaar.conf:

    extra_ignore=<pattern-list> (or just ignore)::
	These would be added to all projects. To be used for temporary files
	created by that user's favorite tools. Also for user specific naming
	habbits. Eg. people who got used to name temporary files ,<something>
	back in Arch days would put ,* here.

    never_ignore=<pattern-list> (or unignore)::
	These would never be ignored. Some user's may want to never commit
	with something in a tree. This is more of a use-case for something
	like Arch's 'unrecognized' category. I can't think of anything I'd
	actually use, but I think this option should exist for symetry.

    default_ignore=<pattern-list>::
	This would replace the DEFAULT_IGNORE list when initializing a new
	branch and for reading old revisions using .bzrignore.

    default_ignore_add=<pattern-list>::
	This would be added to the DEFAULT_IGNORE list when initializing
	a new branch and for reading old revisions using .bzrignore.

    default_ignore_remove=<pattern-list>::
	This would be removed from the DEFAULT_IGNORE list when initializing
	a new branch and for reading old revisions using .bzrignore.

    The later three could be replaced with a single option,
    '''default_ignore''', patterns in which:
     * Would be added if they start with `+` (stripped) or any other
       character.
     * Would be removed if they start with `-`.
     * Pattern `!` would clear the list completely (this is like in CVS).
    
    All of them could live both in the [DEFAULT] section and subtree/branch
    specific section.

> Also, to be merged, your changes would need tests.

-- 
						 Jan 'Bulb' Hudec <bulb at ucw.cz>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20060511/7fc0bb42/attachment.pgp 


More information about the bazaar mailing list