Skip to content

Commit

Permalink
dos2unix, i.e. normalize line endings, using gitattributes
Browse files Browse the repository at this point in the history
Git core is binary-safe.  However, multiple committers are understandably
not using line-ending agnostic environments like KDE.  (Personally,
my editor works that way, but I could still do without the ugly ^Ms in
git-diff).

.gitattributes recommended by Github [1]

Conversion commands suggested by updated Stack Overflow answer [2]

    $ rm .git/index     # Remove the index to force git to
    $ git reset         # re-scan the working directory
    $ git status        # Show files that will be normalized
    $ git add -u

[1] https://help.github.com/articles/dealing-with-line-endings#platform-all
[2] http://stackoverflow.com/a/4683783/799204
  • Loading branch information
sourcejedi committed Sep 9, 2012
1 parent 7661301 commit d13c4c0
Show file tree
Hide file tree
Showing 26 changed files with 6,089 additions and 6,062 deletions.
27 changes: 27 additions & 0 deletions .gitattributes
Original file line number Diff line number Diff line change
@@ -1 +1,28 @@
# For anything we don't specify, git will guess whether to normalize
# line endings. You already rely on it guessing when it shows diffs
# (and you look at diffs when you commit, right?)
* text=auto

# diff will parse PHP instead of C, and tell us which function we're in
*.php diff=php

# These should always be text files
*.php text
*.css text
*.js text
*.htaccess text
*.html text
*.markdown text
*.txt text

# Avoid unreadable diffs for generated text files
# (e.g. minified JS)
*.min.* binary

# These should always be binaries
*.ico binary
*.gif binary
*.png binary
*.jpg binary
*.ttf binary
*.psd binary
12 changes: 6 additions & 6 deletions bonfire/application/core/MY_Loader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader {}
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Loader class */
require APPPATH."third_party/MX/Loader.php";

class MY_Loader extends MX_Loader {}
10 changes: 5 additions & 5 deletions bonfire/application/core/MY_Router.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Router class */
require APPPATH."third_party/MX/Router.php";

<?php (defined('BASEPATH')) OR exit('No direct script access allowed');

/* load the MX_Router class */
require APPPATH."third_party/MX/Router.php";

class MY_Router extends MX_Router {}
Loading

0 comments on commit d13c4c0

Please sign in to comment.