From f4b05a4947f5f1cf3e01fb61ec5919cc28fe11f7 Mon Sep 17 00:00:00 2001 From: Johannes Sixt Date: Tue, 30 Nov 2010 09:29:11 +0100 Subject: Make the tab width used for whitespace checks configurable A new whitespace "rule" is added that sets the tab width to use for whitespace checks and fix-ups and replaces the hard-coded constant 8. Since the setting is part of the rules, it can be set per file using .gitattributes. The new configuration is backwards compatible because older git versions simply ignore unknown whitespace rules. Signed-off-by: Johannes Sixt Signed-off-by: Junio C Hamano --- Documentation/config.txt | 3 +++ Documentation/gitattributes.txt | 6 ++++-- 2 files changed, 7 insertions(+), 2 deletions(-) (limited to 'Documentation') diff --git a/Documentation/config.txt b/Documentation/config.txt index 6a6c0b5bd8..7aff5ce2c8 100644 --- a/Documentation/config.txt +++ b/Documentation/config.txt @@ -513,6 +513,9 @@ core.whitespace:: part of the line terminator, i.e. with it, `trailing-space` does not trigger if the character before such a carriage-return is not a whitespace (not enabled by default). +* `tabwidth=` tells how many character positions a tab occupies; this + is relevant for `indent-with-non-tab` and when git fixes `tab-in-indent` + errors. The default tab width is 8. Allowed values are 1 to 63. core.fsyncobjectfiles:: This boolean will enable 'fsync()' when writing object files. diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt index c80ca5da43..5a7f936429 100644 --- a/Documentation/gitattributes.txt +++ b/Documentation/gitattributes.txt @@ -723,6 +723,8 @@ control per path. Set:: Notice all types of potential whitespace errors known to git. + The tab width is taken from the value of the `core.whitespace` + configuration variable. Unset:: @@ -730,13 +732,13 @@ Unset:: Unspecified:: - Use the value of `core.whitespace` configuration variable to + Use the value of the `core.whitespace` configuration variable to decide what to notice as error. String:: Specify a comma separate list of common whitespace problems to - notice in the same format as `core.whitespace` configuration + notice in the same format as the `core.whitespace` configuration variable. -- cgit v1.2.1