diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2014-02-27 19:56:52 +0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2014-02-27 14:04:05 -0800 |
commit | 9ef176b55c373ba087b2d84e77b5713578891927 (patch) | |
tree | a722c05ca54a4573a91076d04a4d47a60680bfd5 /cache.h | |
parent | 5f95c9f850b19b368c43ae399cc831b17a26a5ac (diff) | |
download | git-9ef176b55c373ba087b2d84e77b5713578891927.tar.gz git-9ef176b55c373ba087b2d84e77b5713578891927.tar.xz |
tag: support --sort=<spec>
--sort=version:refname (or --sort=v:refname for short) sorts tags as
if they are versions. --sort=-refname reverses the order (with or
without ":version").
versioncmp() is copied from string/strverscmp.c in glibc commit
ee9247c38a8def24a59eb5cfb7196a98bef8cfdc, reformatted to Git coding
style. The implementation is under LGPL-2.1 and according to [1] I can
relicense it to GPLv2.
[1] http://www.gnu.org/licenses/gpl-faq.html#AllCompatibility
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'cache.h')
-rw-r--r-- | cache.h | 2 |
1 files changed, 2 insertions, 0 deletions
@@ -1367,4 +1367,6 @@ int stat_validity_check(struct stat_validity *sv, const char *path); */ void stat_validity_update(struct stat_validity *sv, int fd); +int versioncmp(const char *s1, const char *s2); + #endif /* CACHE_H */ |