nedbat / scriv

Changelog management tool
https://scriv.readthedocs.io
Apache License 2.0
256 stars 28 forks source link

`scriv github-release` will fail with multiple github remotes #78

Closed regisb closed 1 year ago

regisb commented 1 year ago

Consider the following use case:

$ git remote add test1 git@github.com:test1/myrepo.git
$ git remote add test2 git@github.com:test2/myrepo.git

scriv github-release will fail because of multiple GitHub repos (source):

Couldn't determine GitHub repo.

To get past this error, we need to remove all but one of the repos:

$ git remote rm test2

This behavior is OK in CI, where there usually is just a single upstream repo, but it's more problematic when running locally.

  1. The error message is not very informative: I had to look at the source code to understand the problem. The error message could for instance tell us that there are too many GitHub repos, and it could give us about the names of these repos.
  2. I wish there was a way to tell scriv about my preferred repo.

There are different ways to resolve the second issue. I would lean toward adding a CLI option to the github-release command. Something similar to:

scriv github-release --repo=me/myrepo

(I think that the name of a GitHub repo is better than a git remote here.)

nedbat commented 1 year ago

Implemented in https://github.com/nedbat/scriv/pull/79.

nedbat commented 1 year ago

Implemented in commit 0bb05c4.

nedbat commented 1 year ago

This is now released as part of scriv 1.2.0.