Hi, On 10-Aug-2012, at 3:29 PM, Wido den Hollander <[email protected]> wrote:
> Hi, > > Most of the documentation (/docs) currently uses tabs instead of 4 spaces. > > Do we want to use tabs or 4 spaces here? Good point Wido! I was going to email about this earlier but thought no would care. So, we should follow coding conventions seriously: http://docs.cloudstack.org/CloudStack_Documentation/Design_Documents/Coding_Conventions Use space; 1 tab = 4 spaces, in /docs and throughout the source code. I tried a git filter that replaces all tabs to spaces, the patch was around 8-9MB so dropped the idea. We can define [0] clean (when files are staged) and smudge (applied on checkout) filters in git to expand tabs to spaces: [1] Add in file .git/info/attributes: *.java filter=tabspace Set git vars: git config --global filter.tabspace.smudge 'expand -t 4' git config --global filter.tabspace.clean 'expand -t 4' Checkout HEAD to apply smudge/expand tabs: git checkout HEAD -- ** We should also handle trailing whitespaces [2], CRLF and sign-off our patches. May be we should create and use a check-patch script [3] like GNU/Linux committers do? Refs: [0] http://git-scm.com/book/ch7-2.html [1] http://stackoverflow.com/questions/2316677/can-git-automatically-switch-between-spaces-and-tabs/ [2] http://snipplr.com/view/28523/git-precommit-hook-to-fix-trailing-whitespace/ [3] http://git.kernel.org/?p=linux/kernel/git/torvalds/linux.git;a=tree;f=scripts;h=6c1b648550f84d4af8d66d31a635db990d71e5ca;hb=f4ba394c1b02e7fc2179fda8d3941a5b3b65efb6 Regards, Rohit > > Wido
