[svn.haxx.se] · SVN Dev · SVN Users · SVN Org · TSVN Dev · TSVN Users · Subclipse Dev · Subclipse Users · this month's index

RE: RE: Re: Re: RE: Repobrowser - Numeric order filename sorting

From: Hans-Emil Skogh <Hans-Emil.Skogh_at_tritech.se>
Date: 2006-04-11 13:53:10 CEST

>>>> But, it still will be wrong for strings like
>>>> v1.3.2
>>>> v1.7.8
>
>The routine will eat leading characters from both strings up
> to the first distinguishing character. Remaining strings will
> be then "3.2" and "7.8".
 
I would say that the problem lies in trying to sort the likes of:
v1.3.2
v101.3.2
or
v-1.1.0
v-1.11.5
v-1.11.12
 
Dates are also not always nicely zero-padded (even if you are using a sensible date order).
 
In short, problems problems problems. But by no means unsolvable! (Ehrm, except for dates, because that IS a mess.) One could try to extract all numbers from a string, (not digits,) and compare them one by one. (That exercise is left to the reader. ;-) )
 
I think one of the biggest problems is when to use what kind of sorting. That's a pretty hard thing to detect. Or if you decide on going the splitting-route all the way, how do you compare a string with a number. It's really easy to get whacky results there.....
 
Hans-Emil
Received on Tue Apr 11 13:53:29 2006

This is an archived mail posted to the TortoiseSVN Dev mailing list.

This site is subject to the Apache Privacy Policy and the Apache Public Forum Archive Policy.