Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Use local repository as reference for publishing #519

Merged
merged 5 commits into from
Sep 12, 2020

Conversation

mosteo
Copy link
Member

@mosteo mosteo commented Sep 8, 2020

This PR implements the shortcuts described in #512 in this comment to use the local repository as reference for publishing.

We accept:

alr publish [<path> [revision]]

Default revision is HEAD and default path is .. The revision is converted to its commit, so it works for (local) tags and branches too. Then we continue as in #512 with the remote origin URL and the commit.

We check the path to be inside a root that is also a clean git repository.

With this PR I'd say we have a complete "phase 2" (#227), that is, assisted publishing when the remote is ready, so I'd say to write tests for the PRs that are currently open and merge all of them together.

@mosteo mosteo force-pushed the feat/pub-local-repo branch from b9ed092 to 7025c4e Compare September 9, 2020 08:39
@mosteo mosteo marked this pull request as ready for review September 9, 2020 08:49
@mosteo mosteo force-pushed the feat/pub-local-repo branch 6 times, most recently from 0e9111d to 99a1a3a Compare September 10, 2020 15:40
@mosteo mosteo force-pushed the feat/pub-local-repo branch from 99a1a3a to 4449565 Compare September 12, 2020 11:52
Base automatically changed from feat/check-build to merging/publish September 12, 2020 12:06
We still require the remote is ready (in essence, that the local repo is not
ahead of the remote), but now it is simply a matter of issuing `alr publish` or
`alr publish <commit|tag|branch>`, and the corresponding commit will be used.
Adding defaults for <URL> <commit> complicates things somewhat as we use local
paths for testing that would otherwise be rejected, so a few corner cases have
to be explicitly considered now.
@mosteo mosteo force-pushed the feat/pub-local-repo branch from 4449565 to 5b9b593 Compare September 12, 2020 12:07
@mosteo mosteo merged commit 69113c6 into merging/publish Sep 12, 2020
@mosteo mosteo deleted the feat/pub-local-repo branch September 12, 2020 12:21
Fabien-Chouteau pushed a commit that referenced this pull request Sep 23, 2020
* Publish using local repo and revision as reference

We still require the remote is ready (in essence, that the local repo is not
ahead of the remote), but now it is simply a matter of issuing `alr publish` or
`alr publish <commit|tag|branch>`, and the corresponding commit will be used.

* Refactor long function name to more sensible one

* Fix comments due to bad refactoring

* Test for publishing from inside a repo

* Fixes uncovered by testsuite

Adding defaults for <URL> <commit> complicates things somewhat as we use local
paths for testing that would otherwise be rejected, so a few corner cases have
to be explicitly considered now.
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.

2 participants