{"thread":{"id":"46647","subject":"Cannot checkout after setting the eol attribute","startedAt":"2017-08-22T17:49:25Z","lastAt":"2017-08-31T14:33:29Z","messageCount":15,"participants":["Ben Boeckel","Torsten Bögershausen","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"326947","messageId":"20170822174918.GA1005@megas.kitware.com","threadId":"46647","inReplyTo":null,"subject":"Cannot checkout after setting the eol attribute","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-22T17:49:18Z","receivedAt":"2017-08-22T17:49:25Z","isPatch":false,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"Hi,\n\nI specified the `eol` attribute on some files recently and the behavior\nof Git is very strange.\n\nHere is the set of commands to set up the repository used for the\ndiscussion:\n\n    git init\n    echo $'dos\\r' > dos\n    git add dos\n    git commit -m \"dos newlines\"\n    echo \"dos -crlf\" > .gitattributes\n    git add .gitattributes\n    git commit -m \"add attributes\"\n    echo \"dos eol=crlf\" > .gitattributes\n    git add .gitattributes\n    git commit -m \"set eol attribute instead\"\n\nThe following behaviors are observed:\n\n  - `git reset --hard` does not make the working directory clean; and\n  - `git rebase` gets *very* confused about the diffs in the working\n    tree because `git stash` can't reset the working tree;\n\nThere are probably other oddities lingering about as well. If I commit\nwhat Git thinks is the difference, the diff (with invisibles made\nvisible) is:\n\n    % git diff | cat -A\n    diff --git a/dos b/dos$\n    index fde2310..4723a1b 100644$\n    --- a/dos$\n    +++ b/dos$\n    @@ -1 +1 @@$\n    -dos^M$\n    +dos$\n\nSeen in 2.9.5 and 2.14.0.rc1.\n\n--Ben\n"},{"id":"326955","messageId":"20170822191318.GA22118@tor.lan","threadId":"46647","inReplyTo":"20170822174918.GA1005@megas.kitware.com","subject":"Re: Cannot checkout after setting the eol attribute","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-08-22T19:13:18Z","receivedAt":"2017-08-22T19:13:29Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Tue, Aug 22, 2017 at 01:49:18PM -0400, Ben Boeckel wrote:\n> Hi,\n> \n> I specified the `eol` attribute on some files recently and the behavior\n> of Git is very strange.\n> \n> Here is the set of commands to set up the repository used for the\n> discussion:\n> \n>     git init\n>     echo $'dos\\r' > dos\n>     git add dos\n>     git commit -m \"dos newlines\"\n>     echo \"dos -crlf\" > .gitattributes\n>     git add .gitattributes\n>     git commit -m \"add attributes\"\n>     echo \"dos eol=crlf\" > .gitattributes\n>     git add .gitattributes\n>     git commit -m \"set eol attribute instead\"\n> \n> The following behaviors are observed:\n> \n>   - `git reset --hard` does not make the working directory clean; and\n>   - `git rebase` gets *very* confused about the diffs in the working\n>     tree because `git stash` can't reset the working tree;\n> \n\n\n> There are probably other oddities lingering about as well. If I commit\n> what Git thinks is the difference, the diff (with invisibles made\n> visible) is:\n> \n>     % git diff | cat -A\n>     diff --git a/dos b/dos$\n>     index fde2310..4723a1b 100644$\n>     --- a/dos$\n>     +++ b/dos$\n>     @@ -1 +1 @@$\n>     -dos^M$\n>     +dos$\n\nThanks for the goos example!\nThis is by design.\n\nWhen you set the text attribute (in your case \"eol=crlf\" implies text)\nthen the file(s) -must- be nomalized and commited so that they have LF\nin the repo (technically speaking the index)\n\n\nThis is what is written about the \"eol=crlf\" attribute:\n\tThis setting forces Git to normalize line endings for this\n\tfile on checkin and convert them to CRLF when the file is\n\tchecked out.\nAnd this is what is implemented in Git.\n\nLong story short:\n\nThe following would solve your problem:\n   git init\n   echo $'dos\\r' > dos\n   git add dos\n   git commit -m \"dos newlines\"\n   echo \"dos -crlf\" > .gitattributes\n   git add .gitattributes\n   git commit -m \"add attributes\"\n   echo \"dos eol=crlf\" > .gitattributes\n   git read-tree --empty   # Clean index, force re-scan of working directory\n   git add dos\n   git add .gitattributes\n   git commit -m \"set eol attribute instead\"\n   git ls-files --eol\n\n\n> \n> Seen in 2.9.5 and 2.14.0.rc1.\n> \n> --Ben\n"},{"id":"326960","messageId":"20170822194441.GA25093@megas.kitware.com","threadId":"46647","inReplyTo":"20170822191318.GA22118@tor.lan","subject":"Re: Cannot checkout after setting the eol attribute","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-22T19:44:41Z","receivedAt":"2017-08-22T19:44:47Z","isPatch":false,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"On Tue, Aug 22, 2017 at 21:13:18 +0200, Torsten Bögershausen wrote:\n> When you set the text attribute (in your case \"eol=crlf\" implies text)\n> then the file(s) -must- be nomalized and commited so that they have LF\n> in the repo (technically speaking the index)\n\nThis seems like a special case that Git could detect and message about\nsomehow.\n\n> This is what is written about the \"eol=crlf\" attribute:\n> \tThis setting forces Git to normalize line endings for this\n> \tfile on checkin and convert them to CRLF when the file is\n> \tchecked out.\n> And this is what is implemented in Git.\n\nYeah, I read the docs, but the oddities of reset not doing its job\nwasn't clear from this sentence :) .\n\n> Long story short:\n> \n> The following would solve your problem:\n>    git init\n>    echo $'dos\\r' > dos\n>    git add dos\n>    git commit -m \"dos newlines\"\n>    echo \"dos -crlf\" > .gitattributes\n>    git add .gitattributes\n>    git commit -m \"add attributes\"\n>    echo \"dos eol=crlf\" > .gitattributes\n>    git read-tree --empty   # Clean index, force re-scan of working directory\n\nThe fact that plumbing is necessary to dig yourself out of a hole of the\n`eol` attribute changes points to something needing to be changed, even\nif it's only documentation. Could Git detect this and message about it\nsomehow when `git reset` cannot fix the working tree? Or maybe it could\nat least exit with failure instead of success?\n\n--Ben\n"},{"id":"326964","messageId":"xmqqziar1iau.fsf@gitster.mtv.corp.google.com","threadId":"46647","inReplyTo":"20170822191318.GA22118@tor.lan","subject":"Re: Cannot checkout after setting the eol attribute","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-08-22T20:03:37Z","receivedAt":"2017-08-22T20:03:44Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> The following would solve your problem:\n>    git init\n>    echo $'dos\\r' > dos\n>    git add dos\n>    git commit -m \"dos newlines\"\n>    echo \"dos -crlf\" > .gitattributes\n>    git add .gitattributes\n>    git commit -m \"add attributes\"\n>    echo \"dos eol=crlf\" > .gitattributes\n\n>    git read-tree --empty   # Clean index, force re-scan of working directory\n>    git add dos\n\nThis is not advisable as a general suggestion, as in a real life (as\nopposed to a toy example) there will be paths other than this 'dos'\nthing in the working tree.  Perhaps replace \"git read-tree --empty\"\nwith \"git rm -f --cached dos\" or something like that that limits its\ndamage would prevent mistakes better.\n\n>    git add .gitattributes\n>    git commit -m \"set eol attribute instead\"\n>    git ls-files --eol\n"},{"id":"327073","messageId":"20170823194315.GA29237@tor.lan","threadId":"46647","inReplyTo":"20170822194441.GA25093@megas.kitware.com","subject":"Re: Cannot checkout after setting the eol attribute","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-08-23T19:43:15Z","receivedAt":"2017-08-23T19:43:23Z","isPatch":false,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Tue, Aug 22, 2017 at 03:44:41PM -0400, Ben Boeckel wrote:\n> On Tue, Aug 22, 2017 at 21:13:18 +0200, Torsten Bögershausen wrote:\n> > When you set the text attribute (in your case \"eol=crlf\" implies text)\n> > then the file(s) -must- be nomalized and commited so that they have LF\n> > in the repo (technically speaking the index)\n> \n> This seems like a special case that Git could detect and message about\n> somehow.\n> \n> > This is what is written about the \"eol=crlf\" attribute:\n> > \tThis setting forces Git to normalize line endings for this\n> > \tfile on checkin and convert them to CRLF when the file is\n> > \tchecked out.\n> > And this is what is implemented in Git.\n> \n> Yeah, I read the docs, but the oddities of reset not doing its job\n> wasn't clear from this sentence :) .\n\ngit reset does it's job - please see below.\n\nThe problem is that we need a \"git commit\" here.\nAfter applying .gitattributes, it may be neccessary to \"normalize\" the\nfiles. If there is something in the documentation, that can be\nimproved, please let us know.\n\n> \n> > Long story short:\n> > \n> > The following would solve your problem:\n> >    git init\n> >    echo $'dos\\r' > dos\n> >    git add dos\n> >    git commit -m \"dos newlines\"\n> >    echo \"dos -crlf\" > .gitattributes\n> >    git add .gitattributes\n> >    git commit -m \"add attributes\"\n> >    echo \"dos eol=crlf\" > .gitattributes\n> >    git read-tree --empty   # Clean index, force re-scan of working directory\n> \n> The fact that plumbing is necessary to dig yourself out of a hole of the\n> `eol` attribute changes points to something needing to be changed, even\n> if it's only documentation. Could Git detect this and message about it\n> somehow when `git reset` cannot fix the working tree?\n\nThe thing is, that the working tree is \"in a good state\":\nWe want \"dos\" with CRLF, and that is what we have.\nThere is nothing that can be improved in the working tree.\nWhat needs to be fixed, is the index. And that needs to be done with\n\"git add\" \"git commit.\"\nAs Junio pointed out, the read-tree is not ideal\n(to fix a single file in a possible dirty working tree)\n\nIn your case it looks like this:\n\n    echo \"dos eol=crlf\" > .gitattributes\n    git add .gitattributes &&\n    git rm --cached dos && git add dos &&\n    git commit\n\n\n> Or maybe it could at least exit with failure instead of success?\n\nI don't know.\nIt -may- be possible to add a warning in \"git reset\".\nI can have a look at that...\n\n"},{"id":"327086","messageId":"20170823210944.GA32462@megas.kitware.com","threadId":"46647","inReplyTo":"20170823194315.GA29237@tor.lan","subject":"Re: Cannot checkout after setting the eol attribute","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-23T21:09:44Z","receivedAt":"2017-08-23T21:09:50Z","isPatch":false,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"On Wed, Aug 23, 2017 at 21:43:15 +0200, Torsten Bögershausen wrote:\n> git reset does it's job - please see below.\n> \n> The problem is that we need a \"git commit\" here.\n> After applying .gitattributes, it may be neccessary to \"normalize\" the\n> files. If there is something in the documentation, that can be\n> improved, please let us know.\n\nI'll have a patch up shortly.\n\n> On Tue, Aug 22, 2017 at 03:44:41PM -0400, Ben Boeckel wrote:\n> > The fact that plumbing is necessary to dig yourself out of a hole of the\n> > `eol` attribute changes points to something needing to be changed, even\n> > if it's only documentation. Could Git detect this and message about it\n> > somehow when `git reset` cannot fix the working tree?\n> \n> The thing is, that the working tree is \"in a good state\":\n> We want \"dos\" with CRLF, and that is what we have.\n> There is nothing that can be improved in the working tree.\n> What needs to be fixed, is the index. And that needs to be done with\n> \"git add\" \"git commit.\"\n> As Junio pointed out, the read-tree is not ideal\n> (to fix a single file in a possible dirty working tree)\n> \n> In your case it looks like this:\n> \n>     echo \"dos eol=crlf\" > .gitattributes\n>     git add .gitattributes &&\n>     git rm --cached dos && git add dos &&\n>     git commit\n\nIn this case, just adding the file should work: the file is on-disk as\nintended and adding the file should normalize the line endings when\nadding it into the index (basically, just `git add dos` should be\nrequired to make the index look like it should).\n\n> > Or maybe it could at least exit with failure instead of success?\n> \n> I don't know.\n> It -may- be possible to add a warning in \"git reset\".\n> I can have a look at that...\n\nThanks.\n\n--Ben\n"},{"id":"327088","messageId":"20170823211741.9633-1-mathstuf@gmail.com","threadId":"46647","inReplyTo":"20170822174918.GA1005@megas.kitware.com","subject":"[PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-23T21:17:41Z","receivedAt":"2017-08-23T21:17:56Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"When setting the `eol` attribute, paths can change their dirty status\nwithout any change in the working directory. This can cause confusion\nand should at least be mentioned with a remedy.\n\nSigned-off-by: Ben Boeckel <mathstuf@gmail.com>\n---\n Documentation/gitattributes.txt | 6 +++++-\n 1 file changed, 5 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex c4f2be2..3044b71 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -151,7 +151,11 @@ unspecified.\n \n This attribute sets a specific line-ending style to be used in the\n working directory.  It enables end-of-line conversion without any\n-content checks, effectively setting the `text` attribute.\n+content checks, effectively setting the `text` attribute.  Note that\n+setting this attribute on paths which are in the index with different\n+line endings than the attribute indicates the paths to be considered\n+dirty.  Adding the path to the index again will normalize the line\n+endings in the index.\n \n Set to string value \"crlf\"::\n \n-- \n2.9.5\n\n"},{"id":"327090","messageId":"20170823212142.GA1659@megas.kitware.com","threadId":"46647","inReplyTo":"20170823211741.9633-1-mathstuf@gmail.com","subject":"Re: [PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-23T21:21:42Z","receivedAt":"2017-08-23T21:29:22Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"On Wed, Aug 23, 2017 at 17:17:41 -0400, Ben Boeckel wrote:\n> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\n> index c4f2be2..3044b71 100644\n> --- a/Documentation/gitattributes.txt\n> +++ b/Documentation/gitattributes.txt\n> @@ -151,7 +151,11 @@ unspecified.\n>  \n>  This attribute sets a specific line-ending style to be used in the\n>  working directory.  It enables end-of-line conversion without any\n> -content checks, effectively setting the `text` attribute.\n> +content checks, effectively setting the `text` attribute.  Note that\n> +setting this attribute on paths which are in the index with different\n> +line endings than the attribute indicates the paths to be considered\n\nOops, missed a \"causes\" in here. -----------^\n\nI'll wait on uploading a new patch until after feedback on this one.\n\n> +dirty.  Adding the path to the index again will normalize the line\n> +endings in the index.\n\n--Ben\n"},{"id":"327106","messageId":"20170824055054.GA32617@tor.lan","threadId":"46647","inReplyTo":"20170823211741.9633-1-mathstuf@gmail.com","subject":"Re: [PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-08-24T05:50:54Z","receivedAt":"2017-08-24T05:51:06Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On Wed, Aug 23, 2017 at 05:17:41PM -0400, Ben Boeckel wrote:\n> When setting the `eol` attribute, paths can change their dirty status\n> without any change in the working directory. This can cause confusion\n> and should at least be mentioned with a remedy.\n> \n> Signed-off-by: Ben Boeckel <mathstuf@gmail.com>\n> ---\n>  Documentation/gitattributes.txt | 6 +++++-\n>  1 file changed, 5 insertions(+), 1 deletion(-)\n> \n> diff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\n> index c4f2be2..3044b71 100644\n> --- a/Documentation/gitattributes.txt\n> +++ b/Documentation/gitattributes.txt\n> @@ -151,7 +151,11 @@ unspecified.\n>  \n>  This attribute sets a specific line-ending style to be used in the\n>  working directory.  It enables end-of-line conversion without any\n> -content checks, effectively setting the `text` attribute.\n> +content checks, effectively setting the `text` attribute.  Note that\n> +setting this attribute on paths which are in the index with different\n> +line endings than the attribute indicates the paths to be considered\n> +dirty.  Adding the path to the index again will normalize the line\n> +endings in the index.\n>  \n\nThere is one minor comment:\nThe problem is when files had been commited with CRLF (regardless what your\neol= attribute says)\n\nHow about something like this :\n\n  This attribute sets a specific line-ending style to be used in the\n  working directory.  It enables end-of-line conversion without any\n -content checks, effectively setting the `text` attribute.\n +content checks, effectively setting the `text` attribute.  Note that\n +setting this attribute on paths which are in the index with CRLF\n +line endings makes the paths to be considered dirty.\n +Adding the path to the index again will normalize the line\n +endings in the index.\n\n"},{"id":"327399","messageId":"20170830134959.GA28282@megas.kitware.com","threadId":"46647","inReplyTo":"20170824055054.GA32617@tor.lan","subject":"Re: [PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-30T13:49:59Z","receivedAt":"2017-08-30T13:51:21Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"On Thu, Aug 24, 2017 at 07:50:54 +0200, Torsten Bögershausen wrote:\n>   This attribute sets a specific line-ending style to be used in the\n>   working directory.  It enables end-of-line conversion without any\n>  -content checks, effectively setting the `text` attribute.\n>  +content checks, effectively setting the `text` attribute.  Note that\n>  +setting this attribute on paths which are in the index with CRLF\n>  +line endings makes the paths to be considered dirty.\n>  +Adding the path to the index again will normalize the line\n>  +endings in the index.\n\nYes, that sounds better. Will resubmit the patch.\n\n--Ben\n"},{"id":"327400","messageId":"20170830135932.1738-1-mathstuf@gmail.com","threadId":"46647","inReplyTo":"20170822174918.GA1005@megas.kitware.com","subject":"[PATCH v2] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-30T13:59:32Z","receivedAt":"2017-08-30T13:59:41Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"When setting the `eol` attribute, paths can change their dirty status\nwithout any change in the working directory. This can cause confusion\nand should at least be mentioned with a remedy.\n\nReviewed-by: Torsten Bögershausen <tboegi@web.de>\nSigned-off-by: Ben Boeckel <mathstuf@gmail.com>\n---\n Documentation/gitattributes.txt | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex c4f2be2..b940d37 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -151,7 +151,10 @@ unspecified.\n \n This attribute sets a specific line-ending style to be used in the\n working directory.  It enables end-of-line conversion without any\n-content checks, effectively setting the `text` attribute.\n+content checks, effectively setting the `text` attribute.  Note that\n+setting this attribute on paths which are in the index with CRLF line\n+endings makes the paths to be considered dirty.  Adding the path to the\n+index again will normalize the line endings in the index.\n \n Set to string value \"crlf\"::\n \n-- \n2.9.5\n\n"},{"id":"327471","messageId":"xmqqpobcpwst.fsf@gitster.mtv.corp.google.com","threadId":"46647","inReplyTo":"20170824055054.GA32617@tor.lan","subject":"Re: [PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-08-30T21:31:30Z","receivedAt":"2017-08-30T21:31:39Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Torsten Bögershausen <tboegi@web.de> writes:\n\n> How about something like this :\n>\n>   This attribute sets a specific line-ending style to be used in the\n>   working directory.  It enables end-of-line conversion without any\n>  -content checks, effectively setting the `text` attribute.\n>  +content checks, effectively setting the `text` attribute.  Note that\n>  +setting this attribute on paths which are in the index with CRLF\n>  +line endings makes the paths to be considered dirty.\n\nIs this \"always makes them dirty\" or \"may make them dirty depending\non the situation\"?  \n\nIf the latter, I'd prefer to see s/makes/may make/ here.\n\n\n"},{"id":"327480","messageId":"20170831131644.GB22212@megas.kitware.com","threadId":"46647","inReplyTo":"xmqqpobcpwst.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-31T13:16:44Z","receivedAt":"2017-08-31T13:16:50Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"On Wed, Aug 30, 2017 at 14:31:30 -0700, Junio C Hamano wrote:\n> Is this \"always makes them dirty\" or \"may make them dirty depending\n> on the situation\"?  \n> \n> If the latter, I'd prefer to see s/makes/may make/ here.\n\nYes, a coworker reported that some files slipped through this. New patch\nincoming.\n\n--Ben\n"},{"id":"327481","messageId":"20170831131936.26226-1-mathstuf@gmail.com","threadId":"46647","inReplyTo":"20170822174918.GA1005@megas.kitware.com","subject":"[PATCH v3] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Ben Boeckel","fromEmail":"mathstuf@gmail.com","sentAt":"2017-08-31T13:19:36Z","receivedAt":"2017-08-31T13:19:49Z","isPatch":true,"sender":{"key":"mathstuf@gmail.com","avatar":"https://avatars.githubusercontent.com/u/97253?v=4"},"body":"When setting the `eol` attribute, paths can change their dirty status\nwithout any change in the working directory. This can cause confusion\nand should at least be mentioned with a remedy.\n\nReviewed-by: Torsten Bögershausen <tboegi@web.de>\nReviewed-by: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Ben Boeckel <mathstuf@gmail.com>\n---\n Documentation/gitattributes.txt | 5 ++++-\n 1 file changed, 4 insertions(+), 1 deletion(-)\n\ndiff --git a/Documentation/gitattributes.txt b/Documentation/gitattributes.txt\nindex c4f2be2..4c68bc1 100644\n--- a/Documentation/gitattributes.txt\n+++ b/Documentation/gitattributes.txt\n@@ -151,7 +151,10 @@ unspecified.\n \n This attribute sets a specific line-ending style to be used in the\n working directory.  It enables end-of-line conversion without any\n-content checks, effectively setting the `text` attribute.\n+content checks, effectively setting the `text` attribute.  Note that\n+setting this attribute on paths which are in the index with CRLF line\n+endings may make the paths to be considered dirty.  Adding the path to\n+the index again will normalize the line endings in the index.\n \n Set to string value \"crlf\"::\n \n-- \n2.9.5\n\n"},{"id":"327484","messageId":"78c1a85a-70c1-ff35-466e-f6c363a0c632@web.de","threadId":"46647","inReplyTo":"20170831131936.26226-1-mathstuf@gmail.com","subject":"Re: [PATCH v3] Documentation: mention that `eol` can change the dirty status of paths","fromName":"Torsten Bögershausen","fromEmail":"tboegi@web.de","sentAt":"2017-08-31T14:33:14Z","receivedAt":"2017-08-31T14:33:29Z","isPatch":true,"sender":{"key":"tboegi@web.de","avatar":"https://avatars.githubusercontent.com/u/7138363?v=4"},"body":"On 2017-08-31 15:19, Ben Boeckel wrote:\n\n>  This attribute sets a specific line-ending style to be used in the\n>  working directory.  It enables end-of-line conversion without any\n> -content checks, effectively setting the `text` attribute.\n> +content checks, effectively setting the `text` attribute.  Note that\n> +setting this attribute on paths which are in the index with CRLF line\n> +endings may make the paths to be considered dirty.  Adding the path to\n\nOK - and this leads to another question:\n\nWould it make sense if we allow files with \"text eol=CRLF\" to continue\nto be stored with CRLF in the index?\n\nSkip the normalization for existing files, since the user asked\nfor CRLF in the working tree (and the internal storage is less interesting)\n\nShould I consider a patch ?\n"}]}