gjbarnard / moodle-format_topcoll

Collapsed Topics course format for Moodle.
http://docs.moodle.org/en/Collapsed_Topics_course_format
GNU General Public License v3.0
35 stars 60 forks source link

BOM in .gitattributes & local modifications upon checkout #23

Closed pennedav closed 8 years ago

pennedav commented 8 years ago

There's a BOM at the beginning of .gitattributes which causes git to display the following notice when checking out the repository:

behavior, is not a valid attribute name: .gitattributes:1

Additionally, this may be causing issues with COPYING.txt and .travis.yml. Immediately after cloning the repo those two files are listed as modified--the only changes being line endings. This makes it impossible, for example, to checkout the V2.9.2.2 tag without first getting rid of the modified status of COPYING.txt and .travis.yml. (git complains that it would have to overwrite the local modifications.) A git checkout on those files does not seem to fix the issue either.

gjb2048 commented 8 years ago

Humm. Interesting.

gjb2048 commented 8 years ago

Try now.

gjb2048 commented 8 years ago

Do you mean 2.9.2.2 of Moodle? In which case the master branch is for M3.0 and you need the MOODLE_29 branch instead.

pennedav commented 8 years ago

Tested with git 2.6.4 and the behavior persists. Originally I was testing with git 1.9.5.

This is all on Mac OS X. Also tested on Ubuntu 14:

david: ~$ git clone https://github.com/gjb2048/moodle-format_topcoll.git src
Cloning into 'src'...
remote: Counting objects: 4601, done.
remote: Compressing objects: 100% (5/5), done.
remote: Total 4601 (delta 0), reused 0 (delta 0), pack-reused 4596
Receiving objects: 100% (4601/4601), 2.08 MiB | 0 bytes/s, done.
Resolving deltas: 100% (2584/2584), done.
Checking connectivity... done.
david: ~$ cd src
david: src$ git status
On branch master
Your branch is up-to-date with 'origin/master'.

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:   .travis.yml
    modified:   COPYING.txt

no changes added to commit (use "git add" and/or "git commit -a")
david: src$ git checkout -b MOODLE_29 origin/MOODLE_29
error: Your local changes to the following files would be overwritten by checkout:
    .travis.yml
Please, commit your changes or stash them before you can switch branches.
Aborting
david: src$
pennedav commented 8 years ago

The .gitattributes notice is gone now, but the .travis.yml and COPYING.txt modifications are still there.

gjb2048 commented 8 years ago

humm

gjb2048 commented 8 years ago

Ok, please try again. All to do with working on Windows, needing to have only LF's for PHPUnit to work properly with core.autocrlf unset.

gjb2048 commented 8 years ago

Refs: https://docs.moodle.org/dev/Common_unit_test_problems#The_test_file_.22evolution.test.22_should_not_contain_section_named_.22.5Blots_of_content.5D.22

https://help.github.com/articles/dealing-with-line-endings/#refreshing-a-repository-after-changing-line-endings

pennedav commented 8 years ago

Works now! :)