git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] .gitattributes: remove misspelled no-op whitespace attribute
@ 2025-11-11 18:41 Junio C Hamano
  2025-11-11 21:39 ` Jeff King
  0 siblings, 1 reply; 3+ messages in thread
From: Junio C Hamano @ 2025-11-11 18:41 UTC (permalink / raw)
  To: git

Ever since 14f9e128 (Define the project whitespace policy,
2008-02-10) added the whitespace rules to .gitattributes, we spelled
the most general rule like so:

    * whitespace=!indent,trail,space

in the top-level .gitattributes file.  The intent of this line was
described in the commit log message:

     - 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".

It clearly wanted to disable indent-with-non-tab, so !indent is most
likely a misspelt form of '-indent'.  Because indent-with-non-tab
has never been enabled by default, by luck this was not causing any
ill effect.

We could either remove "!indent", or spell it "-indent".  The
immediate effect would be the same.  It would only start to make a
difference when/if we enable indent-with-non-tab by default in
future versions of Git.

Let's take the former option to remove "!indent" from the list.  We
would feel the effect first-hand ourselves before anybody else if we
ever decide to change the built-in default whitespace rules, which
would be hidden from us if we decide to rewrite it to "-indent"
instead.

Signed-off-by: Junio C Hamano <gitster@pobox.com>
---
 * There is another one in git-gui/.gitattributes that probably was
   copied from here, which may want to get fixed.

 .gitattributes | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/.gitattributes b/.gitattributes
index 158c3d45c4..2a50ebaf2e 100644
--- a/.gitattributes
+++ b/.gitattributes
@@ -1,4 +1,4 @@
-* whitespace=!indent,trail,space
+* whitespace=trail,space
 *.[ch] whitespace=indent,trail,space diff=cpp
 *.sh whitespace=indent,trail,space text eol=lf
 *.perl text eol=lf diff=perl
-- 
2.52.0-rc1-455-g30608eb744


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH] .gitattributes: remove misspelled no-op whitespace attribute
  2025-11-11 18:41 [PATCH] .gitattributes: remove misspelled no-op whitespace attribute Junio C Hamano
@ 2025-11-11 21:39 ` Jeff King
  2025-11-11 22:02   ` Junio C Hamano
  0 siblings, 1 reply; 3+ messages in thread
From: Jeff King @ 2025-11-11 21:39 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: git

On Tue, Nov 11, 2025 at 10:41:20AM -0800, Junio C Hamano wrote:

> We could either remove "!indent", or spell it "-indent".  The
> immediate effect would be the same.  It would only start to make a
> difference when/if we enable indent-with-non-tab by default in
> future versions of Git.
> 
> Let's take the former option to remove "!indent" from the list.  We
> would feel the effect first-hand ourselves before anybody else if we
> ever decide to change the built-in default whitespace rules, which
> would be hidden from us if we decide to rewrite it to "-indent"
> instead.

Perfectly explained, and the result makes sense.

I don't know that this patch particularly needed review, but maybe it is
nice for you to know that somebody really is out there reading them. ;)

-Peff

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] .gitattributes: remove misspelled no-op whitespace attribute
  2025-11-11 21:39 ` Jeff King
@ 2025-11-11 22:02   ` Junio C Hamano
  0 siblings, 0 replies; 3+ messages in thread
From: Junio C Hamano @ 2025-11-11 22:02 UTC (permalink / raw)
  To: Jeff King; +Cc: git

Jeff King <peff@peff.net> writes:

> On Tue, Nov 11, 2025 at 10:41:20AM -0800, Junio C Hamano wrote:
>
>> We could either remove "!indent", or spell it "-indent".  The
>> immediate effect would be the same.  It would only start to make a
>> difference when/if we enable indent-with-non-tab by default in
>> future versions of Git.
>> 
>> Let's take the former option to remove "!indent" from the list.  We
>> would feel the effect first-hand ourselves before anybody else if we
>> ever decide to change the built-in default whitespace rules, which
>> would be hidden from us if we decide to rewrite it to "-indent"
>> instead.
>
> Perfectly explained, and the result makes sense.
>
> I don't know that this patch particularly needed review, but maybe it is
> nice for you to know that somebody really is out there reading them. ;)

It is mostly a principle thing.  I want to see that every non-merge
changes authored by me is treated just like patches authored by
others.

Another reason for me to send these patches out is so that I have a
copy of the patch on the lore archive, with message-ID, so that "git
log --notes=amlog" would work for my changes the same way as anybody
else's.

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-11-11 22:02 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-11 18:41 [PATCH] .gitattributes: remove misspelled no-op whitespace attribute Junio C Hamano
2025-11-11 21:39 ` Jeff King
2025-11-11 22:02   ` Junio C Hamano

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).