#1082834 devscripts: uscan in git mode wrong commit hash comparison

Package:
devscripts
Source:
devscripts
Description:
scripts to make the life of a Debian Package maintainer easier
Submitter:
Eric Deveaud
Date:
2024-10-02 12:15:01 UTC
Severity:
normal
#1082834#5
Date:
2024-09-27 08:49:07 UTC
From:
To:
Dear Maintainer,

/usr/bin/uscan miscompare commit hash in some cases, see:
tested with uscan  version version 2.23.7 on Ubuntu 24.04.1 LTS
and version 2.20.2ubuntu2 on 20.04.6 LTS (Focal Fossa)

```
inst/watcher > cat ./watchfile
uscan --watchfile /tmp/watchdzvt5jcg --package SparsePainter
--upstream-version e18060f --destdir=/tmp  --verbose
inst/watcher > uscan --watchfile ./watchfile --package SparsePainter
--upstream-version e18060f --destdir=/tmp  --verbose
uscan info: uscan (version 2.20.2ubuntu2) See uscan(1) for help
uscan info: Option --watchfile=./watchfile used
uscan info: Process watch file at: ./watchfile
     package = SparsePainter
     version = e18060f
     pkg_dir = .
uscan info: opts: mode=git, gitmode=full, pgpmode=none, pretty=%h
uscan info: line: https://github.com/YaolingYang/SparsePainter HEAD
uscan info: Parsing mode=git
uscan info: Parsing  gitmode=full
uscan info: Parsing  pgpmode=none
uscan info: Parsing  pretty=%h
uscan info: line: https://github.com/YaolingYang/SparsePainter HEAD
uscan info: Last orig.tar.* tarball version (from debian/changelog): e18060f
uscan info: Last orig.tar.* tarball version (dversionmangled): e18060f
Cloning into bare repository '/tmp/SparsePainter-temporary.127613.git'...
remote: Enumerating objects: 1797, done.
remote: Counting objects: 100% (158/158), done.
remote: Compressing objects: 100% (78/78), done.
remote: Total 1797 (delta 123), reused 79 (delta 79), pack-reused 1639
(from 1)
Receiving objects: 100% (1797/1797), 20.66 MiB | 27.54 MiB/s, done.
Resolving deltas: 100% (1100/1100), done.
uscan info: Looking at $base =
https://github.com/YaolingYang/SparsePainter with
     $filepattern = HEAD found
     $newfile     = HEAD
     $newversion  = c08fd50
     $lastversion = e18060f
uscan info: Upstream URL(+tag) to download is identified as
https://github.com/YaolingYang/SparsePainter HEAD
uscan info: Filename (filenamemangled) for downloaded file:
SparsePainter-c08fd50.tar.xz
uscan info: Newest version of SparsePainter on remote site is c08fd50,
local version is e18060f
uscan info:    => Only older package available from
       https://github.com/YaolingYang/SparsePainter HEAD
uscan info: Removing git repo (/tmp/SparsePainter-temporary.127613.git)
uscan info: Scan finished

```

while when checking the commits date, we can observe.
commit e18060f Mar 18, 2024
commit c08fd50 Sep 16, 2024

I was expecting uscan to report that there a newer version available.
--- /etc/devscripts.conf ---
Empty.
--- ~/.devscripts --- Not present
#1082834#10
Date:
2024-10-02 11:39:20 UTC
From:
To:
Hello,

in reply to Bug#231082834:3devscripts: uscan in git mode wrong commit
hash comparison

same problem again.

see

inst/watcher > cat ./watchfile
version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=%h"
https://github.com/AI-sandbox/gnomix HEAD
inst/watcher > uscan --watchfile ./watchfile --package gnomix
--upstream-version de952a2 --destdir=/tmp --no-download --verbose
uscan info: uscan (version 2.20.2ubuntu2) See uscan(1) for help
uscan info: Option --watchfile=/tmp/watchf7mhplfd used
uscan info: Process watch file at: /tmp/watchf7mhplfd
     package = gnomix
     version = de952a2
     pkg_dir = .
uscan info: opts: mode=git, gitmode=full, pgpmode=none, pretty=%h
uscan info: line: https://github.com/AI-sandbox/gnomix HEAD
uscan info: Parsing mode=git
uscan info: Parsing  gitmode=full
uscan info: Parsing  pgpmode=none
uscan info: Parsing  pretty=%h
uscan info: line: https://github.com/AI-sandbox/gnomix HEAD
uscan info: Last orig.tar.* tarball version (from debian/changelog): de952a2
uscan info: Last orig.tar.* tarball version (dversionmangled): de952a2
Cloning into bare repository '/tmp/gnomix-temporary.135243.git'...
remote: Enumerating objects: 1419, done.
remote: Counting objects: 100% (417/417), done.
remote: Compressing objects: 100% (195/195), done.
remote: Total 1419 (delta 201), reused 387 (delta 191), pack-reused 1002
(from 1)
Receiving objects: 100% (1419/1419), 164.89 MiB | 27.14 MiB/s, done.
Resolving deltas: 100% (780/780), done.
uscan info: Looking at $base = https://github.com/AI-sandbox/gnomix with
     $filepattern = HEAD found
     $newfile     = HEAD
     $newversion  = 2eca7b0
     $lastversion = de952a2
uscan info: Upstream URL(+tag) to download is identified as
https://github.com/AI-sandbox/gnomix HEAD
uscan info: Filename (filenamemangled) for downloaded file:
gnomix-2eca7b0.tar.xz
uscan info: Newest version of gnomix on remote site is 2eca7b0, local
version is de952a2
uscan info:    => Only older package available from
       https://github.com/AI-sandbox/gnomix HEAD
uscan info: Removing git repo (/tmp/gnomix-temporary.135243.git)
uscan info: Scan finished


newversion    2eca7b0 from Jul 3, 2024
lastversion    de952a2 from Sep 18, 2022 (2 years ago)

I have some more examples where the commit hash comparaison is inacurate

eg with the following git watchfiles // command line:

#-------------- https://github.com/mmtsb/toolset
version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=%h"
https://github.com/mmtsb/toolset HEAD


uscan --watchfile ./watchfile --package MMTSB_TOOLSET --upstream-version
fa2e5ee --destdir=/tmp --no-download --debug

results:
newversion    6be8188 Aug 2, 2024
lastversion    fa2e5ee from Mar 31, 2021

#--------------https://github.com/genpat-it/vcf2mst
version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=%h"
https://github.com/genpat-it/vcf2mst HEAD

uscan --watchfile watchfile --package vcf2mst --upstream-version a5d5c9d
--destdir=/tmp --no-download --verbose

results:

newversion    6f48dad from May 15, 2024
lastversion    a5d5c9d from Sep 22, 2022

#-------------- https://github.com/PacificBiosciences/apps-scripts
version=4
opts="mode=git, gitmode=full, pgpmode=none, pretty=%h"
https://github.com/PacificBiosciences/apps-scripts HEAD

uscan --watchfile /./watchfile --package RepeatAnalysisTools
--upstream-version 88dc95a --destdir=/tmp --no-download --verbose

results:

newversion    3ab3896 from Apr 19, 2022
lastversion    88dc95a from Mar 29, 2022

regards

Eric