Git pull problem

Git pull problem

by Rick Danielson -
Number of replies: 24

I recently upgraded my installation from 1.9 to 2.4 using git as per the instructions on the git install page.  The installation is a new one - not an upgrade.  Today I attempted my first git pull from inside moodle in order to upgrade the code base.  The procedure gave the following results:

git pull
remote: Counting objects: 10954, done.
remote: Compressing objects: 100% (1770/1770), done.
remote: Total 7302 (delta 5425), reused 7073 (delta 5266)
Receiving objects: 100% (7302/7302), 2.66 MiB | 1.33 MiB/s, done.
Resolving deltas: 100% (5425/5425), completed with 1081 local objects.
From git://git.moodle.org/moodle
   d298661..e038687  MOODLE_24_STABLE -> origin/MOODLE_24_STABLE
   3d1141b..572729a  MOODLE_19_STABLE -> origin/MOODLE_19_STABLE
   6c33f39..c9b28fc  MOODLE_22_STABLE -> origin/MOODLE_22_STABLE
   dd8e2dd..f0d8c53  MOODLE_23_STABLE -> origin/MOODLE_23_STABLE
 * [new branch]      MOODLE_25_STABLE -> origin/MOODLE_25_STABLE
   3a8c438..e2637d1  master     -> origin/master
 * [new tag]         v2.2.10    -> v2.2.10
 * [new tag]         v2.3.7     -> v2.3.7
 * [new tag]         v2.4.4     -> v2.4.4
 * [new tag]         v2.5.0     -> v2.5.0
From git://git.moodle.org/moodle
 * [new tag]         v2.5.0-rc1 -> v2.5.0-rc1
Updating d298661..e038687
error: Your local changes to the following files would be overwritten by merge:

...lots of files

    mod/scorm/report/interactions/lang/en/scormreport_interactions.php
    mod/scor
Aborting

Can anyone advise what I should do now in order to update the code?  Thanks.

 

 

Average of ratings: Useful (1)
In reply to Rick Danielson

Re: Git pull problem

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

According to this you have changed some files locally, that you haven't told git about.

The best things to try now would be:

git status

This will tell you what files have been changed

git diff

This will tell you what changes have been made

If you have not deliberately made any changes to your local files, then take a backup of the moodle code folder (just be be completely sure), and then you can do the following:

git reset --hard HEAD

(this will reset your files back to the last version that git knows about)

You may also want to do:

git clean -nd

This will list any files that git doesn't know about at all in the code folder, and, if you are happy for those files to be removed:

git clean -fd

Which will delete any files that are not supposed to be there (note: your config.php should be left behind by this, as git is specifically told to ignore this file in all operations, but just in case something goes wrong, you should be able to restore it from the backup you have already taken).

At which point a 'git pull' should work fine.

Average of ratings: Useful (4)
In reply to Davo Smith

Re: Git pull problem

by Rick Danielson -

Thanks Dave,
I just made a new install, dumping all my users, courses and so forth.  Therefore, there should be no changes that would require all the steps in your post.  However, I did restore three courses (sans users) and maybe that caused some problems.  However, git is so much easier to use than cvs, that I shouldn't have to make all these changes.  According to the instructions, all I really should have to do is issue a git pull command and everything should happen...as was the case with cvs. smile
Rick

In reply to Rick Danielson

Re: Git pull problem

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

The issues with Git are unrelated to whether or not you have any courses, users, etc. configured on your site.

Everything you do in the Moodle front end (adding courses, users, activities, etc.) is stored either in the database or in the Moodle data folder. Nothing you do in the front end (apart from automatic updates of addons in the latest version of Moodle) will affect the Moodle code.

Git deals only with the Moodle code (not the database, not the Moodle data folder), so if Git is complaining, then it means that there have been some changes to the code, which git has not been informed about (for example, if you downloaded a more recent version of Moodle and manually unzipped it into the Moodle code folder, then that would cause git to get confused). My instructions will allow you to discover exactly what has changed in the Moodle code folder and, if necessary, revert the code back to a version that is understood by Git.

