From 14f9e128d38f809947d34979a59ee524e350ac6e Mon Sep 17 00:00:00 2001 From: Junio C Hamano Date: Sun, 10 Feb 2008 19:34:34 -0800 Subject: [PATCH] Define the project whitespace policy This establishes what the "bad" whitespaces are for this project. The rules are: - Unless otherwise specified, indent with SP that could be replaced with HT are not "bad". But SP before HT in the indent is "bad", and trailing whitespaces are "bad". - For C source files, initial indent by SP that can be replaced with HT is also "bad". - Test scripts in t/ and test vectors in its subdirectories can contain anything, so we make it unrestricted for now. Anything "bad" will be shown in WHITESPACE error indicator in diff output, and "apply --whitespace=warn" will warn about it. Signed-off-by: Junio C Hamano --- .gitattributes | 2 ++ Documentation/.gitattributes | 1 + t/.gitattributes | 1 + 3 files changed, 4 insertions(+) create mode 100644 .gitattributes create mode 100644 Documentation/.gitattributes create mode 100644 t/.gitattributes diff --git a/.gitattributes b/.gitattributes new file mode 100644 index 0000000000..6b9c715d21 --- /dev/null +++ b/.gitattributes @@ -0,0 +1,2 @@ +* whitespace=!indent,trail,space +*.[ch] whitespace diff --git a/Documentation/.gitattributes b/Documentation/.gitattributes new file mode 100644 index 0000000000..ddb030137d --- /dev/null +++ b/Documentation/.gitattributes @@ -0,0 +1 @@ +*.txt whitespace diff --git a/t/.gitattributes b/t/.gitattributes new file mode 100644 index 0000000000..562b12e16e --- /dev/null +++ b/t/.gitattributes @@ -0,0 +1 @@ +* -whitespace