- Package:
- devscripts
- Source:
- devscripts
- Description:
- scripts to make the life of a Debian Package maintainer easier
- Submitter:
- Alexandre Viau
- Date:
- 2025-01-24 15:51:02 UTC
- Severity:
- wishlist
- Tags:
When using uscan's git mode on a repository that has tags, uscan does not take into account the last tag when constructing the version number. For example, if a repository has a v0.3.0 tag and commits were done after the tag, the last commit being done on 2018-10-25 and having the hash f80706d, the version should be: - 0.3.0~git20181025.f80706d However, uscan currently reports the following version: - 0.0~git20181025.f80706d My watch file is like so: ``` version=4 opts=mode=git, \ https://github.com/collectd/go-collectd.git \ HEAD ``` The specs for the git mode were originally discussed in #811565. It might be that this part of the spec was simply not implemented yet, so feel free to change the severity to wishlist. Cheers,
Le 17/11/2018 à 19:19, Alexandre Viau a écrit : Hello, I'll take a look. For now, you can use "pretty": version=4 opts="pretty=0.3.0~git%cd.%h,mode=git,pgpmode=none" \ https://github.com/collectd/go-collectd.git \ HEAD
Even if they were discussed there, changing such detail would be a breaking change now, so I think it would be hard to do "by default". I think what you are saying is that git HEAD tracking always uses 0.0~ instead of using a version like the one used by `git describe`? In that case, skimming through #811565 it seems to me that it was purposefully left out, so at most adding it now it could/should be done with an option.
Thanks! Sure, that helps in the meantime.
That would be unfortunate as I think this is a much better default and it was suggested from the start. However it that must be added as an option then sure, it will be better than not having it at all. Yes.
Le 18/11/2018 à 01:23, Alexandre Viau a écrit : Hi all, I added a @TAG@ macro for this to avoid regression (https://salsa.debian.org/debian/devscripts/merge_requests/85) Your debian/watch becomes: version=4 opts="pretty=@TAG@+git%cd.%h,mode=git,pgpmode=none" \ https://github.com/collectd/go-collectd.git \ HEAD Cheers, Xavier
Le 17/11/2018 à 22:20, Mattia Rizzolo a écrit : Yes, until now "pretty" option is given directly to `git log --pretty=format:$pretty` which has no option to get last tag. Done with a macro to allow DD to customize their "pretty"
Control: tag -1 + patch - pending Control: severity -1 wishlist I don't particularly like that @TAG@ thing atm. The patch is available in that MR for the future, in case I change my mind, but I think the current set of features is so messy already that it's already quite hard to follow. Manually changing the version in there is not that much of an hassle for now anyway.
tl;dr please support uversionmangle after pretty=
We have a few reasonably common variations of combined tag and date
versions in debian, sometimes including the hash. From discussing in
#debian-mentors this is currently only possible in two ways:
* pretty=1.2.3+%cd.%h (e.g. libretro-nestopia)
as suggested above by yadd, but hardcoded and will miss newer tags
* dversionmangle=s/\+git\d+$// (e.g. cegui-mk2)
maintainer manually downloads snapshot and appends date to d/changelog
Since git 2.35 (bullseye-backports) this pretty syntax is possible, and
works today in uscan but has some drawbacks:
opts="mode=git, gitmode=full, pretty=%(describe:abbrev=0)+%cd"
It results in a string like "version-0.4.4+20241227" and for some reason
uversionmangle=s/version-// has no effect. It also only works on
Annotated tags, "describe:tags=true,abbrev=0" should fix that, but opts=
comma parsing splits it first and I can't find a way to escape it. So I
think that if uversionmangle worked then "describe:tags=true" would be
fine and the abbrev=0 could be replicated with sed.
tl;dr please support uversionmangle after pretty=
We have a few reasonably common variations of combined tag and date
versions in debian, sometimes including the hash. From discussing in
#debian-mentors this is currently only possible in two ways:
* pretty=1.2.3+%cd.%h (e.g. libretro-nestopia)
as suggested above by yadd, but hardcoded and will miss newer tags
* dversionmangle=s/\+git\d+$// (e.g. cegui-mk2)
maintainer manually downloads snapshot and appends date to d/changelog
Since git 2.35 (bullseye-backports) this pretty syntax is possible, and
works today in uscan but has some drawbacks:
opts="mode=git, gitmode=full, pretty=%(describe:abbrev=0)+%cd"
It results in a string like "version-0.4.4+20241227" and for some reason
uversionmangle=s/version-// has no effect. It also only works on
Annotated tags, "describe:tags=true,abbrev=0" should fix that, but opts=
comma parsing splits it first and I can't find a way to escape it. So I
think that if uversionmangle worked then "describe:tags=true" would be
fine and the abbrev=0 could be replicated with sed.