RFC: handling ignored files in deleted directories.
Colin D Bennett
colin at gibibit.com
Wed Jul 30 17:52:14 BST 2008
On Wed, 30 Jul 2008 16:49:19 +1000
Robert Collins <robertc at robertcollins.net> wrote:
> So we have the ability to ignore files. Ignoring means 'do not auto
> add'
> - but people have multiple reasons not to add a file.
>
> Generally there are two reasons:
> - a file is not valuable (e.g. .o files, *~ files etc)
> - a file is private (e.g. htpasswd or similar)
>
> We have a bug in merge at the moment - a merge that deletes a
> directory will fail if any ignored files are present. E.g. foo.pyc.
> This bites me routinely during some sorts of code reorganisation.
>
> Now, we could fix this by just removing such files, but possibly this
> could lead to data loss when a file that is ignored-and-private is
> deleted.
>
> Alternatively we could create a new directory, such as 'lost+found'
> and put the ignored files there (still in the directory structure).
> This still requires manual intervention, but at least its out of the
> direct users way.
I think that actually making a distinction between private files and
garbage files is a much better choice than moving files to a
'lost+found' directory, since that could be a headache for the user to
restore them if that occurred very often.
(I was trying to come up with a good word to describe "garbage" files,
but I don't think I can think of anything better than "garbage". A
couple that I thought of were "inconsequential" and "transient".)
> Another alternative, a form of which was found in GNU Arch, is to have
> another file classifier which extends the concept of ignoring files to
> break files into two categories:
> ignored and safe to delete anytime bzr wants
> ignored and not safe to delete anytime bzr wants
>
> *I* would like bzr to not conflict on this case, but I don't want to
> setup a data-loss situation for users.
>
> In short:
> - do we want to fix the bug, or should we say WONTFIX?
I think it's worth fixing.
> - is the potential for dataloss to high to just delete ignored files
> in deleted directories?
Absolutely YES, we must not delete ignored files unless the user
requests us to. Even the bzrtools 'clean-tree' command (which based on
its name already makes me think twice before executing it) makes the
safer choice to require the user to specify '--ignored' to delete
ignored files. (Unknown files are more visible to the user since 'bzr
status' will be showing them, but the user may forget that there are
important 'private' ignored files.)
> - should the default ignore mean 'garbage file' or 'private file' ?
Definitely the default should be 'private file' since otherwise data
loss is sure to occur for many people. Always take the safe choice to
prevent data loss.
> - how should we implement
I think having an extra field of some sort in the .bzrignore file would
be best, and for backward compatibility we would default to ignored
files being 'private' instead of 'garbage'.
Regards,
Colin
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 197 bytes
Desc: not available
Url : https://lists.ubuntu.com/archives/bazaar/attachments/20080730/f6159fd2/attachment-0001.pgp
More information about the bazaar
mailing list