bzr status: hiding shelf info if files are specified

Francis Devereux francis at devrx.org
Thu Nov 17 20:16:08 UTC 2011


Hi,

I think that it would be better if bar status only output the "x shelves exist" argument when no files are specified. If you run a plain "bzr status" then you are asking bzr about the status of the whole tree, so it is reasonable for it to report shelves, but if you run "bzr status myfile" then you are just asking it about the status of myfile, so it shouldn't tell you about shelves (well, maybe it should in some cases, more of that later). Also, this would prevent the annoying Emacs warnings that happen when you visit a file inside a branch with shelves (at least in Emacs 23.3, perhaps Emacs has been changed to suppress them in trunk).

Would such a change have a chance of getting into bzr, i.e. do people agree with me that it'd be an improvement? I saw the discussion about the addition of the shelves message to status but I don't think that what should happen when file arguments are passed was discussed.

I've had a go at implementing this change and uploaded it to lp:~frankoid/bzr/status-shelve-message. I have a question about API compatibility - I needed to add a specific_files attribute to StatusHookParams, which meant adding an argument to its constructor. I would have preferred to add the specific_files argument before to_file, to match the order of show_tree_status's parameters, however I added it to the end of the parameter list to avoid breaking existing callers of StatusHookParams. Is this sort of backward compatibility necessary? I've read "Evolving Interfaces" in http://doc.bazaar.canonical.com/developers/HACKING.html so I suppose my question is really whether StatusHookParams is considered an API or not, and how to tell.

One change I considered making was to include the shelves message if any of the shelves contain changes to any of the specified files. I haven't done it yet for a few reasons: I'm not sure it's actually an improvement, it seems like it might be slow if there are lots of shelves and I wanted to get some feedback about the change in general before going any further.

Francis




More information about the bazaar mailing list