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

Re: Applying .gitattributes text/eol changes

From
Marc Strapetz <marc.strapetz@syntevo.com>
Date
Jan 13, 2011, 14:57 UTC
Message-ID
<4D2F12EE.4020400@syntevo.com>
In-Reply-To
<4D2F0E3A.8090108@drmicha.warpmail.net>
Show 9 quoted lines
>> If a "git checkout" would (optionally) make sure that all EOLs are
>> properly set according to .gitattributes, the problem would be resolved.
>> As this might be not so easy to implement, my suggestion was to make
>> "git reset --hard" work more unobtrusive. I think we can provide a
>> corresponding patch, if it has chances to get accepted.
> 
> There have been other cases where git update-index --really-refresh
> wasn't enough. You might want to check whether that is a suitable "patch
> attack vector". This might be useful not only for you but also for others.

So your suggestion is to fix "git update-index --really-refresh", so it's a replacement for "rm .git/index"? This sounds reasonable, especially as "rm .git/index" is something one feels not comfortable about when performing the first time ;-)

Anyway, I'm still wondering if it will resolve the "git reset --hard" problem of re-checking out every file, even if content is already identical in the working tree. I think that part has to be fixed, too.

What do you think about "git checkout --fix-eols" option as an alternative? Its uses cases are more limited, though.

-- Best regards, Marc Strapetz ============= syntevo GmbH http://www.syntevo.com http://blog.syntevo.com

On 13.01.2011 15:37, Michael J Gruber wrote:
Show 31 quoted lines
> Marc Strapetz venit, vidit, dixit 13.01.2011 15:28:
>>>> case of missing .git/index, Git freshly writes all working tree files,
>>>> ignoring already existing files which already have the correct content.
>>>> Maybe this behavior is by intention and makes sense in some cases. In my
>>>> case it has adverse effects on IDEs and probably other tools which are
>>>> monitoring the file system.
>>>
>>> ...but changing gitattributes is something you don't do routinely in
>>> your workflow; so, at worst there would be an occasional unnecessary run
>>> of your build process.
>>
>> Our Git-SVN bridge does it, potentially on every pull. This is why we
>> currently need to run "rm .git/index && git reset --hard" after every
>> pull, resp. every checkout (switching to another commit may result in
>> changed .gitattributes as well).
> 
> OK, now you're telling us what this is about ;)
> 
>> If a "git checkout" would (optionally) make sure that all EOLs are
>> properly set according to .gitattributes, the problem would be resolved.
>> As this might be not so easy to implement, my suggestion was to make
>> "git reset --hard" work more unobtrusive. I think we can provide a
>> corresponding patch, if it has chances to get accepted.
> 
> There have been other cases where git update-index --really-refresh
> wasn't enough. You might want to check whether that is a suitable "patch
> attack vector". This might be useful not only for you but also for others.
> 
> Michael
> 
> 
Previous: Michael J GruberNext: Junio C Hamano
Message 8 of 11 in “Applying .gitattributes text/eol changes”
  1. Marc StrapetzJan 3, 2011
  2. Marc StrapetzJan 11, 2011
  3. Michael J GruberJan 11, 2011
  4. Marc StrapetzJan 11, 2011
  5. Michael J GruberJan 13, 2011
  6. Marc StrapetzJan 13, 2011
  7. Michael J GruberJan 13, 2011
  8. Marc StrapetzJan 13, 2011
  9. Junio C HamanoJan 13, 2011
  10. Michael J GruberJan 14, 2011
  11. Marc StrapetzJan 14, 2011

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.