In reply to Rick Danielson

Re: Git pull problem

by Adam Morris -

Probably just do

git stash

and then git pull again. If that doesn't work, post the errors here.

Average of ratings: Useful (2)
In reply to Davo Smith

Re: Git pull problem

by Adam Morris -

Don't forget that 

git stash

Takes care of the "didn't deliberately edit any files" problem.

Average of ratings: Useful (2)
In reply to Adam Morris

Re: Git pull problem

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Thanks for the 'git stash' reminder Adam - I use it all the time as a temporary measure when I need to change something in a repo when I'm in the middle of writing code, but hadn't thought of using it to recover when there's unwanted changes around.

In reply to Davo Smith

Re: Git pull problem

by Rick Danielson -

Hello Davo,

Prior to trying the git stash command, I did a git status as per your suggestion.  Here is the output from the first few lines:

 

# On branch MOODLE_24_STABLE
# Your branch is behind 'origin/MOODLE_24_STABLE' by 176 commits, and can be fast-forwarded.
#
# Changes not staged for commit:
#   (use "git add <file>..." to update what will be committed)
#   (use "git checkout -- <file>..." to discard changes in working directory)
#
#       modified:   .gitignore

Here is the output of the last few lines of the git status command:

#    modified:   webservice/xmlrpc/locallib.php
#    modified:   webservice/xmlrpc/server.php
#    modified:   webservice/xmlrpc/simpleserver.php
#    modified:   webservice/xmlrpc/version.php
#
no changes added to commit (use "git add" and/or "git commit -a")

It appears that every file in the git repository has not yet been added to the repository and they are all listed as not having yet been committed.  Therefore, from my (woefully inadequate) knowledge of git, since nothing has been committed, nothing can be updated.  Maybe I should just run a git add -a and then run a git commit -a from within the moodle directory and then  run the git pull.  Does that sound reasonable?

Rick

In reply to Rick Danielson

Re: Git pull problem

by Adam Morris -

I reckon that you did something wrong from the start. It looks like it's listing all the moodle files. 

And, anyway, when you clone it, you'll get what you want, which is the latest code.

In reply to Rick Danielson

Re: Git pull problem

by Rex Lorenzo -

Just a note, you will need to first upgrade your Moodle 1.9 to 2.2 and then upgrade that 2.2 to 2.4.

Please see:

http://docs.moodle.org/22/en/Upgrading_to_Moodle_2.2

And

http://docs.moodle.org/24/en/Upgrading#Check_the_requirements

In reply to Rex Lorenzo

Re: Git pull problem

by Davo Smith -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Rex - from the output above, you can see that Rick was already on MOODLE_24_STABLE when he tried to do the git pull (the code d298661..e038687 at the bottom of the output matches the commits updated on the 2.4 branch).

However, you are right, in general, that it is important to go via 2.2 when upgrading from 1.9.

In reply to Rex Lorenzo

Re: Git pull problem

by Rick Danielson -

Yes, I know that.  For that reason, I decided to make a fresh install using git.  The system is brand new, with no users.

In reply to Rick Danielson

Re: Git pull problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
I'm no Git expert but my problem is to understand what exactly you did.

You wrote:
>>>> I recently upgraded my installation from 1.9 to 2.4 using git as per the instructions on the git install page. The installation is a new one - not an upgrade.

Clearly the 1.9 installation was done without Git. Then you made a new 2.4 installation using Git. What were the commands you gave? The following set from http://docs.moodle.org/24/en/Git_for_Administrators#Obtaining_the_code_from_Git
$ git clone git://git.moodle.org/moodle.git
$ cd moodle
$ git branch --track MOODLE_24_STABLE origin/MOODLE_24_STABLE
$ git checkout MOODLE_24_STABLE

or was it just
$ git clone -b MOODLE_24_STABLE git://git.moodle.org/moodle.git ?

Can you remember the date?

>>>> Today I attempted my first git pull from inside moodle in order to upgrade the code base. The procedure gave the following results:
>>>> ...

By any chance have you "looked" at those files using a poisened Windows tool like Dreamweaver?
In reply to Visvanath Ratnaweera

