Source for the claim that running git init twice is not harmful: https://www.kernel.org/pub/software/scm/git/docs/git-init.html "Running git init in an existing repository is safe. It will not overwrite things that are already there. The primary reason for rerunning git init is to pick up newly added templates (or to move the repository to another place if --separate-git-dir is given)." With kind regards, Patrick Uiterwijk Fedora Infra ----- Original Message ----- > Any +1s? > Explanation in the commit message. > > Note: we should work on improving the script in general, but that is not > something we should > consider pushing during freeze, so this is a patch that hopefully gets us > through the freeze. > > commit 2d98b6748663747698cd6a0bfc23d05bbc371a01 > Author: Patrick Uiterwijk <puiterwijk@xxxxxxxxxx> > Date: Fri Feb 27 08:44:57 2015 +0000 > > Make pkgdb_sync more resilient by always calling SETUP_PACKAGE if master > does not exist > > This should make it recover in case there are any repos in a weird state > (aka, no master branch). > This could for example happen if the package was created in pkgdb after > pkgdb_sync ran, but before > genacls.pkgdb runs, because then gitolite will see it as a new repo, and > create a totally blank repo. > Especially since pkgdb_sync will abort after the first error, it would > then leave all later created > repos broken as well. > > Calling setup_git_package in a repo without master branch has no ill > effect: > - Running git init on a pre-initialized repo is a no-op (or at least > doesn't destroy current git data) > - Since it doesn't have master, it didn't run the script, so adding the > first commit and hooks etc are > what we want the script to do > > Signed-off-by: Patrick Uiterwijk <puiterwijk@xxxxxxxxxx> > > diff --git a/roles/distgit/templates/pkgdb_sync_git_branches.py > b/roles/distgit/templates/pkgdb_sync_git_branches.py > index ced139b..8643165 100644 > --- a/roles/distgit/templates/pkgdb_sync_git_branches.py > +++ b/roles/distgit/templates/pkgdb_sync_git_branches.py > @@ -187,7 +187,7 @@ def branch_package(pkgname, branches): > > # Create the devel branch if necessary > if not os.path.exists( > - os.path.join(GIT_FOLDER, '%s.git' % pkgname)): > + os.path.join(GIT_FOLDER, '%s.git/refs/heads/master' % pkgname)): > _invoke(SETUP_PACKAGE, [pkgname]) > if 'master' in branches: > branches.remove('master') # SETUP_PACKAGE creates master > _______________________________________________ > infrastructure mailing list > infrastructure@xxxxxxxxxxxxxxxxxxxxxxx > https://admin.fedoraproject.org/mailman/listinfo/infrastructure _______________________________________________ infrastructure mailing list infrastructure@xxxxxxxxxxxxxxxxxxxxxxx https://admin.fedoraproject.org/mailman/listinfo/infrastructure