Re: [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort

2016-11-25 Thread Jeff King
On Fri, Nov 25, 2016 at 07:15:15PM +0700, Duy Nguyen wrote: > > I guess I haven't used string_list_sort() in a while, but I was > > surprised to find that it just feeds the strings to the comparator. That > > makes sense for using a raw strcmp() as the comparator, but I wonder if > > any callers w

Re: [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort

2016-11-25 Thread Duy Nguyen
On Fri, Nov 25, 2016 at 3:52 AM, Jeff King wrote: > On Thu, Nov 24, 2016 at 06:45:36PM +0700, Nguyễn Thái Ngọc Duy wrote: > >> This started out to as a hunt for remaining qsort() calls after rs/qsort >> series because qsort() API is a bit easy to get wrong (*). However, >> since we have string_lis

Re: [PATCH v2] merge-recursive.c: use string_list_sort instead of qsort

2016-11-24 Thread Jeff King
On Thu, Nov 24, 2016 at 06:45:36PM +0700, Nguyễn Thái Ngọc Duy wrote: > This started out to as a hunt for remaining qsort() calls after rs/qsort > series because qsort() API is a bit easy to get wrong (*). However, > since we have string_list_sort(), it's conceptually a better way to sort > here.

[PATCH v2] merge-recursive.c: use string_list_sort instead of qsort

2016-11-24 Thread Nguyễn Thái Ngọc Duy
This started out to as a hunt for remaining qsort() calls after rs/qsort series because qsort() API is a bit easy to get wrong (*). However, since we have string_list_sort(), it's conceptually a better way to sort here. (*) In this particular case, it's even more confusing when you sort one variab