Merge branch 'js/shortlog-sort-stably' into maint
"git shortlog -n" relied on the underlying qsort() to be stable, which shouldn't have. Fixed. source: <pull.1290.git.1657813429221.gitgitgadget@gmail.com> * js/shortlog-sort-stably: shortlog: use a stable sort
This commit is contained in:
commit
682079fb2a
@ -443,7 +443,7 @@ void shortlog_output(struct shortlog *log)
|
|||||||
struct strbuf sb = STRBUF_INIT;
|
struct strbuf sb = STRBUF_INIT;
|
||||||
|
|
||||||
if (log->sort_by_number)
|
if (log->sort_by_number)
|
||||||
QSORT(log->list.items, log->list.nr,
|
STABLE_QSORT(log->list.items, log->list.nr,
|
||||||
log->summary ? compare_by_counter : compare_by_list);
|
log->summary ? compare_by_counter : compare_by_list);
|
||||||
for (i = 0; i < log->list.nr; i++) {
|
for (i = 0; i < log->list.nr; i++) {
|
||||||
const struct string_list_item *item = &log->list.items[i];
|
const struct string_list_item *item = &log->list.items[i];
|
||||||
|
Loading…
x
Reference in New Issue
Block a user