ocaml-opam / opam-publish

A tool to ease contributions to opam repositories
https://opam.ocaml.org
Other
40 stars 21 forks source link

--dry-run unexpectedly force pushes to existing PR #117

Open leviroth opened 3 years ago

leviroth commented 3 years ago

I created a PR with opam publish and ran into some CI issues, so I made changes to my project and was trying to figure out how to modify the PR. I tried opam publish --dry-run, hoping that I could somehow export the patch to my fork of opam-repository.

In fact, opam publish --dry-run force pushed the new packages to the remote branch underlying my existing PR.

While this is ultimately what I was trying to do, it's unexpected that --dry-run results in world-visible changes like this.

yannl35133 commented 1 year ago

More generally, it looks like opam-publish doesn't properly take into account when you are trying to amend an existing PR, and so every call to it will force-push with no prior warning to the user. I intended to push the modifications in the form of a new commit, which is what I think opam-publish should offer to do, but at least put it behind a confirmation prompt.

(My message looks blunt now that I read it, the tool is still good and very useful, I'd still much rather use it than learn how to publish manually, so thank you devs for it)