Sorted order for output of "status" etc.
From: Julian Foad <julianfoad_at_btopenworld.com>
Date: 2003-10-13 18:46:04 CEST
I propose that, as a post-1.0 enhancement, output from "svn status" etc. should be in sorted order.
I am just putting this out for initial comments before filing an issue, since I shouldn't be spending a lot of time on it at the moment.
*** Why?
The aim is to make the output repeatable and non-arbitrary.
When I came to Unix from MS-DOS I was surprised that "ls" went to the extra effort of sorting the filenames by default. Then I realised that it was cheap, often useful, and never harmful. It allows output from different runs to be compared. It makes it easy to find an interesting item in the output. It keeps related items together, in a simple sense.
I believe it has benefits for concurrency, like avoiding deadlocks, but I am not clear about these things.
*** What?
* Every user-visible tree walk should proceed in sorted order, at least when the purpose is to produce output, such as "status", "list", "proplist", "propget". For other commands like "add" and "commit" it is not so important but I would like to see them do the same for consistency if the cost is low.
* The list of properties from "proplist", "diff", etc. should be sorted by property name.
* Command-line arguments: it doesn't matter whether these are sorted before processing. The overall output will be stable and easy for the user to search in, either way. No change is needed.
* The list of changed paths in "log -v" output should be sorted. It already seems to be.
* Any other similar things.
It doesn't matter so much what the order is, as long as it is fully ordered. For instance, I don't mind whether all unversioned items are listed before the versioned items as they are now, or mixed in with them and sorted just by name as they were previously. Any additional proposal to change the sort order or make it configurable does not affect this proposal.
*** How?
kfogel@collab.net writes:
C-Mike, is it hard (compared to other things that we do)?
Of course it is impossible to sort a stream after it has been generated, while keeping as a stream. Therefore a stream must be produced in sorted order. Sorting a tree just involves sorting each individual directory when it is encountered. I have a patch which does a large part of this.
There may be harder things like merging streams from different sources (though that's actually a different problem). Whether we implement the difficult parts just depends on the cost/benefit trade-off. A lot of benefit can be had from implementing all the simple cases.
Anyway, I want to solicit agreement or objections to the principle before going into the implementation.
- Julian
---------------------------------------------------------------------
|
This is an archived mail posted to the Subversion Dev mailing list.
This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.