From: Johannes Sixt <j6t@kdbg.org>
To: Karthik Nayak <karthik.188@gmail.com>, git@vger.kernel.org
Cc: gitster@pobox.com
Subject: Re: [PATCH v4] ref-filter: fallback on alphabetical comparison
Date: Fri, 30 Oct 2015 23:51:53 +0100 [thread overview]
Message-ID: <5633F489.60008@kdbg.org> (raw)
In-Reply-To: <1446194728-7944-1-git-send-email-Karthik.188@gmail.com>
Am 30.10.2015 um 09:45 schrieb Karthik Nayak:
> In ref-filter.c the comparison of refs while sorting is handled by
> cmp_ref_sorting() function. When sorting as per numerical values
> (e.g. --sort=objectsize) there is no fallback comparison when both
> refs hold the same value. This can cause unexpected results (i.e. the
> order of listing refs with equal values cannot be pre-determined) as
> pointed out by Johannes Sixt ($gmane/280117).
>
> Hence, fallback to alphabetical comparison based on the refname
> whenever the other criterion is equal.
>
> A test in t3203 was expecting that branch-two sorts before HEAD, which
> happened to be how qsort(3) on Linux sorted the array, but (1) that
> outcome was not even guaranteed, and (2) once we start breaking ties
> with the refname, "HEAD" should sort before "branch-two" so the
> original expectation was inconsistent with the criterion we now use.
>
> Update it to match the new world order, which we can now depend on
> being stable.
Needless to say that the patch fixes the test failure on Windows. (I
tested v2 of the patch.)
-- Hannes
next prev parent reply other threads:[~2015-10-30 22:52 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-10-30 8:45 [PATCH v4] ref-filter: fallback on alphabetical comparison Karthik Nayak
2015-10-30 22:51 ` Johannes Sixt [this message]
2015-10-30 22:54 ` Junio C Hamano
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=5633F489.60008@kdbg.org \
--to=j6t@kdbg.org \
--cc=git@vger.kernel.org \
--cc=gitster@pobox.com \
--cc=karthik.188@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).