pkgcore / pkgcheck

pkgcore-based QA utility for ebuild repos
https://pkgcore.github.io/pkgcheck
BSD 3-Clause "New" or "Revised" License
34 stars 29 forks source link

scan: add `--git-remote` option to select remote #601

Closed arthurzam closed 12 months ago

arthurzam commented 1 year ago

For repos with multiple remotes, it might be useful to select a specific remote to use (and not the default origin). This can be set using the --git-remote option for cmd call, or by adding git-remote=value to the config file.

@hartwork mind applying the patch and verifying if it work for you (ideally both ways of cmd arg and config file).

Resolves: https://github.com/pkgcore/pkgcheck/issues/600

codecov[bot] commented 1 year ago

Codecov Report

Patch coverage: 100.00% and no project coverage change.

Comparison is base (4e9dbc1) 79.75% compared to head (123abbc) 79.75%.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #601 +/- ## ======================================= Coverage 79.75% 79.75% ======================================= Files 58 58 Lines 8618 8621 +3 Branches 1961 1961 ======================================= + Hits 6873 6876 +3 - Misses 1643 1648 +5 + Partials 102 97 -5 ``` | [Impacted Files](https://app.codecov.io/gh/pkgcore/pkgcheck/pull/601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pkgcore) | Coverage Δ | | |---|---|---| | [src/pkgcheck/addons/git.py](https://app.codecov.io/gh/pkgcore/pkgcheck/pull/601?src=pr&el=tree&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pkgcore#diff-c3JjL3BrZ2NoZWNrL2FkZG9ucy9naXQucHk=) | `97.69% <100.00%> (+0.01%)` | :arrow_up: | ... and [3 files with indirect coverage changes](https://app.codecov.io/gh/pkgcore/pkgcheck/pull/601/indirect-changes?src=pr&el=tree-more&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pkgcore)

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.

arthurzam commented 12 months ago

Hi @arthurzam very nice and quick — thank you! pray

I have tried both (1) --git-remote git-gentoo-org and (2) the config option with no origin in sight now and it worked with each of these in isolation and did not work by default (as expected). That's great.

Thank you :)

For anyone else interested, the config file looked like this for me in practice:

# cat ~/.config/pkgcheck/pkgcheck.conf
[DEFAULT]
git-remote = git-gentoo-org

One thing I noticed is that in the config file git-remote (with a dash) could be an unusual key format/syntax here if nothing else uses a dash so far (not sure); if so, git_remote with an underscore may work better, just an idea.

At pkgcore stack we use the - symbol for command line arguments word separation (python's argparse converts it into _ for the option variable name). I think this style also makes better sense compared to git and the -- prefix :) so we should be same style. But thank you for the concern and verifying it.

I'll merge it now.