when doing something surprising, say so

Martin Pool mbp at canonical.com
Tue Aug 4 01:27:11 BST 2009


I think we should add this to our general ui principles, or perhaps
just pay more attention to it:

When we're doing something that would have surprising impacts on the
user, we should tell them we're doing it.

This has come up a couple of times in bugs I've seen: branch
--hardlink has no effect on 2a repositories
<https://bugs.edge.launchpad.net/bzr/+bug/408193>, and copying between
repositories in different formats is much slower than copying in the
same format <https://bugs.edge.launchpad.net/bzr/+bug/407834>.

In the first case, this was a conscious choice because of the impact
of content filtering -- you can debate whether this is the right
pragmatic or ideal choice, but that's a bit separate from how the
decision was implemented after it was taken.   If the user has asked
for hardlinks and we've decided not to do it we should at least give a
message to say so.

In the case of 407834 it's not unexpected that doing on-the-fly
translation of formats would be more work than just copying across the
compressed records, but it may be unobvious to the user that this is
occurring.  So I'd say we should give a warning here.  In general if
we're falling back to a more generic or unoptimized code path we
should warn.

This is something to look for during reviews - if the code has a
comment making an excuse for something, maybe it should say so to the
user too.

-- 
Martin <http://launchpad.net/~mbp/>



More information about the bazaar mailing list