GunnarFarneback/LocalRegistry.jl

Too easy to commit directly to registry master/main branch

IanButterworth opened this issue · 6 comments

Running just

register("Foo")

will currently register, commit, and push to the remote.

At least in interactive mode, I would like to review before pushing to remote, especially in my case where I was still on master, and wanted to create a PR for the new version.

Avoiding a breaking change, if isinteractive perhaps there could be prompts to ask?

It's easy by design.

Something I would consider is a mechanism to customize kwarg defaults and store them in a scratch space.

Would you be open to if:

  1. On master/main
  2. In interactive mode

prompt to confirm push to remote?

I haven't hit this footgun yet but I can see it happening, Ian's most recent suggestion sounds like a good compromise to me.

No. With a personal registry it's perfectly reasonable to push straight to the default branch without PRs and do it in interactive mode.

I would accept a PR adding a :prompt alternative to the push kwarg though (which could fall back to true in non-interactive mode).

How common is a personal registry? I hadn't considered that people have such things. In my experience registries have been shared between people.

I use this package mostly automatically, but sometimes manually to do things with a company registry, HolyLabRegistry and General, all of which I have commit bit for. The automatic push nature of register just seems unusually risky. (Even though General probably has push to master disabled, probably)

Are you suggesting that the :prompt kwarg would be an option but not the new default?

How common is a personal registry?

I have no usage stats but it's with some regularity proposed on discourse as a solution to handling personal interdependent packages.

probably has push to master disabled

All git hosting systems have the option to disallow pushing to selected branches and, frankly, if a direct push to the default branch might cause any kind of inconvenience, it's a major mis-configuration to allow it.

Are you suggesting that the :prompt kwarg would be an option but not the new default?

Yes, but it could be combined with the idea in my first reply.