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

Re: Re* [RFC 1/1] Add new indent-with-tab whitespace check

From
Junio C Hamano <gitster@pobox.com>
Date
Apr 1, 2010, 19:02 UTC
Message-ID
<7voci3ov2k.fsf@alter.siamese.dyndns.org>
In-Reply-To
<7vsk7fovjx.fsf_-_@alter.siamese.dyndns.org>
Junio C Hamano <gitster@pobox.com> writes:

I need to make some clarification, as the following is misleading. This clarification fortunately does not have to change the patch I sent earlier.

Show 5 quoted lines
> There is another issue with this change.  Because "whitespace" without any
> string in .gitattributes are defined to cause all the whitespace breakages
> known to git to be caught, and tab-in-indent is inherently incompatible
> with indent-with-non-tab, this cannot be supported without changing the
> definition of "default set of whitespace breakage classes".

I said "default" but that is totally incorrect. We catch "trailing-space" and "space-before-tab" by default (i.e. the user does not have any custom "whitespace" attribute), and that will not change.

Show 12 quoted lines
> The intention of allowing .gitattributes to say "*.txt whitespace" is to
> let the users and projects say:
>
>     I trust the competence and good judgement made by git developers
>     regarding whitespace issues.  They may devise a new algorithm to catch
>     common whitespace errors that the current tool may not catch, and when
>     that happens, I'd like my project to take advantage of the new code
>     and catch the newly defined classes of errors.
>
> and that is why we include all whitespace-rule except for the ones that
> loosens error conditions to the set of breakages we catch for such a
> specification.

A corollary to the above clarification on "default" is that people who do not trust us but want to rely on the traditional "Only trailing-space and space-before-tab, nothing else" need to do _nothing_. If they do not have "whitespace" attribute defined for paths, the default is honored. People who want to catch the set of maximal whitespace breakage classes that is internally consistent are the only ones that already have entries like "*.txt whitespace" in their attributes file, and we keep our promises to them. If we take the "all errors known to git" too literally to include incompatible rules in them, the end result would become useless to them, and that is what the earlier update fixes.

Previous: Junio C HamanoNext: Chris Webb
Message 5 of 6 in “[RFC 0/1] diff --check for indent-with-spaces style”
  1. Chris WebbMar 27, 2010
  2. 1/1 Add new indent-with-tab whitespace checkChris Webb, Mar 27, 2010
  3. Junio C HamanoMar 31, 2010
  4. Re* [RFC 1/1] Add new indent-with-tab whitespace checkJunio C Hamano, Apr 1, 2010
  5. Junio C HamanoApr 1, 2010
  6. Chris WebbApr 2, 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.