-
Notifications
You must be signed in to change notification settings - Fork 21
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
Add support for creating a registry repo with an initial branch other than master. #58
Add support for creating a registry repo with an initial branch other than master. #58
Conversation
Codecov Report
@@ Coverage Diff @@
## master #58 +/- ##
=======================================
Coverage 96.57% 96.57%
=======================================
Files 1 1
Lines 263 263
=======================================
Hits 254 254
Misses 9 9
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. |
Thanks for looking into this. If possible I would prefer not to have have a function argument for this. The best way to obtain the default branch from the remote repository should be to clone it and if it doesn't exist, in which case you should use Versions of git might be an issue. The best solution to guarantee a sufficiently fresh git is #38, but the MacOS test failures are a blocker. I should probably rebase that PR and see if it fares better today, but I haven't heard about any progress in that area. The way to go about testing this is to create a new |
Actually having a
|
Hi Gunnar. I had a second to look at this again. Quick question: If
|
The |
When an origin repo for a registry is created, it may use a branch name other than
master
(e.g., GitHub now defaults tomain
). When LocalRegistry creates a registry (e.g. in~/.julia/registries/...
), it may use an inconsistent initial branch name, leading to errors on the first attempt to push. This PR adds an option for the initial branch name.I tested this by creating a local repo as my "origin" (
git init --initial-branch=main --bare .
) and then using LocalRegistry to create a new registry usingmain
as the initial branch andfile://...
as the URL (create_registry("InitBranchTest5", "file:///Users/tucker/Dev/loreg/", branch = "main", push = true)
). This pushed correctly and appears to have done the right thing.It still needs CI testing, so this is a draft PR so folks can provide feedback.
Possible improvements:
--initial-branch
option will only work on git version 2.28.0, according to the same Stack Exchange. Perhaps this would be done aftergit init
withgit checkout -b $branch
.git config --global init.defaultBranch
is suggested by this Stack Exchange, but it doesn't appear to work on my machine, so I didn't add a feature for this.)