Bazaar developers’ blog

September 15, 2010

poll: deleting directories containing unversioned files

Filed under: poll — Martin Pool @ 6:03 am
Tags: , , , ,

At the moment bzr treats deletion of a directory containing unversioned files (either ignored or unknown) as a conflict.

This is a bit annoying because often the unversioned files are generated trash, like .pyc files from Python. However in some cases people do have “precious” files that are ignored but shouldn’t be just deleted.

Vincent has a merge proposal up that will instead move the files into a bzr-orphans directory in the root of the tree.

What would you like to have happen? My feeling is that there should be a configuration option to choose the policy, and we should perhaps eventually distinguish “junk” (safe to delete) from “precious”, as Baz and GNU Arch did.

About these ads

8 Comments

  1. Good idea. It’s the same for .o files, nobody cares (I don’t know if we could use the ignore file instead of creating a new list?).

    And putting all other files in a orphan directory is safe.

    Comment by tuXXX — September 15, 2010 @ 7:52 am

  2. IMHO those unversioned files should stay where they were, and those directories which were deleted in other branch should now just became non-versioned directories containing only those unversioned files.

    Comment by Tommi Vainikainen — September 15, 2010 @ 7:53 am

  3. The .bzrignore file could be split into two (by additional syntax, having two files, however): one list which specifies which files should be ignored and can be deleted, and a second which specifies which files should be ignored but are not safe to delete (precious). The default should be not safe to delete, and the behaviour for those could be the same as at present. Would that work?

    Comment by Gavin Panella — September 15, 2010 @ 8:23 am

  4. I agree with Tommi Vainikainen : just un-version the directory.
    Then the user can version, move or delete.

    Comment by Alexandre Garnier — September 15, 2010 @ 10:30 am

  5. [...] poll: deleting directories containing unversioned files What would you like to have happen? My feeling is that there should be a configuration option to choose the policy, and we should perhaps eventually distinguish “junk” (safe to delete) from “precious”, as Baz and GNU Arch did. [...]

    Pingback by Links 15/9/2010: More MeeGo Wins, DEAct Debate Reactivated | Techrights — September 15, 2010 @ 7:21 pm

  6. Unversioning the directory makes a lot of sense.

    There will be some edge cases where it doesn’t easily work, like when a directory containing unversioned files is replaced by something other than a directory, but even then we could just move it to a backup name…

    Comment by Martin Pool — September 16, 2010 @ 2:51 am

  7. +1 on no dying with conflicts as it does today
    +0.5 on moving the files around
    +1 on distinguishing junk.

    Comment by rbtcollins — September 17, 2010 @ 1:49 am

  8. Conflicts are definitely painful so this proposal seems like a good idea to me.

    I just looked at the proposal briefly.
    While I think bzr-orphans is a good idea, renaming each file to file.~#~ seems painful. Perhaps, it can be considered to move the directory into bzr-orphans as directory.~#~ while keeping file names the same. This will be helpful if we want to recover a bunch of files together. If we rename each file the user may need to rename each one separately.

    Unversioning the directory also seems fine to me.

    Comment by Parth Malwankar — September 17, 2010 @ 3:51 pm


RSS feed for comments on this post.

The Rubric Theme Blog at WordPress.com.

Follow

Get every new post delivered to your Inbox.

%d bloggers like this: