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

Re: [RFR] gitattributes(5) documentation

From
DLDavid Lang <david.lang@digitalinsight.com>
Date
Apr 22, 2007, 09:33 UTC
Message-ID
<Pine.LNX.4.63.0704220221160.5946@qynat.qvtvafvgr.pbz>
In-Reply-To
<7vmz10q4cx.fsf@assigned-by-dhcp.cox.net>
On Sun, 22 Apr 2007, Junio C Hamano wrote:
Show 19 quoted lines
> David Lang <david.lang@digitalinsight.com> writes:
>
>> in the long run this would let you phase out the core.autocrlf option
>> entirely, letting the bahavior be specified in gitattributes.
>
> You _could_, but that is quite against what we want.  These
> should stay separate, and the gitattributes mechanism is
> designed specifically to allow them cleanly separated.
>
> The configuration "core.autcrlf" describes a particular
> repository.  If the platform the repository is on expects text
> files to be line-terminated with CRLF, you would have
> core.autocrlf set; otherwise you don't.
>
> On the other hand, gitattributes' 'crlf' describes if the path
> is text, and that is the reason it can and should be "in-tree",
> i.e. not just $GIT_DIR/info/attributes (which is private to the
> repository) but in .gitattributes (and subdirectories'), which
> is given to everybody who has a copy of the project.

I was thinking that it should be in $GIT_DIR/info/gitattributes along with the rest of the crlf defintitions.

> How text files are handled is a local matter, and stays in the
> config.  Which ones are text is the same for everybody who has a
> copy of the project, and is in-tree information.

I understand what you are aiming for, but you are depending on people doing the defining of what files are text in the .gitattributes files instead of $GIT_DIR/info/gitattributes, which is also valid to do with things as currently defined (at least if I'm understanding them correctly)

what you really do want for crlf is one variable that, if set, uses the value of another variable.

i wonder if this is useful enough to define formally. something along the lines of [default] crlf=input in the $GIT_DIR/info/gitattributes file

at the moment we have crlf (set by core.autocrlf) and merge (set by the environment variable), I think I saw that it may also be possible to define a different diff to use by default as well (possibly by useing a third method to define the default, possibly by an environment variable, I don't remember)

if you could set the defaults in the $GIT_DIR/info/gitattributes file and then have the flag set/unset/set-to-value in the whatever gitattributes file(s) are appropriate, it would consolodate the configurations into one related place rather then spreading them around with different ways to set the defaults for different things.

David Lang
Previous: Junio C HamanoNext: Nicolas Pitre
Message 17 of 32 in “What's cooking in git.git (topics)”
  1. Junio C HamanoApr 9, 2007
  2. Junio C HamanoApr 16, 2007
  3. Junio C HamanoApr 19, 2007
  4. Alex RiesenApr 19, 2007
  5. Nicolas PitreApr 19, 2007
  6. Martin WaitzApr 19, 2007
  7. Junio C HamanoApr 20, 2007
  8. Alex RiesenApr 20, 2007
  9. Sam RavnborgApr 20, 2007
  10. Martin WaitzApr 21, 2007
  11. Linus TorvaldsApr 21, 2007
  12. [RFR] gitattributes(5) documentationJunio C Hamano, Apr 20, 2007
  13. Linus TorvaldsApr 20, 2007
  14. Junio C HamanoApr 20, 2007
  15. David LangApr 22, 2007
  16. Junio C HamanoApr 22, 2007
  17. David LangApr 22, 2007
  18. Nicolas PitreApr 20, 2007
  19. Junio C HamanoApr 22, 2007
  20. Junio C HamanoApr 23, 2007
  21. Nicolas PitreApr 23, 2007
  22. Alex RiesenApr 23, 2007
  23. Junio C HamanoApr 23, 2007
  24. Alex RiesenApr 23, 2007
  25. Junio C HamanoApr 23, 2007
  26. Alex RiesenApr 24, 2007
  27. Johannes SchindelinApr 24, 2007
  28. Alex RiesenApr 24, 2007
  29. Johannes SchindelinApr 24, 2007
  30. Junio C HamanoApr 24, 2007
  31. Alex RiesenApr 25, 2007
  32. Johannes SchindelinApr 23, 2007

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.