{"thread":{"id":"64464","subject":"[PATCH] .gitattributes: remove misspelled no-op whitespace attribute","startedAt":"2025-11-11T18:41:22Z","lastAt":"2025-11-11T22:02:27Z","messageCount":3,"participants":["Junio C Hamano","Jeff King"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"530521","messageId":"xmqqv7jgwgxb.fsf@gitster.g","threadId":"64464","inReplyTo":null,"subject":"[PATCH] .gitattributes: remove misspelled no-op whitespace attribute","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-11-11T18:41:20Z","receivedAt":"2025-11-11T18:41:22Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Ever since 14f9e128 (Define the project whitespace policy,\n2008-02-10) added the whitespace rules to .gitattributes, we spelled\nthe most general rule like so:\n\n    * whitespace=!indent,trail,space\n\nin the top-level .gitattributes file.  The intent of this line was\ndescribed in the commit log message:\n\n     - Unless otherwise specified, indent with SP that could be\n       replaced with HT are not \"bad\".  But SP before HT in the\n       indent is \"bad\", and trailing whitespaces are \"bad\".\n\nIt clearly wanted to disable indent-with-non-tab, so !indent is most\nlikely a misspelt form of '-indent'.  Because indent-with-non-tab\nhas never been enabled by default, by luck this was not causing any\nill effect.\n\nWe could either remove \"!indent\", or spell it \"-indent\".  The\nimmediate effect would be the same.  It would only start to make a\ndifference when/if we enable indent-with-non-tab by default in\nfuture versions of Git.\n\nLet's take the former option to remove \"!indent\" from the list.  We\nwould feel the effect first-hand ourselves before anybody else if we\never decide to change the built-in default whitespace rules, which\nwould be hidden from us if we decide to rewrite it to \"-indent\"\ninstead.\n\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n * There is another one in git-gui/.gitattributes that probably was\n   copied from here, which may want to get fixed.\n\n .gitattributes | 2 +-\n 1 file changed, 1 insertion(+), 1 deletion(-)\n\ndiff --git a/.gitattributes b/.gitattributes\nindex 158c3d45c4..2a50ebaf2e 100644\n--- a/.gitattributes\n+++ b/.gitattributes\n@@ -1,4 +1,4 @@\n-* whitespace=!indent,trail,space\n+* whitespace=trail,space\n *.[ch] whitespace=indent,trail,space diff=cpp\n *.sh whitespace=indent,trail,space text eol=lf\n *.perl text eol=lf diff=perl\n-- \n2.52.0-rc1-455-g30608eb744\n\n"},{"id":"530546","messageId":"20251111213910.GB4053071@coredump.intra.peff.net","threadId":"64464","inReplyTo":"xmqqv7jgwgxb.fsf@gitster.g","subject":"Re: [PATCH] .gitattributes: remove misspelled no-op whitespace attribute","fromName":"Jeff King","fromEmail":"peff@peff.net","sentAt":"2025-11-11T21:39:10Z","receivedAt":"2025-11-11T21:39:11Z","isPatch":true,"sender":{"key":"peff@peff.net","avatar":"https://avatars.githubusercontent.com/u/45925?v=4"},"body":"On Tue, Nov 11, 2025 at 10:41:20AM -0800, Junio C Hamano wrote:\n\n> We could either remove \"!indent\", or spell it \"-indent\".  The\n> immediate effect would be the same.  It would only start to make a\n> difference when/if we enable indent-with-non-tab by default in\n> future versions of Git.\n> \n> Let's take the former option to remove \"!indent\" from the list.  We\n> would feel the effect first-hand ourselves before anybody else if we\n> ever decide to change the built-in default whitespace rules, which\n> would be hidden from us if we decide to rewrite it to \"-indent\"\n> instead.\n\nPerfectly explained, and the result makes sense.\n\nI don't know that this patch particularly needed review, but maybe it is\nnice for you to know that somebody really is out there reading them. ;)\n\n-Peff\n"},{"id":"530548","messageId":"xmqqseekut1q.fsf@gitster.g","threadId":"64464","inReplyTo":"20251111213910.GB4053071@coredump.intra.peff.net","subject":"Re: [PATCH] .gitattributes: remove misspelled no-op whitespace attribute","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2025-11-11T22:02:25Z","receivedAt":"2025-11-11T22:02:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jeff King <peff@peff.net> writes:\n\n> On Tue, Nov 11, 2025 at 10:41:20AM -0800, Junio C Hamano wrote:\n>\n>> We could either remove \"!indent\", or spell it \"-indent\".  The\n>> immediate effect would be the same.  It would only start to make a\n>> difference when/if we enable indent-with-non-tab by default in\n>> future versions of Git.\n>> \n>> Let's take the former option to remove \"!indent\" from the list.  We\n>> would feel the effect first-hand ourselves before anybody else if we\n>> ever decide to change the built-in default whitespace rules, which\n>> would be hidden from us if we decide to rewrite it to \"-indent\"\n>> instead.\n>\n> Perfectly explained, and the result makes sense.\n>\n> I don't know that this patch particularly needed review, but maybe it is\n> nice for you to know that somebody really is out there reading them. ;)\n\nIt is mostly a principle thing.  I want to see that every non-merge\nchanges authored by me is treated just like patches authored by\nothers.\n\nAnother reason for me to send these patches out is so that I have a\ncopy of the patch on the lore archive, with message-ID, so that \"git\nlog --notes=amlog\" would work for my changes the same way as anybody\nelse's.\n"}]}