From: Jeff King <peff@peff.net>
To: "Nguyễn Thái Ngọc Duy" <pclouds@gmail.com>
Cc: git@vger.kernel.org
Subject: Re: [PATCH] tag: support --sort=version
Date: Wed, 19 Feb 2014 09:09:09 -0500 [thread overview]
Message-ID: <20140219140909.GA20128@sigill.intra.peff.net> (raw)
In-Reply-To: <1392817167-29802-1-git-send-email-pclouds@gmail.com>
On Wed, Feb 19, 2014 at 08:39:27PM +0700, Nguyễn Thái Ngọc Duy wrote:
> --sort=version sorts tags as versions. GNU extension's strverscmp is
> used and no real compat implementation is provided so this is Linux only.
Sounds like a good goal.
I wonder, if we were to merge the for-each-ref and tag
implementations[1], how this would integrate with for-each-ref's
sorting. It can sort on arbitrary fields like "--sort=-*authordate". I
think given the syntax you provide, this would fall out naturally as
just another key (albeit a slightly magical one, as it is building on
the %(refname:short) field but using a different comparator).
Would we ever want to version-sort any other field? Perhaps
%(content:subject) for a tag? I'm not sure what would be the most
natural way to specify that. Maybe "--sort=version:content:subject",
with just "--version" as a synonym for "version:refname:short".
We don't need to do any of that immediately. This is mostly just me
thinking aloud, to make sure we do not paint ourselves into a corner
compatibility-wise.
-Peff
[1] I have patches which I really need to polish and send out that
combine the ref-selection code (so tag, branch, and for-each-ref all
know "--merged", "--contains", etc). I'd really like to combine the
sorting and formatting code, too, so everybody can use "--sort" and
"--format" with all of the associated fields.
next prev parent reply other threads:[~2014-02-19 14:09 UTC|newest]
Thread overview: 25+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-02-19 13:39 [PATCH] tag: support --sort=version Nguyễn Thái Ngọc Duy
2014-02-19 14:09 ` Jeff King [this message]
2014-02-19 14:19 ` Duy Nguyen
2014-02-20 20:43 ` Jeff King
2014-02-21 11:58 ` Duy Nguyen
2014-02-21 17:48 ` Junio C Hamano
2014-02-22 7:59 ` Jeff King
2014-02-22 9:07 ` Duy Nguyen
2014-02-19 18:43 ` Eric Sunshine
2014-02-22 3:29 ` [PATCH v2] tag: support --sort=<spec> Nguyễn Thái Ngọc Duy
2014-02-22 8:04 ` Jeff King
2014-02-24 16:39 ` Junio C Hamano
2014-02-24 23:30 ` Duy Nguyen
2014-02-24 23:33 ` Jeff King
2014-02-25 12:22 ` [PATCH v3] " Nguyễn Thái Ngọc Duy
2014-02-25 17:42 ` Junio C Hamano
2014-02-26 9:05 ` Jeff King
2014-02-26 11:03 ` Duy Nguyen
2014-02-26 11:08 ` Jeff King
2014-02-26 11:11 ` Duy Nguyen
2014-02-26 11:17 ` Jeff King
2014-02-26 11:31 ` Duy Nguyen
2014-02-27 12:56 ` [PATCH v4] " Nguyễn Thái Ngọc Duy
2014-02-27 13:11 ` Jeff King
2014-02-27 13:23 ` Duy Nguyen
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=20140219140909.GA20128@sigill.intra.peff.net \
--to=peff@peff.net \
--cc=git@vger.kernel.org \
--cc=pclouds@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).