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 12, 2008, 21:42 UTC
Message-ID
<7vbq6l3l8o.fsf@gitster.siamese.dyndns.org>
In-Reply-To
<20080212074323.GD27535@lavos.net>
bdowning@lavos.net (Brian Downing) writes:
Show 9 quoted lines
> On Sun, Feb 10, 2008 at 02:52:50AM -0800, Junio C Hamano wrote:
>>  - It is Ok to indent with all spaces the Python and Elisp
>>    sources in the contrib/ area.
>
> Should contrib simply be exempt from all rules?  Certainly with my
> contribution to contrib (contrib/stats/packinfo.pl) I made no effort to
> conform to the Git style because I thought contribs were auxiliary to
> Git.  (It contains indention with all spaces, which is my personal
> default style.)

You are quoting an older draft. The rules applied to 'master' is actually a bit more lenient:

 - 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".
 - For C source files, initial indent by SP that can be replaced
   with HT is also "bad".
 - Test scripts in t/ and test vectors in its subdirectories can
   contain anything, so we make it unrestricted for now.

So your particular "indent without HT" is generally accepted, and considered a violation only in C sources.

I see what you mean by "excempt from all rules" and it is certainly a valid approach, but I at the same time think minimal whitespace policy should be there, and flagging trailing spaces and SP before HT is a good idea.

Previous: Brian Downing
Message 22 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.