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.
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@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@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@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@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/infrastructure
On Wed, Feb 25, 2015 at 06:01:00AM -0500, Patrick Uiterwijk wrote:
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@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@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
+1 for me if it does not return any error in stg.
Pierre
With this change, the entire script ran in staging correctly.
With kind regards, Patrick Uiterwijk Fedora Infra
----- Original Message -----
On Wed, Feb 25, 2015 at 06:01:00AM -0500, Patrick Uiterwijk wrote:
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@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@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
+1 for me if it does not return any error in stg.
Pierre _______________________________________________ infrastructure mailing list infrastructure@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/infrastructure
+1 I guess as we should handle this case...
Looks like this was actually a merge commit. The repo was created and the user had a existing git repo they merged into it, so thats why master has multiple heads (at least this is my theory/understanding)
kevin
Thanks. And I think you're correct with that analysis yeah.
With kind regards, Patrick Uiterwijk Fedora Infra
----- Original Message -----
+1 I guess as we should handle this case...
Looks like this was actually a merge commit. The repo was created and the user had a existing git repo they merged into it, so thats why master has multiple heads (at least this is my theory/understanding)
kevin
infrastructure mailing list infrastructure@lists.fedoraproject.org https://admin.fedoraproject.org/mailman/listinfo/infrastructure
infrastructure@lists.fedoraproject.org