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

Re: [PATCH] Add gitattributes file making whitespace checking pickier

From
Junio C Hamano <gitster@pobox.com>
Date
Feb 9, 2008, 20:57 UTC
Message-ID
<7vr6fletkl.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080209185038.GB25533@fieldses.org>
"J. Bruce Fields" <bfields@fieldses.org> writes:
Show 5 quoted lines
> Yeah, fair enough.  Hard to know where to start, though.  OK, just to
> get an idea, I committed a completely empty tree, made a diff (with
> --binary), then applied with --whitespace=fix and compared to the
> original.  In some cases these seem to be accidental, in some cases
> (git-p4) I assume they're intended to use the different style.
I personally have this in .git/config
[core]
	whitespace = indent,trail,space
and the following three lines in contrib/.gitattributes (untracked)

*.py whitespace=!indent,trail,space *.el whitespace=!indent,trail,space fast-import/git-p4 whitespace=!indent,trail,space

The latter I added after receiving a fix-up patch from Toby Allsopp a few days ago. I applied git-p4 patch with the strictest rule.

As you argued correctly earlier, when we made the whitespace rules per-path using the attributes mechanism, the whitespace policy should be project wide, just like coding style, so I think it is a good idea to have in-tree .gitattributes files that spell out what the policy is more explicitly.

At least I think we can all agree that this one entry in the toplevel .gitattributes is a safe and good idea.

*.[ch] whitespace

I am not sure about the AsciiDoc Documentation. I've always assumed that the docs would format exactly the same before and after running expand and/or unexpand on Documentation/*.txt, and if that is indeed the case we should add

*.txt whitespace
to Documentation/.gitattributes as well.

Then I should _discard_ the one in my .git/config and the untracked contrib/.gitattributes file.

Previous: J. Bruce FieldsNext: J. Bruce Fields
Message 9 of 22 in “Add gitattributes file making whitespace checking pickier”
  1. Add gitattributes file making whitespace checking pickierJ. Bruce Fields, Feb 9, 2008
  2. Daniel BarkalowFeb 9, 2008
  3. J. Bruce FieldsFeb 9, 2008
  4. J. Bruce FieldsFeb 9, 2008
  5. Jakub NarebskiFeb 9, 2008
  6. J. Bruce FieldsFeb 9, 2008
  7. Jakub NarebskiFeb 9, 2008
  8. J. Bruce FieldsFeb 9, 2008
  9. Junio C HamanoFeb 9, 2008
  10. J. Bruce FieldsFeb 9, 2008
  11. Jakub NarebskiFeb 9, 2008
  12. Junio C HamanoFeb 10, 2008
  13. Jakub NarebskiFeb 10, 2008
  14. Junio C HamanoFeb 10, 2008
  15. Add gitattributes file making whitespace checking pickierJunio C Hamano, Feb 10, 2008
  16. J. Bruce FieldsFeb 10, 2008
  17. Daniel BarkalowFeb 10, 2008
  18. Junio C HamanoFeb 10, 2008
  19. Daniel BarkalowFeb 10, 2008
  20. Junio C HamanoFeb 11, 2008
  21. Brian DowningFeb 12, 2008
  22. Junio C HamanoFeb 12, 2008

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.