#1135311 uscan: Git-Pretty: describe creates a problematic version string

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Andres Salomon
Date:
2026-05-01 01:57:01 UTC
Severity:
normal
#1135311#5
Date:
2026-05-01 01:54:57 UTC
From:
To:
I'm using a d/watch file with "Mode: git", "Matching-Pattern: HEAD", and
"Git-Pretty: describe". I like that this will pull the latest tag and
create a string on top if it (using 'git describe --tags', but notice
the following potential future issue.

Upstream tags and releases foobar-0.1. We upload foobar_0.1.orig.tar.xz.

Upstream then adds 3 more important commits that we want to include.

'git describe --tags' at that point creates the version string
0.1-3-c0ffeee. We upload foobar_0.1.3.c0ffeee.orig.tar.xz.

Upstream adds a 4th commit that is a security or other important fix,
but doesn't think it warrants a 0.2 release. Instead, they release
foobar-0.1.1. We attempt to upload foobar_0.1.1.orig.tar.xz, but the
version string  0.1.1 is less than 0.1.3.c0ffeee.


I'm working around this potential issue with a very hackish
Oversion-Mangle, but it would make sense to me to insert a "+git" or
similar string into the upstream version so that the number of commits
past the tag isn't considered part of the upstream version tag. In other
words, instead of 0.1.3.coffeee, the version string would be
0.1+git.3.coffeee. If upstream tags 0.1.1, that's fine because according
to dpkg, 0.1+git.3.coffeee < 0.1.1.

Here's my workaround, which turns 0.1.3.coffeee into 0.1+git3.coffeee :


Oversion-Mangle: s/\.([0-9]+)\.(g[0-9a-fA-F]{8})$/+git$1.$2/