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>
yarikoptic
left a comment
There was a problem hiding this comment.
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_riacommand usedGitRepo(repo_path, create=True)constructor to initialise bare repositories locally, also whenexisting=reconfigurewas requested. But for existing repositories,GitRepodoes not executegit init, it just returns aGitRepoinstance, soreconfigurewas not actually handled. This commit introduces an aditional check, to make sure thatgit initis called when reconfiguring.Partially addresses datalad/datalad-ria#43 (
--existing reconfigure --sharednot working). However, another problem remains: although we now do handle the reconfiguration, callinggit annex init --bare --sharedsets 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.