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

Re: .gittattributes handling has deficiencies

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Oct 22, 2007, 10:29 UTC
Message-ID
<Pine.LNX.4.64.0710221125350.25221@racer.site>
In-Reply-To
<565E1D52-59C4-4EB8-AA81-FF94F346FE61@zib.de>
Hi,
On Mon, 22 Oct 2007, Steffen Prohaska wrote:
> .gitattributes is first looked for in the working directory, and if not 
> there, .gitattributes is read from the index.

Of course we could change that to do it the other way round. But this would contradict expectations when you edit .gitattributes and then checkout single files without having git-add'ed .gitattributes first.

The biggest problem in your setup, however, is not if .gitattributes is read from the index or the working directory. The biggest problem is that files are not touched when their contents have not changed.

IOW if you have .gitattributes in the to-be-checked-out branch which say that README is crlf, and in the current branch it is not, and README's _contents_ are identical in both branches, a "git checkout <that-other-branch>" will not rewrite README, and consequently not change the working copy to crlf.

Ciao, Dscho

Previous: Steffen ProhaskaNext: Steffen Prohaska
Message 13 of 14 in “.gittattributes handling has deficiencies”
  1. Steffen ProhaskaOct 21, 2007
  2. david@lang.hmOct 21, 2007
  3. Steffen ProhaskaOct 21, 2007
  4. david@lang.hmOct 21, 2007
  5. Steffen ProhaskaOct 21, 2007
  6. david@lang.hmOct 21, 2007
  7. Steffen ProhaskaOct 21, 2007
  8. david@lang.hmOct 21, 2007
  9. david@lang.hmOct 22, 2007
  10. Steffen ProhaskaOct 22, 2007
  11. Shawn O. PearceOct 22, 2007
  12. Steffen ProhaskaOct 22, 2007
  13. Johannes SchindelinOct 22, 2007
  14. Steffen ProhaskaOct 22, 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.