Re: Git pull problem

by Rick Danielson -

Thanks for your input.  As you concluded, I abandoned my 1.9 installation (which dates back to about version 1.x in about 2003 or 2004 with upgrades all the way to pre-2000) and went with a brand new git installation of 2.4.  I used the commands from the Git_for_Administrators link, using the four steps in the guide.  Git is clearly intimidating to me, so I followed the steps as religiously as I could.  The date stamp on the files in the moodle directory is April 19th so I must have done the install at that time.  I left the system just sitting until I received the recent notice about upgrading, so that is when I went in with a single git pull command.  It is the output from that command which brought me to the initial post here.

Rick

In reply to Rick Danielson

Re: Git pull problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Hi Rick

Everything you've described in the previous post sounds correct. Still I would exclude the Moodle git repository and the git tool itself as the cause of the problem. It must be in your local system.

As somebody mentioned, do you get this error for _all_ the files in the Moodle source? Then carefully check whether your local git copy went through some transision, like copying from one file system to the other, to a network file system, to a windows file system in a USB drive, etc. and back.

BTW, I don't see the operating system mentioned explicitly. From the git syntax I assume it is some kind of Unix.
Average of ratings: Useful (1)
In reply to Visvanath Ratnaweera

Re: Git pull problem

by Rick Danielson -

Hello Visvanath,

I decided to nuke the install and begin again.  Did that yesterday, following the instructions in the git installation guide:

$ git clone git://git.moodle.org/moodle.git (1)
$ cd moodle
$ git branch -a (2)
$ git branch --track MOODLE_25_STABLE origin/MOODLE_25_STABLE (3)
$ git checkout MOODLE_25_STABLE (4)

After doing that, I did a git pull a couple of times yesterday and git responded that the repository was up to date.  Today, I did another git pull and got the following output (looks like what I was getting before):

git pull
remote: Counting objects: 2313, done.
remote: Compressing objects: 100% (365/365), done.
remote: Total 1218 (delta 903), reused 1129 (delta 835)
Receiving objects: 100% (1218/1218), 230.18 KiB, done.
Resolving deltas: 100% (903/903), completed with 333 local objects.
From git://git.moodle.org/moodle
b222cfb..f65261d MOODLE_25_STABLE -> origin/MOODLE_25_STABLE
c9b28fc..57af11e MOODLE_22_STABLE -> origin/MOODLE_22_STABLE
f0d8c53..7621b70 MOODLE_23_STABLE -> origin/MOODLE_23_STABLE
e038687..bf2bee1 MOODLE_24_STABLE -> origin/MOODLE_24_STABLE
e2637d1..73f560c master -> origin/master
Updating b222cfb..f65261d
error: Your local changes to the following files would be overwritten by merge:
admin/tests/behat/upload_users.feature
admin/tool/customlang/db/upgrade.php
auth/cas/version.php
auth/ldap/version.php
auth/manual/db/upgrade.php
auth/mnet/db/upgrade.php
backup/backup.class.php
blocks/community/db/upgrade.php
blocks/completionstatus/db/upgrade.php
blocks/course_summary/db/upgrade.php
blocks/html/db/upgrade.php
blocks/navigation/db/upgrade.php
blocks/section_links/db/upgrade.php
blocks/selfcompletion/db/upgrade.php
blocks/settings/db/upgrade.php
cohort/tests/behat/add_cohort.feature
cohort/tests/behat/behat_cohort.php
cohort/tests/behat/upload_cohort_users.feature
course/request_form.php
course/resources.php
course/tests/behat/behat_course.php
course/tests/behat/course_controls.feature
course/tests/behat/move_activities.feature
enrol/authorize/db/upgrade.php
enrol/database/db/upgrade.php
enrol/flatfile/db/upgrade.php
enrol/guest/db/upgrade.php
enrol/imsenterprise/db/upgrade.php
enrol/manual/db/upgrade.php
enrol/mnet/db/upgrade.php
enrol/paypal/db/upgrade.php
enrol/self/db/upgrade.php
files/coursefilesedit_form.php
filter/mediaplugin/db/upgrade.php
filter/tex/db/upgrade.php
grade/grading/form/rubric/db/upgrade.php
install/lang/bn/install.php
install/lang/ca_valencia/langconfig.php
install/lang/cy/admin.php
install/lang/cy/error.php
install/lang/cy/install.php
install/lang/en_kids/langconfig.php
install/lang/eu/install.php
install/lang/fr/error.php
install/lang/is/admin.php
install/lang/it/error.php
install/lang/it/install.php
install/lang/ja_kids/langconfig.php
install/lang/ka/admin.php
install/lang/ka/moodle.php
install/lang/kl/langconfig.php
install/lang/ko/install.php
install/lang/lt_uni/moodle.php
install/lang/so/admin.php
install/lang/sr_cr/error.php
install/lang/sr_lt/error.php
install/lang/te/langconfig.php
install/lang/tt/langconfig.php
install/lang/wo/langconfig.php
install/lang/zh_tw/langconfig.php
lang/en/repository.php
lib/db/upgrade.php
lib/editor/tinymce/db/upgrade.php
lib/editor/tinymce/plugins/spellchecker/db/upgrade.php
lib/filelib.php
lib/filestorage/file_storage.php
lib/filestorage/stored_file.php
lib/licenselib.php
lib/tests/behat/behat_general.php
lib/tests/behat/behat_hooks.php
lib/tests/behat/behat_navigation.php
lib/tests/behat/behat_permissions.php
lib/yuilib/3.9.1/build/io-xdr/io.swf
lib/yuilib/3.9.1/build/uploader-deprecated/assets/uploader.swf
lib/yuilib/3.9.1/build/uploader/assets/flashuploader.swf
message/output/email/db/upgrade.php
message/output/jabber/db/upgrade.php
message/output/popup/db/upgrade.php
mod/assign/db/upgrade.php
mod/assign/feedback/comments/db/upgrade.php
mod/assign/feedback/file/db/upgrade.php
mod/assign/submission/comments/db/upgrade.php
mod/assign/submission/file/db/upgrade.php
mod/assign/submission/onlinetext/db/upgrade.php
mod/assignment/db/upgrade.php
mod/book/db/upgrade.php
mod/chat/db/upgrade.php
mod/choice/db/upgrade.php
mod/data/db/upgrade.php
mod/feedback/db/upgrade.php
mod/folder/db/upgrade.php
mod/folder/edit.php
mod/forum/db/upgrade.php
mod/forum/lib.php
mod/glossary/db/upgrade.php
mod/imscp/db/upgrade.php
mod/label/db/upgrade.php
mod/lesson/db/upgrade.php
mod/lti/db/upgrade.php
mod/page/db/upgrade.php
mod/quiz/db/upgrade.php
mod/quiz/report/overview/db/upgrade.php
mod/quiz/report/overview/report.php
mod/quiz/report/statistics/db/upgrade.php
mod/resource/db/upgrade.php
mod/scorm/datamodels/scorm_12.js.php
mod/scorm/db/upgrade.php
mod/survey/db/upgrade.php
mod/url/db/upgrade.php
mod/wiki/db/upgrade.php
mod/workshop/db/upgrade.php
mod/workshop/form/accumulative/db/upgrade.php
mod/workshop/form/comments/db/upgrade.php
mod/workshop/form/numerrors/db/upgrade.php
mod/workshop/form/rubric/db/upgrade.php
portfolio/googledocs/db/upgrade.php
portfolio/picasa/db/upgrade.php
question/behaviour/manualgraded/db/upgrade.php
question/engine/bank.php
question/type/calculated/db/upgrade.php
question/type/essay/db/upgrade.php
question/type/match/db/upgrade.php
question/
Aborting

My moodle system is running on ubuntu 12.04.

Rick

In reply to Rick Danielson

Re: Git pull problem

by Adam Morris -

Understanding what git does will go a long way. What git pull does is fetch (download) the branches and then does a merge. However, the merge can be destructive, that is, change your local changes and most of the time that is a bad thing. Software that automatically overwrites stuff is probably a bad idea, so git doesn't do so unless you force it to.

