Opened 19 years ago
Closed 19 years ago
#1714 closed enhancement (fixed)
Pretty Sort for filenames with embedded numbers
Reported by: | Owned by: | Jonas Borgström | |
---|---|---|---|
Priority: | normal | Milestone: | 0.9 |
Component: | version control/browser | Version: | 0.8.4 |
Severity: | normal | Keywords: | |
Cc: | Branch: | ||
Release Notes: | |||
API Changes: | |||
Internal Changes: |
Description
In my source respository, I have the following pattern:
file1 … file9 file10 file11
This ends up as
file1 file10 file11 file2
Which isn't very fun for my users to deal with. I've taken a python recipe http://aspn.activestate.com/ASPN/Cookbook/Python/Recipe/214202 and sorted the filenames in order.
Attachments (1)
Change History (8)
by , 19 years ago
Attachment: | browser.py.diff added |
---|
comment:1 by , 19 years ago
Resolution: | → wontfix |
---|---|
Status: | new → closed |
comment:2 by , 19 years ago
I've seen some command shells in the past that were replacements for cmd.exe that perform sorts like this (I think it was 4DOS or 4NT).
I'd like to avoid renaming the files since they are word documents that cross reference each other by name (ie: Chapter1.doc Chapter2.doc etc.) so I'll just keep the patch local.
comment:3 by , 19 years ago
This kind of sort is built into Mac OS X, FWIW (i.e., try it in the Finder); see the list of string comparison flags available. It used to be provided by an extension called Natural Order originally written by Stuart Cheshire.
Not that I have a use for it in Trac because I don't name things like that, but it'd not be a bad thing to have.
comment:4 by , 19 years ago
I've also found that this feature is built into windows explorer as well.
comment:5 by , 19 years ago
Resolution: | wontfix |
---|---|
Status: | closed → reopened |
it's called Natural Order sorting, & it's something that should at least be considered before brushing off as a wontfix…
I don't really see the point in this. Every file browser I'm aware of, and also the directory listings provided by mod_dav_svn, will list the directories using traditional alphanumeric sorting. If you want your directories to be sorted correctly, you should probably be padding with zeros, i.e. file01, file02, etc.