git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Marc Strapetz <marc.strapetz@syntevo.com>
To: Michael J Gruber <git@drmicha.warpmail.net>
Cc: git@vger.kernel.org
Subject: Re: Applying .gitattributes text/eol changes
Date: Tue, 11 Jan 2011 15:02:07 +0100	[thread overview]
Message-ID: <4D2C62DF.20706@syntevo.com> (raw)
In-Reply-To: <4D2C4902.4010705@drmicha.warpmail.net>

On 11.01.2011 13:11, Michael J Gruber wrote:
> Marc Strapetz venit, vidit, dixit 03.01.2011 18:18:
>> I'm looking for an unobtrusive way to apply (committed) changes for
>> text/eol attributes to the working tree. For instance, after having
>> changed "*.txt eol=crlf" to "*.txt eol=lf", all *.txt files should be
>> converted from CRLF to LF endings. The only advice I found so far is to
>> remove .git/index and do a reset --hard. The disadvantage of this
>> approach is that every file will be touched:
>>
>> - although the content does not change, timestamps will be changed. This
> 
> The bytewise content does change.

The content has only changed for *.txt files, but the timestamps of
*all* files are updated. I guess (but didn't verify from code), that in
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.

>> One solution I could think of which might be helpful in other situations
>> as well would be to have an "--unobtrusive" option for reset which would
>> only replace a file if the content has actually been changed.
> 
> How about
> 
> git ls-files \*.txt | xargs touch -a
> git ls-files \*.txt | git checkout

That won't be helpful as it requires me to know what has changed.

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

  reply	other threads:[~2011-01-11 14:02 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-01-03 17:18 Applying .gitattributes text/eol changes Marc Strapetz
2011-01-11  9:29 ` Marc Strapetz
2011-01-11 12:11 ` Michael J Gruber
2011-01-11 14:02   ` Marc Strapetz [this message]
2011-01-13 13:23     ` Michael J Gruber
2011-01-13 14:28       ` Marc Strapetz
2011-01-13 14:37         ` Michael J Gruber
2011-01-13 14:57           ` Marc Strapetz
2011-01-13 23:30             ` Junio C Hamano
2011-01-14  8:31               ` Michael J Gruber
2011-01-14  9:05               ` Marc Strapetz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4D2C62DF.20706@syntevo.com \
    --to=marc.strapetz@syntevo.com \
    --cc=git@drmicha.warpmail.net \
    --cc=git@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).