The message is telling you that somehow some local changes were made, and so it won't merge (although it did download). If you don't mind losing your local changes, or if somehow this is news or a surprise to you, then you have to manually tell git "okay, I just want to download and merge the latest, nevermind my local changes" Do that by first using:

git stash

Which will get rid of any of the local changes, so the next time you git pull, it'll happen for you as you're expecting.

 

In reply to Adam Morris

Re: Git pull problem

by Rick Danielson -

Thanks Adam,

I read your original advice about git stash, but wanted to see if I could make things work without having to use it.  My understanding of the stash command is that it keeps things "stashed" until you might need them again.   I had hoped that it would not be necessary to stash things away if you didn't do anything to them anyway. That's why I regenerated the system.  Once I got as similar result as before, I ran the git stash command and got the following:

git stash
Saved working directory and index state WIP on MOODLE_25_STABLE: b222cfb Moodle release 2.5
Checking out files: 100% (11713/11713), done.
HEAD is now at b222cfb Moodle release 2.5


Then I ran the git pull and got the following:

git pull
Updating b222cfb..f65261d
Fast-forward
admin/tests/behat/upload_users.feature | 2 +-
admin/tool/customlang/db/upgrade.php | 4 +
auth/cas/db/upgrade.php | 43 ++++
auth/cas/version.php | 2 +-
auth/ldap/db/upgrade.php | 43 ++++
auth/ldap/version.php | 2 +-
auth/manual/db/upgrade.php | 4 +
auth/mnet/db/upgrade.php | 4 +
backup/backup.class.php | 2 +-
blocks/community/db/upgrade.php | 4 +
blocks/completionstatus/db/upgrade.php | 4 +
blocks/course_summary/db/upgrade.php | 4 +
blocks/html/db/upgrade.php | 4 +
blocks/navigation/db/upgrade.php | 4 +
blocks/section_links/db/upgrade.php | 8 +-
blocks/selfcompletion/db/upgrade.php | 4 +
blocks/settings/db/upgrade.php | 4 +
cohort/tests/behat/add_cohort.feature | 2 +-
cohort/tests/behat/behat_cohort.php | 2 +-
cohort/tests/behat/upload_cohort_users.feature | 2 +-
course/request_form.php | 4 +-
course/resources.php | 18 +-
course/tests/behat/behat_course.php | 4 +-
course/tests/behat/course_controls.feature | 11 +-
course/tests/behat/move_activities.feature | 19 --
enrol/authorize/db/upgrade.php | 4 +
enrol/database/db/upgrade.php | 4 +
enrol/flatfile/db/upgrade.php | 4 +
enrol/guest/db/upgrade.php | 4 +
enrol/imsenterprise/db/upgrade.php | 4 +
enrol/manual/db/upgrade.php | 4 +
enrol/mnet/db/upgrade.php | 4 +
enrol/paypal/db/upgrade.php | 4 +
enrol/self/db/upgrade.php | 4 +
files/coursefilesedit_form.php | 1 +
filter/mediaplugin/db/upgrade.php | 4 +
filter/tex/db/upgrade.php | 4 +
grade/grading/form/rubric/db/upgrade.php | 4 +
install/lang/bn/error.php | 48 ++++
install/lang/bn/install.php | 67 ++++++
install/lang/ca_valencia/langconfig.php | 2 +-
install/lang/cy/admin.php | 10 +
install/lang/cy/error.php | 1 +
install/lang/cy/install.php | 24 ++
install/lang/dz/admin.php | 42 ++++
install/lang/dz/error.php | 48 ++++
install/lang/dz/install.php | 75 +++++++
install/lang/dz/langconfig.php | 34 +++
install/lang/dz/moodle.php | 36 +++
install/lang/en_kids/langconfig.php | 1 +
install/lang/eu/install.php | 4 +-
install/lang/fa/error.php | 33 +++
install/lang/fj/admin.php | 35 +++
install/lang/fj/moodle.php | 36 +++
install/lang/fr/error.php | 4 +
install/lang/ga/moodle.php | 35 +++
install/lang/gd/moodle.php | 33 +++
install/lang/ha/langconfig.php | 33 +++
install/lang/is/admin.php | 1 +
install/lang/it/error.php | 1 +
install/lang/it/install.php | 6 +-
install/lang/ja_kids/langconfig.php | 1 +
install/lang/ka/admin.php | 1 +
install/lang/ka/moodle.php | 3 +
install/lang/kl/langconfig.php | 1 +
install/lang/ko/install.php | 1 +
install/lang/lt_uni/moodle.php | 1 +
install/lang/my/langconfig.php | 33 +++
install/lang/so/admin.php | 1 +
install/lang/sr_cr/error.php | 2 +
install/lang/sr_lt/error.php | 2 +
install/lang/te/error.php | 38 ++++
install/lang/te/install.php | 41 ++++
install/lang/te/langconfig.php | 1 +
install/lang/tg/admin.php | 44 ++++
install/lang/tt/langconfig.php | 1 +
install/lang/uk/admin.php | 34 +++
install/lang/vi/error.php | 39 ++++
install/lang/wo/langconfig.php | 2 +
install/lang/zh_tw/langconfig.php | 1 +
lang/en/repository.php | 3 +-
lib/db/upgrade.php | 25 +++
lib/editor/tinymce/db/upgrade.php | 4 +
.../tinymce/plugins/spellchecker/db/upgrade.php | 4 +
lib/filelib.php | 120 +++++-----
lib/filestorage/file_storage.php | 65 ++++++
lib/filestorage/stored_file.php | 34 +++
lib/licenselib.php | 4 +-
lib/tests/behat/behat_general.php | 4 +-
lib/tests/behat/behat_hooks.php | 21 +-
lib/tests/behat/behat_navigation.php | 40 +++-
lib/tests/behat/behat_permissions.php | 2 +-
lib/yuilib/3.9.1/build/io-xdr/io.swf | Bin 2247 -> 2258 bytes
.../build/uploader-deprecated/assets/uploader.swf | Bin 6611 -> 6681 bytes
.../3.9.1/build/uploader/assets/flashuploader.swf | Bin 5080 -> 5150 bytes
message/output/email/db/upgrade.php | 4 +
message/output/jabber/db/upgrade.php | 4 +
message/output/popup/db/upgrade.php | 4 +
mod/assign/db/upgrade.php | 4 +
mod/assign/feedback/comments/db/upgrade.php | 4 +
mod/assign/feedback/file/db/upgrade.php | 4 +
mod/assign/submission/comments/db/upgrade.php | 4 +
mod/assign/submission/file/db/upgrade.php | 4 +
mod/assign/submission/onlinetext/db/upgrade.php | 4 +
mod/assignment/db/upgrade.php | 4 +
mod/book/db/upgrade.php | 4 +
mod/chat/db/upgrade.php | 4 +
mod/choice/db/upgrade.php | 4 +
mod/data/db/upgrade.php | 4 +
mod/feedback/db/upgrade.php | 4 +
mod/folder/db/upgrade.php | 4 +
mod/folder/edit.php | 5 +-
mod/forum/db/upgrade.php | 7 +-
mod/forum/lib.php | 2 +-
mod/glossary/db/upgrade.php | 4 +
mod/imscp/db/upgrade.php | 4 +
mod/label/db/upgrade.php | 4 +
mod/lesson/db/upgrade.php | 4 +
mod/lti/db/upgrade.php | 4 +
mod/page/db/upgrade.php | 4 +
mod/quiz/db/upgrade.php | 4 +
mod/quiz/report/overview/db/upgrade.php | 4 +
mod/quiz/report/overview/report.php | 13 +-
mod/quiz/report/statistics/db/upgrade.php | 4 +
mod/resource/db/upgrade.php | 4 +
mod/scorm/datamodels/scorm_12.js.php | 2 +-
mod/scorm/db/upgrade.php | 4 +
mod/survey/db/upgrade.php | 4 +
mod/url/db/upgrade.php | 4 +
mod/wiki/db/upgrade.php | 4 +
mod/workshop/db/upgrade.php | 4 +
mod/workshop/form/accumulative/db/upgrade.php | 4 +
mod/workshop/form/comments/db/upgrade.php | 4 +
mod/workshop/form/numerrors/db/upgrade.php | 4 +
mod/workshop/form/rubric/db/upgrade.php | 4 +
portfolio/googledocs/db/upgrade.php | 4 +
portfolio/picasa/db/upgrade.php | 4 +
question/behaviour/manualgraded/db/upgrade.php | 4 +
question/engine/bank.php | 5 +-
question/type/calculated/db/upgrade.php | 4 +
question/type/essay/db/upgrade.php | 4 +
question/type/match/db/upgrade.php | 4 +
question/type/multianswer/db/upgrade.php | 4 +
question/type/multichoice/db/upgrade.php | 4 +
question/type/numerical/db/upgrade.php | 4 +
question/type/questionbase.php | 18 ++
question/type/shortanswer/db/upgrade.php | 4 +
repository/draftfiles_ajax.php | 127 +++++------
repository/draftfiles_manager.php | 19 +-
repository/dropbox/db/upgrade.php | 4 +
repository/filepicker.js | 14 +-
repository/googledocs/db/upgrade.php | 4 +
repository/lib.php | 112 ++++++++++
repository/manage_instances.php | 6 +-
repository/picasa/db/upgrade.php | 4 +
repository/tests/repository_test.php | 229 +++++++++++++++++++-
repository/upload/lib.php | 15 +-
theme/afterburner/db/upgrade.php | 4 +
theme/afterburner/style/afterburner_styles.css | 13 +-
theme/bootstrapbase/config.php | 55 +++--
theme/bootstrapbase/layout/embedded.php | 23 ++
theme/formal_white/db/upgrade.php | 4 +
theme/formal_white/style/block.css | 5 +-
version.php | 4 +-
webservice/lib.php | 15 +-
165 files changed, 2045 insertions(+), 279 deletions(-)
create mode 100644 auth/cas/db/upgrade.php
create mode 100644 auth/ldap/db/upgrade.php
create mode 100644 install/lang/bn/error.php
create mode 100644 install/lang/dz/admin.php
create mode 100644 install/lang/dz/error.php
create mode 100644 install/lang/dz/install.php
create mode 100644 install/lang/dz/langconfig.php
create mode 100644 install/lang/dz/moodle.php
create mode 100644 install/lang/fa/error.php
create mode 100644 install/lang/fj/admin.php
create mode 100644 install/lang/fj/moodle.php
create mode 100644 install/lang/ga/moodle.php
create mode 100644 install/lang/gd/moodle.php
create mode 100644 install/lang/ha/langconfig.php
create mode 100644 install/lang/my/langconfig.php
create mode 100644 install/lang/te/error.php
create mode 100644 install/lang/te/install.php
create mode 100644 install/lang/tg/admin.php
create mode 100644 install/lang/uk/admin.php
create mode 100644 install/lang/vi/error.php
create mode 100644 theme/bootstrapbase/layout/embedded.php

