chapel-lang / chapel

a Productive Parallel Programming Language
https://chapel-lang.org
Other
1.76k stars 414 forks source link

Mason: Mason publish improvements #13832

Open oplambeck opened 4 years ago

oplambeck commented 4 years ago

Three general improvements to mason publish @Spartee @ben-albrecht

  1. Clear up error message when user does not commit their work to the package they are trying to publish. Current behavior below.

    > mason new Pkg
    > cd Pkg
    > mason publish <path-to-local-registry>
    Updating mason-registry
    fatal: Failed to resolve 'HEAD' as a valid ref.
  2. Have mason publish accept a relative path to a local registry.

  3. Handle case where the user tries to republish without deleting their previous branch from the fork. Ideally recognize the issue and ask for confirmation before deleting the branch and republishing.

"This will delete branch "Foo" on your mason-registry fork. Proceed? [Y/n]" response from user. This would make it easier to re-publish if a mistake was made in the initial commit published. Currently, re-publishing gives this error:


> mason publish
Updating mason-registry
To github.com:ben-albrecht/mason-registry
 ! [rejected]        Foo -> Foo (non-fast-forward)
error: failed to push some refs to 'git@github.com:oplambeck/mason-registry'
hint: Updates were rejected because the tip of your current branch is behind
hint: its remote counterpart. Integrate the remote changes (e.g.
hint: 'git pull ...') before pushing again.
hint: See the 'Note about fast-forwards' in 'git push --help' for details.
--------------------------------------------------------------------
Go to the above link to open up a Pull Request to the mason-registry
ankushbhardwxj commented 4 years ago

Handle case where the user tries to republish without deleting their previous branch from the fork. Ideally recognize the issue and ask for confirmation before deleting the branch and republishing.

@ben-albrecht Could you provide some set of commands to reproduce this ?

ben-albrecht commented 4 years ago

I think this can be reproduced by trying to publish a package twice, e.g.

mason publish
...
mason publish

Let me know if that doesn't help, and I'll try to get a more precise reproducer.