-
Notifications
You must be signed in to change notification settings - Fork 111
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
Make sure to re-initialise git repo #7095
Conversation
The `create_sibling_ria` command used `GitRepo(repo_path, create=True)` constructor to initialise bare repositories locally, also when `existing=reconfigure` was requested. But if the repository already exists, `GitRepo` does not execute `git init`, it just returns a `GitRepo` instance, so `reconfigure` was not actually handled. This commit introduces an aditional check, to make sure that `reconfigure` calls `git init`. Partially addresses #6967 (`--existing reconfigure --shared` not working). However, another problem remains: although we now do handle the reconfiguration, calling `git annex init --bare --shared` sets the config variable `core.sharedRepository` (which would presumably affect future commits), but does not change the permissions for the already existing files in the repo. Co-authored-by: Benjamin Poldrack <benjaminpoldrack@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
don't know much about ria
so can't judge if git init
is safe to do upon reconfigure -- left just a single recommendation
Co-authored-by: Yaroslav Halchenko <debian@onerussian.com>
FTR: "safe" doesn't even matter. Re-init is the explicitly described behavior of |
Codecov ReportBase: 76.01% // Head: 75.62% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## maint datalad/datalad#7095 +/- ##
==========================================
- Coverage 76.01% 75.62% -0.40%
==========================================
Files 355 355
Lines 59101 59320 +219
Branches 6318 6322 +4
==========================================
- Hits 44925 44859 -66
- Misses 14162 14446 +284
- Partials 14 15 +1
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
Failure in datalad-deprecated happens on Merging. |
PR released in |
The
create_sibling_ria
command usedGitRepo(repo_path, create=True)
constructor to initialise bare repositories locally, also whenexisting=reconfigure
was requested. But for existing repositories,GitRepo
does not executegit init
, it just returns aGitRepo
instance, soreconfigure
was not actually handled. This commit introduces an aditional check, to make sure thatgit init
is called when reconfiguring.Partially addresses datalad/datalad-ria#43 (
--existing reconfigure --shared
not working). However, another problem remains: although we now do handle the reconfiguration, callinggit annex init --bare --shared
sets the config variablecore.sharedRepository
(which would presumably affect future commits), but does not change the permissions for the already existing files in the bare git repo.