A second git pull got a "Already up-to-date" message.

It seems like there were quite a few file changes in one day's time, especially when I didn't do anything with the system.  When I did the second install, I restored three courses which had been backed up in the original 2.4 version, but the git pull command did not find any system changes on the day I did the first git pull.   The changes all seemed to come overnight.

Things seem to be working now, but how do I interpret a git pull error which might arise if I check the system tomorrow and it doesn't compare?  Do I run another stash and then another git pull?  It doesn't seem right to ignore file system changes.

Over the past week I've viewed about 20 of the 40 or so drupalize-me video tutorials on git.  I'll keep on studying, but right now I don't seem to "git" it. "-)

Rick

In reply to Rick Danielson

Re: Git pull problem

by Adam Morris -

Restoring courses on moodle doesn't do anything to the source code, just the database. Git just works on the files, not the database.

You claim that "you didn't change anything" on the server when you got the issue with the git pull command. In fact, what git is actually telling you, is that something did change. smile

You're right about git stash being used to restore things if you need later on. It's like undo in that way, and the stash is git's internal info, sort of like the clipboard.

In reply to Rick Danielson

Re: Git pull problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
OK, that is a clean try. The effect could only mean that for Git all the files in your local moodle have been changed!

If you haven't done anything purposely, something is happening in your system. That is where my initial statement comes in: "As somebody mentioned, do you get this error for _all_ the files in the Moodle source? Then carefully check whether your local git copy went through some transision, like copying from one file system to the other, to a network file system, to a windows file system in a USB drive, etc. and back."

