From: Jeff King <peff@peff.net>
To: Duy Nguyen <pclouds@gmail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: Re: [PATCH] tag: support --sort=version
Date: Thu, 20 Feb 2014 15:43:45 -0500 [thread overview]
Message-ID: <20140220204345.GA3374@sigill.intra.peff.net> (raw)
In-Reply-To: <CACsJy8CL3rQx=QHf_eABCUqS+9kZXEmopUuCMiNCL+UPyvtbyw@mail.gmail.com>
On Wed, Feb 19, 2014 at 09:19:24PM +0700, Duy Nguyen wrote:
> > 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.
>
> Good thinking. If you plan to use the exact same sort syntax f-e-r
> uses now, pick a letter (the dot I used above is probably not the
> best), I'll rewrite this patch to use the same syntax.
I think I actually prefer the full word "version", as you have already.
It's clear what it means, and we can extend the syntax generally to:
--sort=[-][comparison:]field
like:
--sort=-version:subject
for descending version-sort by subject. And then as a special-case
convenience, make "version" without a field default to
"version:refname". There's no ambiguity because the set of comparison
names and field-names is fixed, and we know there is no overlap.
If want to, we can _also_ give a one-letter abbreviation to the
comparison field, like:
--sort=v:subject
but that is not necessary.
So I think your patch is fine as-is. It is perhaps a little funny to
start with the special case and only implement the general case later,
but:
1. We would want the special case eventually, because it is the most
natural thing to type, and pretty clearly the most common use-case.
2. We may not ever even end up with the general case. This is just
about making sure that if we _do_ add it, that it fits
syntactically with "--sort=version".
-Peff
next prev parent reply other threads:[~2014-02-20 20:43 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
2014-02-19 14:19 ` Duy Nguyen
2014-02-20 20:43 ` Jeff King [this message]
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=20140220204345.GA3374@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).