Problem updating Moodle via Git - files changed?

Problem updating Moodle via Git - files changed?

by Ryan Foster -
Number of replies: 4

Moodle Version:  2.6.3+ (Build: 20140626)
OS:  RHEL 6.4 64-bit
PHP:  5.3.x (RHEL patched)

I recently tried to update a 2.6.x installation to the latest 2.6.x release using Git.  I had installed Moodle 2.6.3+ (Build: 20140626) using the Moodle doc "Git for Administrators", so I referred to that to do the update.  I went to do the "git pull", but I got an error message saying that a file had been changed.  However, when I did a "git diff" to check what was changed, it showed me that a lot of files had been changed, but that there were no changes to the data in the files.  I do not have the exact messages in front of me, so I think, but cannot confirm, that the "git diff" output mentioned the file modes.

I think that after doing the installation, I had read through some of the tips on Moodle Security.  I probably followed the particular section on file permissions.

Would changing file permissions affect the Git update process?  Has anyone else run into this and worked around it?

Average of ratings: -
In reply to Ryan Foster

Re: Problem updating Moodle via Git - files changed?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Yes - changing file permissions counts as a change. If you don't care about that type

git config core.filemode false
In reply to Howard Miller

Re: Problem updating Moodle via Git - files changed?

by Ryan Foster -

I thought that might be the case, and I had eventually found the config setting to ignore filemode changes.  I'll try this as soon as I can.  It might be worth mentioning in the Moodle docs?  It seems a few other people have run into this problem as well.

Thanks for clearing that up!

In reply to Ryan Foster

Re: Problem updating Moodle via Git - files changed?

by Howard Miller -
Picture of Core developers Picture of Documentation writers Picture of Particularly helpful Moodlers Picture of Peer reviewers Picture of Plugin developers

Strictly speaking, changing the permissions *is* a change. If you want your local change recorded then... (from the root of your Moodle install)

git add .
git commit -m 'changing file permissions'

gets you to the same place, and the change is now logged in your git history. If you care. 

In reply to Howard Miller

Re: Problem updating Moodle via Git - files changed?

by Ryan Foster -

When I tried this, it seemed to want me to add all of the untracked files as well.  I have a bunch of untracked files that I didn't care to have tracked just yet, so for the sake of expedience, I just toggled the core.filemode option instead of fussing with ignore lists.  I wouldn't mind fixing this more completely some day, but I didn't want a simple update spiraling into a much longer escapade.

While I understand now that changing permissions counts as a file change where Git is concerned, I still think it might be useful to indicate that somewhere in the documentation.  I'm willing to help with that, if help is needed.