Go through it again.

We need to find out the file system of the Moodle directory. What is the parent directory of your moodle directory? Let's call it /the/parent, then run the following command and paste the output here:
$ df -T /the/parent


In reply to Visvanath Ratnaweera

Re: Git pull problem

by Rick Danielson -

Thanks Visvanath,

Here is the result of the df -T command:

df -T /var/www
Filesystem Type 1K-blocks Used Available Use% Mounted on
/dev/sda1 ext4 233445296 66949912 154637004 31% /

As I reported in my post in response to Adam's advice to use git stash and then git pull, there were 165 files changed overnight.  My system is running on ubuntu 12.04 and all of the installation commands were run directly from the server.    I did restore the three courses but the git pull command after that did not find any moodle system file changes.  It's possible that I did run some system configuration changes after installing the three courses, but I don't think so.  At any rate, the changes should be seen in the database - not the moodle file system.

Rick

In reply to Rick Danielson

Re: Git pull problem

by Visvanath Ratnaweera -
Picture of Particularly helpful Moodlers Picture of Translators
Big mystery. The fact is that hundreds of files get changed overnight!

I was expecting a FAT file system breaking the file permissions. Since you have ext4 that is not the case.

It is important to note that, no configuration change through the web interface change any files in the Moodle code, as you have already noted. Therefore web server should not have write permissions to any Moodle code. Well, that was how it used to be. The current "one click upgrade" philosophy requires otherwise. I am not going to do that, too adventurous for me.

