All of lore.kernel.org
 help / color / mirror / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: "Greg Hurrell" <greg@hurrell.net>
Cc: git@vger.kernel.org
Subject: Re: [RFC PATCH] gitweb: use HEAD as primary sort key in git_get_heads_list()
Date: Wed, 09 Jun 2021 16:47:36 +0900	[thread overview]
Message-ID: <xmqqpmwviinb.fsf@gitster.g> (raw)
In-Reply-To: <26dbf49f-4972-4960-9383-2b69a3e6043c@www.fastmail.com> (Greg Hurrell's message of "Wed, 09 Jun 2021 09:38:16 +0200")

"Greg Hurrell" <greg@hurrell.net> writes:

> One thing I do notice is that there is already a `current_head` CSS
> class applied to the corresponding row, so it would be possible for the
> gitweb owner to make tha row stand out however they pleased.
>
> In short, I am happy to amend the commit message but I fear the
> rationale for it is a bit weak. If nobody chimes in with a resounding
> endorsement, I am inclined to probably drop it.
>
>> Wasn't your motivating example about tiebreaking between 'main' and
>> 'master' that always point at the same commit?
>
> Yes indeed, that was the original motivation, although after the fix
> in 7c5045fc180ed09ed4cb5 the tie-breaking by refname already has the
> equivalent desired effect, albeit coincidentally.
>
> Perhaps the sort keys _should_ be `-committerdate`, then `-HEAD`, then
> `refname` (implicit default); ie. `--sort=-HEAD --sort=-committerdate`
> (which is the opposite order to what I have in the patch). I would have
> prepared the patch in that way in the first place if my testing hadn't
> been confounded by the fact that I was running an older version of Git
> on the installation where I was trying it out.
>
> I feel the argument for using `HEAD` as a tiebreaker is easier to make
> than the case for using it as a primary sort key, because it is a less
> invasive change. If there is support for that idea, I'll tweak the
> patch.

I agree that using HEADness as a tiebreaker is a much easier sell.

Another idea would be to give site administrators (or even to the
end users via UI) an option to tweak how they are sorted.

  reply	other threads:[~2021-06-09  7:47 UTC|newest]

Thread overview: 10+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-06-06  8:51 [RFC PATCH] gitweb: use HEAD as primary sort key in git_get_heads_list() Greg Hurrell
2021-06-06  8:57 ` Greg Hurrell
2021-06-08  8:34   ` Jeff King
2021-06-08  9:02     ` Greg Hurrell
2021-06-08 21:14       ` Greg Hurrell
2021-06-08 22:07         ` Jeff King
2021-06-09  0:15         ` Junio C Hamano
2021-06-09  7:38           ` Greg Hurrell
2021-06-09  7:47             ` Junio C Hamano [this message]
2021-06-09 19:28               ` [PATCH v2] gitweb: use HEAD as secondary " Greg Hurrell

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=xmqqpmwviinb.fsf@gitster.g \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=greg@hurrell.net \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.