Package Details: less-git 691.r11.g7f99df7-1

Git Clone URL: https://aur.archlinux.org/less-git.git (read-only, click to copy)
Package Base: less-git
Description: A free, open-source file pager
Upstream URL: https://greenwoodsoftware.com/less/
Licenses: GPL-3.0-or-later, LicenseRef-less
Conflicts: less
Provides: less
Submitter: Chocobo1
Maintainer: Chocobo1
Last Packager: Chocobo1
Votes: 0
Popularity: 0.000000
First Submitted: 2022-09-04 15:41 (UTC)
Last Updated: 2026-01-25 15:44 (UTC)

Dependencies (5)

Required by (58)

Sources (1)

Latest Comments

Chocobo1 commented on 2026-01-25 15:46 (UTC)

Second, upstream uses -rel tags every so often (16/691 releases by my count), which you're not accounting for. pkgvers may not contain dashes.

Fixed.

gesh commented on 2026-01-25 15:14 (UTC) (edited on 2026-01-25 15:19 (UTC) by gesh)

Two remarks re pkgver() -- first, you could avoid the printf by just using git describe -- you could just git describe --long --exclude 'rc[0-9]*' to do what you're doing, with a bit of sed massaging to insert the r prefix to the commit count.

Second, upstream uses -rel tags every so often (16/691 releases by my count), which you're not accounting for. pkgvers may not contain dashes. One solution is just banning that family of tags (by my checks, these always point to the same commit as the non-rel tags). Another is to pass the pkgver through a sed s/-/./g to make sure no illegal characters slip through.

i.e. one solution is

diff --git a/PKGBUILD b/PKGBUILD
index 2150c00..bec6a14 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,7 +18,7 @@ sha256sums=('SKIP')
 pkgver() {
   cd "less"

-  _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d' | head -n1)
+  _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d;/-rel/d' | head -n1)
   _rev=$(git rev-list --count $_tag..HEAD)
   _hash=$(git rev-parse --short HEAD)
   printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'

and the other is

diff --git a/PKGBUILD b/PKGBUILD
index 2150c00..22a6039 100644
--- a/PKGBUILD
+++ b/PKGBUILD
@@ -18,10 +18,8 @@ sha256sums=('SKIP')
 pkgver() {
   cd "less"

-  _tag=$(git tag -l --sort -v:refname | sed '/rc[0-9]*/d' | head -n1)
-  _rev=$(git rev-list --count $_tag..HEAD)
-  _hash=$(git rev-parse --short HEAD)
-  printf "%s.r%s.g%s" "$_tag" "$_rev" "$_hash" | sed 's/^v//'
+  git describe --long --tags --exclude 'rc[0-9]*' --exclude '*-rel' |
+    sed 's/^[^0-9]*//;s/\([^-]*-g\)/r\1/;s/-/./g'
 }

or instead of enumerating badness, use --match 'v*[0-9]' to be explicit about what we want.