- Package:
- git-buildpackage
- Source:
- git-buildpackage
- Submitter:
- Didier 'OdyX' Raboud
- Date:
- 2022-05-31 11:09:10 UTC
- Severity:
- normal
- Tags:
On multiple of my repositories, `gbp dch` fails with the following error:
(That's on https://anonscm.debian.org/cgit/pkg-games/planetblupi.git )
$ gbp dch --release --verbose
gbp:debug: ['git', 'rev-parse', '--show-cdup']
gbp:debug: ['git', 'rev-parse', '--is-bare-repository']
gbp:debug: ['git', 'rev-parse', '--git-dir']
gbp:debug: ['git', 'symbolic-ref', 'HEAD']
gbp:debug: ['git', 'show-ref', 'refs/heads/debian/master']
gbp:debug: ['git', 'tag', '-l', 'debian/1.11.0-1']
gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'debian/1.11.0-1^0']
gbp:debug: ['git', 'log', '--pretty=format:%H', 'a1f72589d8e0285b65438bb924197a3dd5a93bb2..HEAD', '--no-merges', '--']
gbp:debug: ['git', 'merge-base', 'HEAD', 'upstream/latest']
gbp:debug: ['git', 'describe', '--match', 'upstream/*', '--abbrev=0', 'e0ace8819512553d3680e912e419a5df1b8295ab']
gbp:debug: Found upstream version None.
gbp:debug: /usr/bin/dpkg ['--compare-versions'] [None, 'lt', '1.11.0-1']
Traceback (most recent call last):
File "/usr/lib/python3/dist-packages/gbp/command_wrappers.py", line 232, in call
ret = self.__call(args)
File "/usr/lib/python3/dist-packages/gbp/command_wrappers.py", line 125, in __call
stderr=stderr_arg)
File "/usr/lib/python3.6/subprocess.py", line 709, in __init__
restore_signals, start_new_session)
File "/usr/lib/python3.6/subprocess.py", line 1275, in _execute_child
restore_signals, start_new_session, preexec_fn)
TypeError: expected str, bytes or os.PathLike object, not NoneType
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/bin/gbp", line 151, in <module>
sys.exit(supercommand())
File "/usr/bin/gbp", line 147, in supercommand
return module.main(args)
File "/usr/lib/python3/dist-packages/gbp/scripts/dch.py", line 506, in main
options.upstream_branch, cp)
File "/usr/lib/python3/dist-packages/gbp/scripts/dch.py", line 52, in guess_version_from_upstream
if compare_versions(version, cp.version) > 0:
File "/usr/lib/python3/dist-packages/gbp/deb/__init__.py", line 111, in compare_versions
return DpkgCompareVersions()(version1, version2)
File "/usr/lib/python3/dist-packages/gbp/deb/__init__.py", line 66, in __call__
res = self.call([version1, 'lt', version2])
File "/usr/lib/python3/dist-packages/gbp/command_wrappers.py", line 237, in call
if ret and not quiet:
UnboundLocalError: local variable 'ret' referenced before assignment
Le dimanche, 22 octobre 2017, 11.52:25 h CEST Didier 'OdyX' Raboud a écrit :
This fails because I did `git tag upstream/1.11.0 v1.11.0` but that creates a
tag pointing to a tag. Doing `git tag -m v1.11.0 upstream/1.11.0` fixes the
above.
Cheers,
OdyX
Le dimanche, 22 octobre 2017, 12.04:37 h CEST Didier 'OdyX' Raboud a écrit :
$ git tag upstream/1.11.0 `git rev-parse v1.11.0`
sorry…
OdyX
Hi,
^^^^
That's the problem and it results from the code around the above 'git
describe' somehow returning None. From looking at the code and trying
various things I can't reproduce this. Can you tell me where your HEAD was
at when invoking the command?
git tag upstream/1.11.0 `git rev-parse v1.11.0`
git tag -d upstream/1.11.0
gbp dch -R
didn't do the trick. Any idea what I could be missing?
This one is fixed in git already.
Cheers,
-- Guido
Hi, Can you point me to a repo where I can reproduce this? Cheers, -- Guido
Le mardi, 7 novembre 2017, 10.00:01 h CEST Guido Günther a écrit : git clone https://salsa.debian.org/printing-team/cups.git cd cups # Let the upstream/latest branch exist git checkout upstream/latest # Put debian/master to a commit that triggers the bug git checkout debi an/master git reset --hard 7210eeb6f1d0d99cb008a4567127b7762a29f5a7 gbp dch --release --verbose gbp:debug: ['git', 'rev-parse', '--show-cdup'] gbp:debug: ['git', 'rev-parse', '--is-bare-repository'] gbp:debug: ['git', 'rev-parse', '--git-dir'] gbp:debug: ['git', 'symbolic-ref', 'HEAD'] gbp:debug: ['git', 'show-ref', 'refs/heads/debian/master'] gbp:debug: ['git', 'tag', '-l', 'debian/2.2.7-1'] gbp:debug: ['git', 'rev-parse', '--quiet', '--verify', 'debian/2.2.7-1^0'] gbp:info: Found tag for topmost changelog version '46e03e2adff54390721b1a725ab9a6472e2cba39' gbp:debug: ['git', 'log', '--pretty=format:%H', '46e03e2adff54390721b1a725ab9a6472e2cba39..HEAD', '--no-merges', '--'] gbp:debug: ['git', 'merge-base', 'HEAD', 'upstream/latest'] gbp:debug: ['git', 'describe', '--match', 'upstream/*', '--abbrev=0', '18a1649286d8978552c6334934a23dc6efe5fc0d'] gbp:debug: Found upstream version None. gbp:debug: /usr/bin/dpkg ['--compare-versions'] [None, 'lt', '2.2.7-1'] The temporary workaround is to run: $ git branch -d upstream/latest
Hi Didier, This differs when I run this: gbp:debug: ['git', 'merge-base', 'HEAD', 'upstream/latest'] gbp:debug: No upstream tag found: Failed to get common ancestor: fatal: Not a valid object name upstream/latest and then works as expected. I still can't reproduce this with 0.9.7. Cheers, -- Guido
tag 879495 pending
thanks
Date: Sat May 28 16:40:48 2022 +0200
Author: Guido Günther <agx@sigxcpu.org>
Commit ID: 14170d60f173e3df2923e1fd1a9ab36860ce2c1b
Commit URL: https://git.sigxcpu.org/cgit/git-buildpackage//commit/?id=14170d60f173e3df2923e1fd1a9ab36860ce2c1b
Patch URL: https://git.sigxcpu.org/cgit/git-buildpackage//patch/?id=14170d60f173e3df2923e1fd1a9ab36860ce2c1b
dch: Don't crash when we fail to get an upstream version
Closes: #879495
Hi, I can reproduce with that, thanks! The issue is $ 'git' 'describe' '--match' 'upstream/*' '--abbrev=0' '7210eeb6f1d0d99cb008a4567127b7762a29f5a7' warning: tag 'upstream/2.2.6' is externally known as 'v2.2.6' v2.2.6-4879-g7210eeb6f1d0d99cb008a4567127b7762a29f5a7 There's a long explanation how this comes about: https://github.com/git/git/commit/ff165f00c1065d94c0bcab8708364e6dc5655f5d I changed the code to not crash on that anymore. Cheers, -- Guido
We believe that the bug you reported is fixed in the latest version of
git-buildpackage, which is due to be installed in the Debian FTP archive.
A summary of the changes between this version and the previous one is
attached.
Thank you for reporting the bug, which will now be closed. If you
have further comments please address them to 879495@bugs.debian.org,
and the maintainer will reopen the bug report if appropriate.
Debian distribution maintenance software
pp.
Guido Günther <agx@sigxcpu.org> (supplier of updated git-buildpackage package)
(This message was generated automatically at their request; if you
believe that there is a problem with it please contact the archive
administrators by mailing ftpmaster@ftp-master.debian.org)
Format: 1.8
Date: Tue, 31 May 2022 10:07:23 +0200
Source: git-buildpackage
Architecture: source
Version: 0.9.27
Distribution: unstable
Urgency: medium
Maintainer: Guido Günther <agx@sigxcpu.org>
Changed-By: Guido Günther <agx@sigxcpu.org>
Closes: 879495 934200 966627 983085 984516 1004354 1010370 1011344
Changes:
git-buildpackage (0.9.27) unstable; urgency=medium
.
[ Guido Günther ]
* [7717b39] git/repository: Disable signatures when grepping for commits.
Otherwise get the signature back as well.
Thanks to наб for the patch (Closes: #1010370)
* [86b4fd8] config: Use ConfigParser instead of deprecated SafeConfigParser
(Closes: #1011344)
* [83e7791] tests: Test import-orig from upstream branch
* [14ea481] deb: Decode changelog content when fetched from git.
When importing not form the upstream branch the changelog is fetched
via `git show`. Decode the bytes in that case. (Closes: #1004354)
* [4d173ac] docs: Fix --upstream-signature flag description.
Thanks to Tino Mettler
* [42a1406] clone: Allow to skip alias expansion.
Add an option that allow to skip exansion of aliases like salsa:
by gbp so that git can do that. (Closes: #983085)
* [9ab4a0e] pkgpolicy: Add type annotations.
Just enough to make mypy happy.
* [39ae57e] Ignore imports without type annotations for now.
Ignore rpm and libnotify for the moment
* [92c3fd2] dch: Add minimal type information.
Just enough to make mypy happy
* [441bd27] Makefile: add type-check
* [05ea122] tests: Add "gbp import-orig --uscan" test
* [36737d2] uscan: Drop pre 2.11 devscripts compat code.
It's not even in oldoldoldstable anymore
* [613fcb8] docs: Make --component more prominent
(Closes: #934200)
* [7a674e0] docs: Ship gbp-setup-gitattributs man page
* [14170d6] dch: Don't crash when we fail to get an upstream version
(Closes: #879495)
* [25327d1] smoke-rpm: Avoid deprecated distutils
* [59bf3a6] repository: list_tree: Handle '-'
* [3e30ce3] repository.get_submodules: Only strip repo path from the
beginning. We shouldn't just replace any occurence since we otherwise
might also substitute in the submodule.
Based on a patch by "ushen <yshxxsjt715@gmail.com>".
See https://github.com/agx/git-buildpackage/pull/82
* [03348fd] repository: Add helper to prefix branch with 'refs/heads/'
No attempt is being made to ensure this is a local branch.
* [a5e6dea] pull: Prefix local branch with 'refs/heads/'
This can resolve ambiguity when generating the rev list.
(Closes: #966627)
* [d2200e4] Add breaks on older dgit.
See #1005873, #1010061
.
[ Nicolas Boulenguez ]
* [ff524f1] debhelper: make package prefix explicit in configuration files.
This slightly improves readability.
* [6d1c325] debian/rules: simplify installation of zsh and pk4.
There seems to be no reason to change their names and permissions
between the source tree and the eventual installation path.
* [8742d3f] rules: simplify thanks to debhelper compat 13.
When dh-sequence-foo is listed in build-depends, debhelper
automatically inserts dh_foo in the commands.
override_dh_auto_test is not invoked anymore if DEB_BUILD_OPTIONS
contains nocheck.
execute_after_dh_* is available and more readable than override_dh_*.
Move chmod to execute_after_dh_fixperms for clarity.
Examples are not compressed anymore.
* [4c9032e] debian/rules: remove obsolete and unused Make variables
* [bd529f0] debian/copyrigt: switch to machine-readable format 1.0
* [36499a8] Move some cleaning from debian/rules to debian/clean
* [9bdb516] debian/clean: add forgotten files
* [7740d59] debian/rules: really export GBP_NETWORK_TESTS to tests
$(MAKE) GBP_NETWORK_TESTS=1
was setting a Make variable in the sub-Make, but not exporting it for
test/*.py subprocesses.
* [71a1556] debian/rules: clean __pycache__ directories generated during the
build
* [ee38574] clone: add second allowed form for vcs-git protocol to manual
page
.
[ Arnaud Rebillout ]
* [abce93c] import-dsc: Fix error message when missing debian branch.
The error message mistakenly talks about the upstream branch when it
should be talking about the debian branch.
(Closes: #984516)
Checksums-Sha1:
a6009770f7950db454b0a264501d3163ae5d4043 2340 git-buildpackage_0.9.27.dsc
e1a0ad01cab3ec755eed1a75976cadc21b7c1e16 3460860 git-buildpackage_0.9.27.tar.xz
5de045cd6f7943ecff8a1296f8da0e92ae07c59e 12950 git-buildpackage_0.9.27_amd64.buildinfo
Checksums-Sha256:
b091ede066c1e77d45c24b270b65e67372832bf2840f11f5e27c9dae2da5e1c1 2340 git-buildpackage_0.9.27.dsc
1ba1998037eec4c725cc3a17bcf9b7479e90cd8a1639a16c9d38925db962d702 3460860 git-buildpackage_0.9.27.tar.xz
2f8df55e9369da3db48645ba1e11dae771e15180476cd6223b4fdc687acd946b 12950 git-buildpackage_0.9.27_amd64.buildinfo
Files:
71f5687ecdd09a2e37f34669afd2de14 2340 vcs optional git-buildpackage_0.9.27.dsc
3cd10c93d85be76638756666b79db266 3460860 vcs optional git-buildpackage_0.9.27.tar.xz
5ea9f56b18dcbf0a719fd78bc2f08a6b 12950 vcs optional git-buildpackage_0.9.27_amd64.buildinfo
-----BEGIN PGP SIGNATURE-----
iQIzBAEBCAAdFiEEY/bM35YinQkoayrDJb+GUkr8weMFAmKV8sYACgkQJb+GUkr8
weOvMRAAhr7lqUuRYO7v7MhIf6886JC9//kCOLXcR3dFJj0gUNxbDJMO0f1fxgta
k2vtv84HL0PNHG4v1Efmm5/ZN613VgW7fDMuvw1I7lkmucW64GootkONXhByyxDW
Xs+SpKEEChSpDiko/L+UGmlDf9SgjQIO1u1Z4Dv+ZifKKr6ahxp7Knci3RcWn/b1
y//i4SX787vIOSM54o463p6CjB97TLj19FP8ifBwLcHVlicXaDk6iyyQdhyQDFz8
rS+QLn/08HI3M/1+R4eZ/XqRtPyRAWyslSRka1lo6TXZl6gr0cPnlHlb6B1yP07L
YAzBD0sZLt9DGz4fZDBcbM3lCDQCv3szeB4y+r+hGF1Ybv1B+N6vvIgjAjC1XosD
GFZ/j70heZGO89buODYZ2iPj/2hvbPGzmQpaAs051E0PRSAAjOqS41Se7KMUgZ9z
Wkpl+TcQ1XvwYs7ak2/FVmZeMGu5Es1piywSbV3qVknzOuf8Q8kCBoBinA1jwk7A
aDlhG1d63l/kTQWWfyPv8cEXM3dL4yjPCYpLokVXpGHf+IA5qNtVCOmAfY17mWl3
aGQ3WAGxcz8S9DdabCFwFyFc2Lvv2YF2DMAEkBuwiIMurlYMwJIh76BMbrujY3Tq
lbvfqecWkBWI/4HBMB7JkNQf4CNl6x9A4jx0eBWAgBcZg5CGCrY=
=g4bn
-----END PGP SIGNATURE-----