Re: Support customized reordering in version sort
From: Junio C Hamano <hidden>
Date: 2016-06-15 23:03:53
On Fri, Feb 20, 2015 at 7:02 PM, Duy Nguyen [off-list ref] wrote:
My idea is to make it easy for the user to change the sort algorithm.
And it's probably intuitive to just substitute a string with
something. So if "1-rc1" is put incorrectly before "1.1" and you
realize that "1.999" ought to be the last one before "2". You could
tell git to internally replace "1-rc1" with "1.999".
This patch does that. The user feeds substitution rules via
versionsort.substitute config keys, e.g.
git config versionsort.substitute "-rc .999"I would say 1-rc1 comes and then 1-rc2 and then 1-rc3 ... 1-rc10 and then 1-rc11 and then finally 1. It will probably be followed by 1.1-rc1, 1.1-rc2, ... and then 1.1 (aka 1.1-final). If 1-rc1 is equated with 1.9991 because -rc is replaced with .999, how does it make 1 come after 1.99911, and 1.1.9992 come before 1.1? I didn't read the patch text and perhaps the explanation above is the only thing faulty about your message, or perhaps my reading is faulty and the above describes a sound idea, but I do not see how the above makes sense.