Skip to content

Commit

Permalink
.gitconfig: Explicitly disable indent-with-non-tab
Browse files Browse the repository at this point in the history
Don’t use `indent-with-non-tab`. This config flag is PERNICIOUS. If turned on, Git won’t tell you that you indented your code incorrectly. Instead, when it is pushing your changes to your remote repo, Git will silently convert any consecutive 8-space strings it sees into tab characters. This can be highly undesirable, especially if you collaborate with a team that expects the code to be indented using spaces instead of tabs.

At the very least, the comment above this line should very clearly explain the fact that `indent-with-non-tab` does more than advertised in the `git-config man page (https://www.kernel.org/pub/software/scm/git/docs/git-config.html).

Closes #351.
  • Loading branch information
luveenw authored and mathiasbynens committed Mar 5, 2014
1 parent d4cfb80 commit c62ff16
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions .gitconfig
Original file line number Diff line number Diff line change
Expand Up @@ -42,12 +42,11 @@
# Use custom `.gitignore` and `.gitattributes`
excludesfile = ~/.gitignore
attributesfile = ~/.gitattributes
# Treat spaces before tabs, lines that are indented with 8 or more spaces, and
# all kinds of trailing whitespace as an error.
# Treat spaces before tabs and all kinds of trailing whitespace as an error.
# [default] trailing-space: looks for spaces at the end of a line
# [default] space-before-tab: looks for spaces before tabs at the beginning of
# a line
whitespace = space-before-tab,indent-with-non-tab,trailing-space
whitespace = space-before-tab,-indent-with-non-tab,trailing-space
# Make `git rebase` safer on OS X
# More info: <http://www.git-tower.com/blog/make-git-rebase-safe-on-osx/>
trustctime = false
Expand Down

1 comment on commit c62ff16

@samskiter
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nice! I came here to report this 👍

Please sign in to comment.