[MERGE] default user ignores in ~/.bazaar/ignore

John Arbash Meinel john at arbash-meinel.com
Thu Jul 13 02:54:37 BST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Adeodato Simó wrote:
> * John Arbash Meinel [Wed, 12 Jul 2006 19:25:44 -0500]:
> 
>> The attached patch changes our default ignore policy, to hopefully bring
>> about a nice intermediate.
> 
> Nice, thanks a lot!
> 
>> 4) Give some nice helper functions in bzrlib/ignores.py, including:
>> add_unique_user_ignores(), which takes a list of ignore patterns, and
>> only updates ~/.bazaar/ignore if the entry does not exist yet.
>        ^^^^^^^^^^^^^^^^^^^^^^^^
>> It still requires reading the file, and parsing the list, but it gives
>> plugins a way to do what they need, rather than having all of them do it
>> ad-hoc.
> 
> Hm. Personally (as a user) I'd prefer if plugins would not touch my
> ~/.bazaar/ignore, but if you think it's reasonable, no objection.

Well, a plugin like 'shelf' has a reasonable desire to add '.shelf' to
the default user ignores. And I think it is okay for it to append a new
entry to the current list.

Same thing for the DVC stuff. The user is using DVC, and I think it is
reasonable for DVC to setup an ignore for them. As long as they only
append to the list. (And optimistically don't add it if it has been
removed, but that is hard to do).

I would say that shelf should only add the ignore when it actually
creates a shelf, rather than every time on load.

> 
> Only, I'd really request that a function is provided to add a set of
> ignores to the current running instance of bzr, but without making them
> permanent. (Something like add_runtime_ignores(), which will probably
> need a list à-la-DEFAULT_IGNORE.)

Well, a list or a possibly a set.

> 
> I actually have an use case for this: in some configurations, the VCS
> migration tool Tailor leaves a log and/or a status file in the top of
> the created repository, which are named <name-of-the-project>.{log,state}.
> I want bzr to ignore those, but it wouldn't make sense to add them to
> the user's default ignore list.
> 
> What do you think?
> 
> Thanks,
> 

Why isn't it being added to .bzrignore then? It would seem to be a
project specific ignore. Though I guess it shouldn't be present in
converted versions ....

I'm okay with something like DEFAULT_IGNORE. Probably better to migrate
to something else, since the name is poor for what it is now being used
as. And also it doesn't seem worthy of being directly on bzrlib.
Something like:

bzrlib.ignores.add_runtime_ignores(['foo'])

I'd like to hear what other people think, though.

John
=:->
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.2.2 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFEtafdJdeBCYSNAAMRAt43AKCvgwkPvl7MRnL0osvQRnyLr4Ht2ACgj6zW
vqNWnc7KuXq0FizqQAk0nkU=
=1bKG
-----END PGP SIGNATURE-----




More information about the bazaar mailing list