Skip to content

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

Merged
gentoo-bot merged 1 commit intopkgcore:masterfrom
arthurzam:custom-remote
Jul 10, 2023
Merged

scan: add --git-remote option to select remote#601
gentoo-bot merged 1 commit intopkgcore:masterfrom
arthurzam:custom-remote

Conversation

@arthurzam
Copy link
Copy Markdown
Member

@arthurzam arthurzam commented Jul 9, 2023

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: #600

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.

Resolves: pkgcore#600
Signed-off-by: Arthur Zamarin <arthurzam@gentoo.org>
@codecov
Copy link
Copy Markdown

codecov Bot commented Jul 9, 2023

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
@@           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 Coverage Δ
src/pkgcheck/addons/git.py 97.69% <100.00%> (+0.01%) ⬆️

... and 3 files with indirect coverage changes

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

Copy link
Copy Markdown

@hartwork hartwork left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

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.

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.

@arthurzam
Copy link
Copy Markdown
Member Author

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.

@gentoo-bot gentoo-bot merged commit 123abbc into pkgcore:master Jul 10, 2023
@arthurzam arthurzam deleted the custom-remote branch July 10, 2023 20:07
@gentoo-bot gentoo-bot temporarily deployed to github-pages July 10, 2023 20:08 — with GitHub Actions Inactive
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Git remote currently required to be named "origin", please allow other remote names via configuration

3 participants