Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 879947 - dev-util/pkgcheck-0.10.16: Crashes with commits flag
Summary: dev-util/pkgcheck-0.10.16: Crashes with commits flag
Status: RESOLVED FIXED
Alias: None
Product: Gentoo Hosted Projects
Classification: Unclassified
Component: PkgCore (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: PkgCore project
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2022-11-05 22:57 UTC by Mikhail Golbakh
Modified: 2022-11-12 12:13 UTC (History)
1 user (show)

See Also:
Package list:
Runtime testing required: ---


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Mikhail Golbakh 2022-11-05 22:57:33 UTC
Hello!

pkgcheck 0.10.16 crashes with --commits flag with the following error:

Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkgcheck/addons/git.py", line 341, in generate_restrictions
    p = subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'diff-tree', '-r', '--name-only', '-z', 'origin..HEAD']' returned non-zero exit status 128.
pkgcheck scan: error: failed running git: fatal: ambiguous argument 'origin..HEAD': unknown revision or path not in the working tree.

Thanks and best, Mikhail
Comment 1 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-11-08 19:57:54 UTC
Can you please add the following info:

1. link to overlay / repo (if not gentoo)
2. output of `git remove -v` in that git repo
3. all versions of pkgcheck stack (pkgcheck, pkgcore, snakeoil)
4. please add "--debug" to the command, and rerun it
Comment 2 Mikhail Golbakh 2022-11-12 11:54:39 UTC
1. https://github.com/DakEnviy/underworld-overlay
2.                                                                                                                                                   
origin  git@github.com:DakEnviy/underworld-overlay.git (fetch)
origin  git@github.com:DakEnviy/underworld-overlay.git (push)
3.
dev-util/pkgcheck-0.10.17
sys-apps/pkgcore-0.12.16-r1
dev-python/snakeoil-0.10.1
4.
Traceback (most recent call last):
  File "/usr/lib/python3.10/site-packages/pkgcheck/addons/git.py", line 341, in generate_restrictions
    p = subprocess.run(
  File "/usr/lib/python3.10/subprocess.py", line 526, in run
    raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['git', 'diff-tree', '-r', '--name-only', '-z', 'origin..HEAD']' returned non-zero exit status 128.
pkgcheck scan: error: failed running git: fatal: ambiguous argument 'origin..HEAD': unknown revision or path not in the working tree.
Comment 3 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-11-12 11:56:57 UTC
Can you try to run the following command (taken from docs [1]):

git remote set-head origin master

And then try again to check commits :)

[1] https://pkgcore.github.io/pkgcheck/man/pkgcheck.html#git
Comment 4 Mikhail Golbakh 2022-11-12 12:08:40 UTC
Sry, I've missed this one in docs. Thanks for the help :)

Suggestion: maybe check this case and add suggestion to run the command:

git remote set-head origin master
Comment 5 Arthur Zamarin archtester Gentoo Infrastructure gentoo-dev Security 2022-11-12 12:13:33 UTC
(In reply to Mikhail Golbakh from comment #4)
> Sry, I've missed this one in docs. Thanks for the help :)

No problems. I took maintenance over the stack not so long ago, so I still learn the pitfalls (believe me there are a lot!)

> Suggestion: maybe check this case and add suggestion to run the command:
> 
> git remote set-head origin master

A very good idea! I will open a task for myself to think how to improve it (maybe if command fails, go to a longer code path which tries to guess the cause and show suggestion for that).

For now I'm closing this bug.