setup_git_package did the same check as pkgdb_sync did [1].
Also, if gitolite already came by, it will have created an update hook, which blocks us from pushing the initial commit (since gitolite has no idea who we are).
So in that case, we will just remove the update hook: gitolite will recreate it when it comes by the repo with genacls.sh.
The change to mkdir -p is just synto make it not print an error in case the directory already existed.
[1]: https://lists.fedoraproject.org/pipermail/infrastructure/2015-February/015600.html
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Some repos have multiple first master commits due to force-pushes.
Without this, that would crash upon branching for those packages.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
gitolite compile creates empty git repos during compile for repos in its acl that don't exist.
Since this is automagically run by fedmsg, it triggers before scm-admins can run pkgdb_sync_git_branches.py
Because of this, pkgdb_sync_git_branches sees a git repo, thus does not execute setup_git_package.
But since setup_git_package creates master, and pkgdb_sync_git_branches later on tries to create new branches from master....
Aka, this broke process-git-requests.
Signed-off-by: Patrick Uiterwijk <puiterwijk@redhat.com>
Having it split out was causing trouble, because distgit depends on it,
but it depends on the /srv/git folder being created, which is created
in the distgit role...
Nothing else uses this though, so merging it is the easy way out.
In the process of automating the git branch creation based on fedmsg
message we can no longer rely on passing a -s/--source branch argument
to the mkbranch script.
As decided in https://fedorahosted.org/rel-eng/ticket/5931 the branches
will be created with the first commit of the master branch.
This commit thus drops the use of -s/--source and SRC_BRANCH in favor of
creating the branch with the first commit of the master branch:
git branch --no-track $BRANCH `git rev-list --max-parents=0 master`
With this change, the upload CGI script will start preferring uploads
hashed as sha512, but still accept md5 as a fallback.
The message emitted on fedmsg is unchanged, because doing so would break
it. We're going to fix that later though.
https://fedorahosted.org/rel-eng/ticket/5846
... as much as possible.
The point of this patch is to make it easier to move away from md5 in a
subsequent patch, without having one monster change which would be
impossible to review.
Some md5 stuff remains hardcoded, because changing it at this point
would break compatibility.
https://fedorahosted.org/rel-eng/ticket/5846
This will make it easier to move away from md5 for the source tarballs.
It shouldn't cause any problem anyway, as Fedora runs this on EL 6 in
production, and EL 7 in staging.
We already use the update hook for gitolite.
This introduces a new update hook, which merely chains the gitolite one,
and a new one to block pushes to badly named branches.
The new hook was written originally by Till Maas.
https://fedorahosted.org/rel-eng/ticket/4071