CiBoT wants me to do a GIT rebase, but how?

CiBoT wants me to do a GIT rebase, but how?

by Gordon Bateson -
Number of replies: 2
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Hello Moodle programmers,

I am trying to submit a patch for Moodle core on the Moodle tracker, and CiBoT has told me to "rebase against current master" and I don't know what to do. Can you help?

The issue I have created is MDL-49758.
CiBoT has given me the following message:

Error: The MDL-49758-quiz-locallib-completion_info branch at
https://github.com/gbateson/moodle is very old (>60 days ago).
Please rebase against current master.

It is a mysterious message for me, because from my point of view that branch is not old, it is new - just three days old in fact. I created it from the Moodle master branch which I maintain on my repository at github.com. This repository was setup, and is regularly updated, according to the Moodle Docs instructions in "GIT for developers". i.e.

## SETUP
##
git clone git://github.com/gbateson/moodle.git MOODLEDIR
cd MOODLEDIR
git remote add upstream git://git.moodle.org/moodle.git

## UPDATE
##
cd MOODLEDIR
git fetch upstream
for BRANCH in MOODLE_{19..29}_STABLE master; do
 git push origin refs/remotes/upstream/$BRANCH:$BRANCH
done

The patch was created as follows:

## PATCH
##
git clone git://github.com/gbateson/moodle.git PATCHDIR
cd PATCHDIR
git checkout -b PATCHBRANCH  origin/master
git branch
vi mod/quiz/locallib.php
git commit -a -m "MDL-49758 include lib/completionlib.php in mod/quiz/locallib.php"
git push PATCHBRANCH 

If I go into the PATCHDIR and try "git rebase master PATCHBRANCH" the git tells me "Patch failed at 0001 MDL-33606 course" and invites me to amend or skip this problem. If I skip 0001, then git stops for 0002. It looks to me as though git wants me to manually approve every commit there has ever been on Moodle (?!) but probably, I have misunderstood what is going on.

If anyone can see how I should rebase, I would be very glad to hear from them.

regards
Gordon

Average of ratings: -
In reply to Gordon Bateson

Re: CiBoT wants me to do a GIT rebase, but how?

by Tim Hunt -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

We can check and see that your master branch on github is up-to-date: https://github.com/gbateson/moodle

But, if we go and look at your branch for the bug: https://github.com/gbateson/moodle/tree/MDL-49758-quiz-locallib-completion_info se can see what CiBoT is talking about: This branch is 1097 commits ahead, 1999 commits behind moodle:master and, if you switch tabs to https://github.com/gbateson/moodle/commits/MDL-49758-quiz-locallib-completion_info you can see that your branch is actually based on weekly release 2.8.5+ stronk7authored10 days ago

I don't see why. The commands you pasted into your post from the dev docs looks like they should work, but they do look a bit weird. I certainly would not do it that way (but with git there is always more than one way you could do it).

Regarding back-porting, see http://tjhunt.blogspot.co.uk/2012/03/fixing-bug-in-moodle-core-mechanics.html

Average of ratings: Useful (1)
In reply to Tim Hunt

Re: CiBoT wants me to do a GIT rebase, but how?

by Gordon Bateson -
Picture of Core developers Picture of Peer reviewers Picture of Plugin developers

Thanks Tim,
that's fantastically useful. I'll take a read and report back.

You have helped me understand that the key issue is why "this branch is ... 1999 commits behind master", and why that branch is based on a weekly release and not, as I had presumed, on the master branch.

Hmm, just having written that sentence, makes me think I might have checked out a STABLE branch, and then told CiBoT it was the master branch. I'll need to check that first.

regards
Gordon