Freeze break request: fix for branching from packages with multiple heads

Patrick Uiterwijk puiterwijk at redhat.com
Wed Feb 25 11:01:00 UTC 2015


And it looks like git send-email doesn't attach the patch if you give it an introduction message, so here it is.
Any +1s?


commit 0c9d4490939f5c732e0e6ecbdeec0bf8da52497a
Author: Patrick Uiterwijk <puiterwijk at redhat.com>
Date:   Wed Feb 25 10:50:18 2015 +0000

    Just always take the first commit returned on the master branch
    
    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 at redhat.com>

diff --git a/roles/distgit/files/mkbranch b/roles/distgit/files/mkbranch
index 1230571..9873202 100644
--- a/roles/distgit/files/mkbranch
+++ b/roles/distgit/files/mkbranch
@@ -147,7 +147,7 @@ for NAME in $PACKAGES ; do
     #}
     [ $VERBOSE -gt 0 ] && echo "Creating $NAME $BRANCH from $NAME ..."
     $(pushd $GITROOT/$NAME.git >/dev/null && \
-    git branch --no-track $BRANCH `git rev-list --max-parents=0 master` && \
+    git branch --no-track $BRANCH `git rev-list --max-parents=0 master | head -1` && \
     popd >/dev/null) || {
     echo "ERROR: Branch $NAME $BRANCH could not be created" >&2
         popd >/dev/null
[puiterwijk at lockbox01 files]$ 



With kind regards,
Patrick Uiterwijk
Fedora Infra

----- Original Message -----
> This makes sure that only a single commit is passed onto git branch.
> Sometimes, after a force push, a repo has multiple top-level commits for
> master.
> 
> _______________________________________________
> infrastructure mailing list
> infrastructure at lists.fedoraproject.org
> https://admin.fedoraproject.org/mailman/listinfo/infrastructure


More information about the infrastructure mailing list