git/list[1] front-page[2] threads[3] people[4] search[5] about
 

Re: [PATCH] Make the tab width used for whitespace checks configurable

From
Junio C Hamano <gitster@pobox.com>
Date
Nov 30, 2010, 01:31 UTC
Message-ID
<7vhbezwqan.fsf@alter.siamese.dyndns.org>
In-Reply-To
<4CF366B1.8070400@viscovery.net>
Johannes Sixt <j.sixt@viscovery.net> writes:
Show 16 quoted lines
> From: Johannes Sixt <j6t@kdbg.org>
>
> 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 <j6t@kdbg.org>
> ---
>  I have a project that uses tab width 4, and which has a lot of whitespace
>  errors. This is very helpful to spot them when lines are changed that
>  are indented with 4 spaces.

Heh, I like it. This will be the second killer feature to upgrade to the upcoming release. We really should start calming things down.

I am sort of surprised how the patch does not have to touch neither diff.c nor apply.c at all---it demonstrates how solidly and cleanly the ws.c infrastructure was done in the first place, I guess ;-).

Thanks.
Previous: Jonathan NiederNext: Johannes Sixt
Message 3 of 6 in “Make the tab width used for whitespace checks configurable”
  1. Make the tab width used for whitespace checks configurableJohannes Sixt, Nov 29, 2010
  2. Jonathan NiederNov 29, 2010
  3. Junio C HamanoNov 30, 2010
  4. 1/2 apply --whitespace=fix: fix tab-in-indentJohannes Sixt, Nov 30, 2010
  5. 2/2 Make the tab width used for whitespace checks configurableJohannes Sixt, Nov 30, 2010
  6. Chris WebbNov 30, 2010

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.