Now the obvious question, does the web server have write permissions to Moodle code. In Ubuntu, try:
$ sudo -u owner-of-apache touch /path/to/moodle/blabla(I think the owner-of-apache is www-data in Ubuntu.)

If it comes up with an error message the web servrer does not have write permssions in Moodle code.
In reply to Rick Danielson

Re: Git pull problem

by Greg Stager -

Hello Everyone!

I know this post is a month or so old but I thought I would post my experience for the benefit of all who may come in the future. I had the exact same scenario with same abort message.

In my case, I run four instances of Moodle on the same server.

When git does the initial grab of all the files it drops them in a directory called <moodle> which I later rename and place in the /var/www location on the server.

What I didn't realize is that this is a change that must be committed before running a git pull.

Ahhh - after much research and some insight granted by Visvanath's post, I realized that after moving and renaming the directory, if I then do a <git commit -a>, put the message in the file that pops up, then do my <git pull> - all is fine.

In reply to Greg Stager

Re: Git pull problem

by Stuart Mealor -

Interesting post Greg.

Can we confirm that this extra step (after moving / renaming the folder) is definitely required ?

(I have moved and renamed a Git folder and not had to do this git commit -a first - at least that's what my memory is telling me!)

I've started a discussion here: https://moodle.org/mod/forum/discuss.php?d=231046 which is trying to address the poor level of Git documentation we have for the "average Moodle Admin" (non-developer), and if what you have written is correct then I think we need to integrate this too ?

Stu

In reply to Stuart Mealor

Re: Git pull problem

by Andreas Grabs -
Picture of Core developers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers Picture of Translators

Hi,

in most cases there is no need to do some commits after moving or renaming the moodle folder.
If you move your folder to another file system or copy it without keeping the file mode you can run in trouble.
To avoid this file mode problem you can change a config option inside the .git directory (config)

[core]
filemode = false

That is the default on windows systems.

Best regards
Andreas