Is the behaviour of silently adding explicitly-specified ignored files helpful?
When setting up a new repository, I generally populate the .bzrignore before adding files, which is good.
However, I sometimes say "bzr add *" instead of the more useful "bzr add .", and this causes my ignored files to be added (because TFM says "If a file is explicitly added, it remains versioned regardless of whether it matches an ignore pattern.", and of course the shell is expanding the "*" before bzr add sees the file list)
I'm not sure that this is a good default behaviour. I think it would be more useful for bzr to issue a warning when the user is "explicitly" adding ignored files (appreciating that what's explicit to the bzr command arguments is not necessarily explicit to the shell user). Then the user could check what they are doing, and if they really want to add an ignored file, they could specify some extra argument, like "--add-ignored" ...
This might not add much functionality to old hands, but it might help reduce newbie confusion :-)
Example shell session might look like this :-
$ mkdir ignoretest; cd ignoretest
$ touch goodfile badfile
$ bzr init .
Created a standalone tree (format: 2a)
$ bzr ignore badfile
$ ls
badfile goodfile
$ bzr add *
Warning: adding badfile is prohibited by ignore settings
adding goodfile
$ bzr st
added:
.bzrignore
goodfile
$ bzr add --add-ignored badfile
adding badfile
$ bzr st
added:
.bzrignore
badfile
goodfile
Question information
- Language:
- English Edit question
- Status:
- Solved
- For:
- Bazaar Edit question
- Assignee:
- No assignee Edit question
- Solved by:
- Martin Pool
- Solved:
- Last query:
- Last reply: