Re: [RFC/PATCH 4/9] ref-filter: add support to sort by version
- From
Duy Nguyen <pclouds@gmail.com>
- Date
- Jul 12, 2015, 09:09 UTC
- Message-ID
- <CACsJy8DYcTAB6OkpAf-5kQ0V09Jkw8KDTGbRvLRO4TVXAwK8Bw@mail.gmail.com>
- In-Reply-To
- <1435232596-27466-4-git-send-email-karthik.188@gmail.com>
On Thu, Jun 25, 2015 at 6:43 PM, Karthik Nayak <karthik.188@gmail.com> wrote:
> Add support to sort by version using the "v:refname" and > "version:refname" option. This is achieved by using the > 'version_cmp()' function as the comparing function for qsort.
If these v:refname and version:refname are from git-tag, you may want to see [1]. I would say "version:" or "v:" is in the same class as "-" (for reverse sort) and they should be parsed in parse_opt_ref_sorting() instead. They should not be treated as atom names. By stripping "version:" before pref_ref_filter_atom() is called in this function, you make "version:" work with all supported atoms.
[1] http://article.gmane.org/gmane.comp.version-control.git/242446
-- Duy