{"thread":{"id":"45850","subject":"[PATCH 0/5] Abide by our own rules regarding line endings","startedAt":"2017-05-02T12:30:11Z","lastAt":"2017-05-23T09:01:36Z","messageCount":39,"participants":["Johannes Schindelin","Jonathan Nieder","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":5},"messages":[{"id":"318489","messageId":"cover.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":null,"subject":"[PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:29:44Z","receivedAt":"2017-05-02T12:30:11Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Over the past decade, there have been a couple of attempts to remedy the\nsituation regarding line endings (Windows/DOS line endings are\ntraditionally CR/LF even if many current applications can handle LF,\ntoo, Linux/MacOSX/*BSD/Unix uses LF-only line handlings, and old MacOS\nsoftware used to use CR-only line endings).\n\nThe current idea seems to be that the default line endings differ\ndepending on the platform, and for files that should be exempt from that\ndefault, we strongly recommend using .gitattributes to define what the\nsource code requires.\n\nIt is time to heed our own recommendation and mark the files that\nrequire LF-only line endings in our very own .gitattributes.\n\nFor starters, those files include shell scripts: the most prevalent\nshell interpreter in use (and certainly used in Git for Windows) is\nBash, and Bash does not handle CR/LF line endings gracefully.\n\nThere are even two shell scripts that are used in the test suite even if\nthey are not technically supposed to be part of core Git, as indicated\nby their habitat inside contrib/: git-new-workdir and\ngit-completion.bash.\n\nRelated to shell scripts: when generating common-cmds.h, we use tools\nthat generally operate on the assumption that input and output\ndeliminate their lines using LF-only line endings. Consequently, they\nwould happily copy the CR byte verbatim into the strings in\ncommon-cmds.h, which in turn makes the C preprocessor barf (that\ninterprets them as MacOS-style line endings).\n\nFurther, the most obvious required fixes concern tests' support files\ncommitted verbatim, to be compared to Git's output, which is always\nLF-only.\n\nThere are a few SVN dump files, too, supporting the Subversion-related\ntests, requiring LF-only line endings.\n\nFinally, the test suite makes use of text files that are not obviously\nsupporting tests, such as t/README, comparing them to LF-only versions\n(and consequently failing if the files have been checked out with CR/LF\nline endings). Therefore we need to mark those as LF-only in the\n.gitattributes, too.\n\nWithout these fixes, Git will fail to build and pass the test suite, as\ncan be verified even on Linux using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake DEVELOPER=1 -j15 test\n\nNote: I separated out the change marking t/t4051/* as LF-only into an\nindividual commit for one reason: it would appear that the test passes\nif checked out using core.autocrlf=true on Linux, but on Windows the\ntest fails. In that respect, this test is special, as the other changes\ncan be easily validated even without using Windows.\n\n\nJohannes Schindelin (5):\n  Fix build with core.autocrlf=true\n  git-new-workdir: mark script as LF-only\n  completion: mark bash script as LF-only\n  Fix the remaining tests that failed with core.autocrlf=true\n  t4051: mark supporting files as requiring LF-only line endings\n\n .gitattributes                    |  8 +++++++-\n contrib/completion/.gitattributes |  1 +\n contrib/workdir/.gitattributes    |  1 +\n git-gui/.gitattributes            |  1 +\n t/.gitattributes                  | 29 ++++++++++++++++++++++++++++-\n 5 files changed, 38 insertions(+), 2 deletions(-)\n create mode 100644 contrib/completion/.gitattributes\n create mode 100644 contrib/workdir/.gitattributes\n\n\nbase-commit: d2bbb7c2bcf6e77ebfcabf4e12110fe6d5c91de6\nPublished-As: https://github.com/dscho/git/releases/tag/lf-attrs-v1\nFetch-It-Via: git fetch https://github.com/dscho/git lf-attrs-v1\n\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n"},{"id":"318490","messageId":"c11f7f4f29d156250dd3c3df3af29b0f3bde2b87.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH 2/5] git-new-workdir: mark script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:30:30Z","receivedAt":"2017-05-02T12:30:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Bash does not handle scripts with CR/LF line endings correctly, therefore\nthey *have* to be forced to LF-only line endings.\n\nFunnily enough, this fixes t3000-ls-files-others and\nt1021-rerere-in-workdir when git.git was checked out with\ncore.autocrlf=true, as these test still use git-new-workdir (once `git\nworktree` is no longer marked as experimental, both scripts probably\nwant to be ported to using that command instead).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/workdir/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/workdir/.gitattributes\n\ndiff --git a/contrib/workdir/.gitattributes b/contrib/workdir/.gitattributes\nnew file mode 100644\nindex 00000000000..1f78c5d1bd3\n--- /dev/null\n+++ b/contrib/workdir/.gitattributes\n@@ -0,0 +1 @@\n+/git-new-workdir eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318491","messageId":"2232589c0368c286ae757817842ba5452a6986e4.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH 1/5] Fix build with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:30:27Z","receivedAt":"2017-05-02T12:30:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, the default line endings are denoted by a Carriage Return\nbyte followed by a Line Feed byte, while Linux and MacOSX use a single\nLine Feed byte to denote a line ending.\n\nTo help with this situation, Git introduced several mechanisms over the\nlast decade, most prominently the `core.autocrlf` setting.\n\nSometimes, however, a single setting is incorrect, e.g. when certain\nfiles in the source code are to be consumed by software that can handle\nonly LF line endings, while other files can use whatever is appropriate\nfor the current platform.\n\nTo allow for that, Git added the `eol` option to its .gitattributes\nhandling, expecting every user of Git to mark their source code\nappropriately.\n\nBash assumes that line-endings of scripts are denoted by a single Line\nFeed byte. Therefore, shell scripts in Git's source code are one example\nwhere that `eol=lf` option is *required*.\n\nWhen generating common-cmds.h, the Unix tools we use generally operate on\nthe assumption that input and output deliminate their lines using LF-only\nline endings. Consequently, they would happily copy the CR byte verbatim\ninto the strings in common-cmds.h, which in turn makes the C preprocessor\nbarf (that interprets them as MacOS-style line endings). Therefore, we\nhave to mark the input files as LF-only: command-list.txt and\nDocumentation/git-*.txt.\n\nQuite a bit belatedly, this patch brings Git's own source code in line\nwith those expectations by setting those attributes to allow for a\ncorrect build even when core.autocrlf=true.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitattributes         | 8 +++++++-\n git-gui/.gitattributes | 1 +\n 2 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/.gitattributes b/.gitattributes\nindex 320e33c327c..8ce9c6b8888 100644\n--- a/.gitattributes\n+++ b/.gitattributes\n@@ -1,3 +1,9 @@\n * whitespace=!indent,trail,space\n *.[ch] whitespace=indent,trail,space diff=cpp\n-*.sh whitespace=indent,trail,space\n+*.sh whitespace=indent,trail,space eol=lf\n+*.perl eol=lf\n+*.pm eol=lf\n+/Documentation/git-*.txt eol=lf\n+/command-list.txt eol=lf\n+/GIT-VERSION-GEN eol=lf\n+/mergetools/* eol=lf\ndiff --git a/git-gui/.gitattributes b/git-gui/.gitattributes\nindex 33d07c06bd9..59cd41dbff7 100644\n--- a/git-gui/.gitattributes\n+++ b/git-gui/.gitattributes\n@@ -2,3 +2,4 @@\n *           encoding=US-ASCII\n git-gui.sh  encoding=UTF-8\n /po/*.po    encoding=UTF-8\n+/GIT-VERSION-GEN eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318492","messageId":"56201ef047812b6ff1746e54a643f65710d49bf0.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH 3/5] completion: mark bash script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:30:33Z","receivedAt":"2017-05-02T12:30:45Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Without this change, the completion script does not work, as Bash expects\nits scripts to have line feeds as end-of-line markers (this is\nparticularly prominent in quoted multi-line strings, where carriage\nreturns would slip into the strings as verbatim characters otherwise).\n\nThis change is required to let t9902-completion pass when Git's source\ncode is checked out with `core.autocrlf = true`.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/completion/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/completion/.gitattributes\n\ndiff --git a/contrib/completion/.gitattributes b/contrib/completion/.gitattributes\nnew file mode 100644\nindex 00000000000..19116944c15\n--- /dev/null\n+++ b/contrib/completion/.gitattributes\n@@ -0,0 +1 @@\n+*.bash eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318493","messageId":"0776edd9602ec279699ea6750c4c9e54994ff06d.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH 5/5] t4051: mark supporting files as requiring LF-only line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:30:56Z","receivedAt":"2017-05-02T12:31:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test t4051-diff-function-context.sh seems to pass on Linux when\ncore.autocrlf=true even without marking its support files as LF-only,\nbut they fail when core.autocrlf=true in Git for Windows' SDK.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 4064eba354d..1bdc46a53f1 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -7,6 +7,7 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n /t4034/*/* eol=lf\n /t4013/* eol=lf\n /t4018/* eol=lf\n+/t4051/* eol=lf\n /t4100/* eol=lf\n /t4101/* eol=lf\n /t4109/* eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n"},{"id":"318494","messageId":"543904d5608af500617eb4094a8b40cce29f55b8.1493728172.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH 4/5] Fix the remaining tests that failed with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-02T12:30:37Z","receivedAt":"2017-05-02T12:31:14Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test suite is mainly developed on Linux and MacOSX, which is the\nreason that nobody thought to mark files as LF-only as needed.\n\nThe symptom is a test suite that fails left and right when being checked\nout using Git for Windows (which defaults to core.autocrlf=true).\n\nMostly, the problems stem from Git's (LF-only) output being compared to\nhard-coded files that are checked out with line endings according to\ncore.autocrlf (which is of course incorrect).\n\nNote: the test suite also uses the t/README file as well as the COPYING\nfile in t/diff-lib/, expecting LF-only line endings explicitly and\nfailing if that assumption does not hold true. That is why we mark them\nas LF-only in the .gitattributes, too.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/.gitattributes | 28 +++++++++++++++++++++++++++-\n 1 file changed, 27 insertions(+), 1 deletion(-)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 2d44088f56e..4064eba354d 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -1,2 +1,28 @@\n+README eol=lf\n t[0-9][0-9][0-9][0-9]/* -whitespace\n-t0110/url-* binary\n+/diff-lib/COPYING eol=lf\n+/t0110/url-* binary\n+/t3900/*.txt eol=lf\n+/t3901*.txt eol=lf\n+/t4034/*/* eol=lf\n+/t4013/* eol=lf\n+/t4018/* eol=lf\n+/t4100/* eol=lf\n+/t4101/* eol=lf\n+/t4109/* eol=lf\n+/t4110/* eol=lf\n+/t4135/* eol=lf\n+/t4211/* eol=lf\n+/t4252/* eol=lf\n+/t5100/* eol=lf\n+/t5515/* eol=lf\n+/t556x_common eol=lf\n+/t7500/* eol=lf\n+/t8005/*.txt eol=lf\n+/t9110/svm.dump eol=lf\n+/t9111/svnsync.dump eol=lf\n+/t9115/funky-names.dump eol=lf\n+/t9121/renamed-dir.dump eol=lf\n+/t913[56]/svn.dump eol=lf\n+/t915[0134]/*.dump eol=lf\n+/t9161/branches.dump eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318569","messageId":"20170502215627.GX28740@aiede.svl.corp.google.com","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-05-02T21:56:27Z","receivedAt":"2017-05-02T21:56:35Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"Hi,\n\nJohannes Schindelin wrote:\n\n> Over the past decade, there have been a couple of attempts to remedy the\n[...]\n\nI'm intentionally skimming this cover letter, since anything important\nit says needs to also be in the commit messages.\n\n[...]\n> Without these fixes, Git will fail to build and pass the test suite, as\n> can be verified even on Linux using this cadence:\n>\n> \tgit config core.autocrlf true\n> \trm .git/index && git stash\n> \tmake DEVELOPER=1 -j15 test\n\nThis should go in a commit message (or perhaps in all of them).\n\n[...]\n> Johannes Schindelin (5):\n>   Fix build with core.autocrlf=true\n>   git-new-workdir: mark script as LF-only\n>   completion: mark bash script as LF-only\n>   Fix the remaining tests that failed with core.autocrlf=true\n>   t4051: mark supporting files as requiring LF-only line endings\n\nWith or without that change,\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThe t/README bit in patch 4/5 is sad (I want to be able to open\nt/README using an old version of Notepad) but changing that test to\nuse another file seems out of scope for what this series does.\n\nThanks,\nJonathan\n"},{"id":"318650","messageId":"alpine.DEB.2.20.1705031323390.3480@virtualbox","threadId":"45850","inReplyTo":"20170502215627.GX28740@aiede.svl.corp.google.com","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-03T14:23:15Z","receivedAt":"2017-05-03T14:23:49Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Jonathan,\n\nOn Tue, 2 May 2017, Jonathan Nieder wrote:\n\n> Johannes Schindelin wrote:\n> \n> > Over the past decade, there have been a couple of attempts to remedy the\n> [...]\n> \n> I'm intentionally skimming this cover letter, since anything important\n> it says needs to also be in the commit messages.\n\nSure, makes sense. I tried to do that, too, before sending out my patch\nseries.\n\n> [...]\n> > Without these fixes, Git will fail to build and pass the test suite, as\n> > can be verified even on Linux using this cadence:\n> >\n> > \tgit config core.autocrlf true\n> > \trm .git/index && git stash\n> > \tmake DEVELOPER=1 -j15 test\n> \n> This should go in a commit message (or perhaps in all of them).\n\nHmm, okay. I wanted to keep it out of them, as commit messages are (in my\nmind) more about the why?, and a little less about the how? when not\nobvious from the diff.\n\nI added a variation to the first patch (because the tests would still\nfail, I skipped the `test` from the `make` invocation) and the unmodified\ncadence to the \"Fix the remaining tests...\" patch.\n\n> [...]\n> > Johannes Schindelin (5):\n> >   Fix build with core.autocrlf=true\n> >   git-new-workdir: mark script as LF-only\n> >   completion: mark bash script as LF-only\n> >   Fix the remaining tests that failed with core.autocrlf=true\n> >   t4051: mark supporting files as requiring LF-only line endings\n> \n> With or without that change,\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n\nThanks.\n\nI added that footer to the patches (not to the two new ones, though).\n\n> The t/README bit in patch 4/5 is sad (I want to be able to open\n> t/README using an old version of Notepad) but changing that test to\n> use another file seems out of scope for what this series does.\n\nYes, it is sad. Maybe I should list the tests that do this (use files\noutside any tNNNN/ directory):\n\nt4003-diff-rename-1.sh (uses t/diff-lib/COPYING)\nt4005-diff-rename-2.sh (uses t/diff-lib/COPYING)\nt4007-rename-3.sh (uses t/diff-lib/COPYING)\nt4008-diff-break-rewrite.sh (uses t/diff-lib/README and t/diff-lib/COPYING)\nt4009-diff-rename-4.sh (uses t/diff-lib/COPYING)\nt4022-diff-rewrite.sh (uses COPYING)\nt4023-diff-rename-typechange.sh (uses COPYING)\nt7001-mv.sh (uses README.md (!!!) and COPYING)\nt7060-wtstatus.sh (uses t/README)\nt7101-reset-empty-subdirs.sh (uses COPYING)\n\nNote most of these tests may *use* those files, but do *not* assume that\nthey have Unix line endings! Only a couple test compare SHA-1s to\nhardcoded values (which, if you ask me, is a bit fragile, given that files\noutside the tests' control are used).\n\nInteresting side note: t0022-crlf-rename.sh copies *itself* to the trash*\ndirectory where it is then used to perform tests. So while this test uses\n\"an outside file\", that file happens to be a .sh file which we already\nhave to mark LF-only for different reasons (Bash likes its input\nCR/LF-free).\n\nAnother interesting side note: the convention appears to dictate that\nsupporting files should be either generated in the test script itself, or\nbe committed into t/tNNNN/ directories (where NNNN matches the respective\ntest script's number, or reuses another test script's supporting files). A\nnotable exception is t3901 which has the supporting files t3901-8859-1.txt\nand t3901-utf8.txt. I would wageer that this is just a remnant of ancient\ntimes before the current convention, judging by the date of the commit\nthat added these files: a731ec5eb82 (t3901: test \"format-patch | am\" pipe\nwith i18n, 2007-01-13). The scripts t0203-gettext-setlocale-sanity.sh,\nt9350-fast-export.sh and t9500-gitweb-standalone-no-errors.sh merely reuse\nthose files, and when those scripts started using those files, they did\nnot change their location. I made this move a preparatory step in this\npatch series.\n\nBack to the question what to do about those tests that make improper\nassumptions about line endings of files outside the tests' realm: I think\nI can do this more cleverly, as it would appear that only four test\nscripts make hard assumptions about the exact byte sequence of the COPYING\nfile, and I simply turned those `cp` (and even `cat`!) calls into `tr -d\n\"\\015\"` calls.\n\nI will Cc: you on v2.\n\nCiao,\nDscho\n"},{"id":"318723","messageId":"xmqqpofp9p1r.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-04T05:19:44Z","receivedAt":"2017-05-04T05:19:53Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> For starters, those files include shell scripts: the most prevalent\n> shell interpreter in use (and certainly used in Git for Windows) is\n> Bash, and Bash does not handle CR/LF line endings gracefully.\n\nGood to know.  I am not sure if it is OK for shell scripts not to\nhonor the platform convention, though.\n\nStated from the opposite angle, I would not be surprised if your\nshell scripts do not work on Linux if you set core.autocrlf to true.\nGit may honor it, but shells on Linux (or BSD for that matter) do\nnot pay attention to core.autocrlf and they are within their rights\nto complain on an extra CR at the end of the line.  IOW, I would\ndoubt that it should be our goal to set core.autocrlf on a platform\nwhose native line endings is LF and make the tests to pass.\n\n> Related to shell scripts: when generating common-cmds.h, we use tools\n> that generally operate on the assumption that input and output\n> deliminate their lines using LF-only line endings. Consequently, they\n> would happily copy the CR byte verbatim into the strings in\n> common-cmds.h, which in turn makes the C preprocessor barf (that\n> interprets them as MacOS-style line endings).\n\nThis indeed is a problem.  \"add\\r\" is not a name of a common\ncommand, obviously, regardless of how the text file that lists the\nnames of the commands is encoded.  I am undecided if it is a problem\nin the source text (i.e. command-list.txt is not a platform neutral\n\"text\" but has to be encoded with LF endings) or the bug in the\ntools used in the generate-cmdlist.sh script, though.  Shouldn't the\ntools be aware of the platform convention of what text files are and\nhow their eol looks like?\n\n\n"},{"id":"318741","messageId":"alpine.DEB.2.21.1.1705041129170.4905@virtualbox","threadId":"45850","inReplyTo":"xmqqpofp9p1r.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:47:03Z","receivedAt":"2017-05-04T09:47:35Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Wed, 3 May 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > For starters, those files include shell scripts: the most prevalent\n> > shell interpreter in use (and certainly used in Git for Windows) is\n> > Bash, and Bash does not handle CR/LF line endings gracefully.\n> \n> Good to know.  I am not sure if it is OK for shell scripts not to honor\n> the platform convention, though.\n\nWell, a couple of comments about your comment:\n\n- we say \"shell scripts\", but we're sloppy there: they are \"Unix shell\n  scripts\", as they are executed by Unix shells. As such, it is pretty\n  obvious that they favor Unix line endings, right? And that they do not\n  really handle anything else well, right?\n\n- You try to say that it is not okay for shell scripts to be checked\n  out as LF-only when the platform convention for *text* files is CR/LF,\n  right? Please note that if you follow through on this thought, you are\n  very close to recommending to render shell scripts dysfunctional by\n  checking them out with CR/LF endings.\n\nThat latter point, to recommend to break shell scripts, is something I\nreally fail to understand...\n\n> Stated from the opposite angle, I would not be surprised if your\n> shell scripts do not work on Linux if you set core.autocrlf to true.\n> Git may honor it, but shells on Linux (or BSD for that matter) do\n> not pay attention to core.autocrlf and they are within their rights\n> to complain on an extra CR at the end of the line.  IOW, I would\n> doubt that it should be our goal to set core.autocrlf on a platform\n> whose native line endings is LF and make the tests to pass.\n\nSee? I *knew* it was a mistake to follow Jonathan's recommendation to make\nthis \"you can reproduce this even on Linux\" comment part of the commit\nmessage.\n\nI *never* asked to make core.autocrlf=true the default on Linux.\n\nAll I did was to point out that you do not need Windows to reproduce the\nproblems.\n\nThat is really a far cry from trying to convince anybody that it makes\nsense to require Git to pass the build & tests with core.autocrlf=true *on\nLinux*.\n\nI want to make it pass on Windows, yes, and I do not want to force anybody\nwith a Linux setup to get a (free) Windows VM to test this. I want it to\npass on Windows, and to make it easier for you Linux-only folks, I tried\nto give you a way to start validating my claims that core.autocrlf=true\nwas introduced by Git without even bothering to let Git itself build and\npass the test suite with that setting.\n\n> > Related to shell scripts: when generating common-cmds.h, we use tools\n> > that generally operate on the assumption that input and output\n> > deliminate their lines using LF-only line endings. Consequently, they\n> > would happily copy the CR byte verbatim into the strings in\n> > common-cmds.h, which in turn makes the C preprocessor barf (that\n> > interprets them as MacOS-style line endings).\n> \n> This indeed is a problem.  \"add\\r\" is not a name of a common\n> command, obviously,\n\nPlease note that it is not \"add\\r\" that is part of the common-cmds.h file\nas generated by current git.git's `master` with core.autocrlf=true. I.e.\nit is not the sequence containing a backslash followed by an `r`.\n\nIt is actually \"add<CR>\", which the GNU C preprocessor interprets as a\nline break in the middle of the string constant (most likely for\nbackwards-compatibility with MacOS, where line breaks were indicated by\nCarriage Returns *without* Line Feeds).\n\n> regardless of how the text file that lists the names of the commands is\n> encoded.  I am undecided if it is a problem in the source text (i.e.\n> command-list.txt is not a platform neutral \"text\" but has to be encoded\n> with LF endings) or the bug in the tools used in the generate-cmdlist.sh\n> script, though.  Shouldn't the tools be aware of the platform convention\n> of what text files are and how their eol looks like?\n\nI wonder why we spend so much time on discussing this issue, really.\n\nClearly, command-list.txt is *intended* as input for scripts. We do not\nship the file verbatim to the end user, we only pass it through sed to\ngenerate common-cmds.h, we pass it through sed to verify the completeness\nof the docs, and we pass it through the Perl script\nDocumentation/cmd-list.perl to generate certain command lists intended for\ninclusion in the man page.\n\nIn all cases, we expect to feed the contents of this file to Unix shell\nscripts and/or Unix tools.\n\nIs it so unobvious that the input should be crafted to fulfill that role\nas best as it can by catering to Unix tools?\n\nAnd if you truly think that we should use different tools based on the\nplatform, then you will have to swallow the rather large pill that Git's\nown very heavy use of Unix shell scripting was a big, big mistake from the\nbeginning.\n\nI doubt you are ready to accept that yet...\n\nCiao,\nDscho\n"},{"id":"318742","messageId":"cover.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493728172.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 0/7] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:49:15Z","receivedAt":"2017-05-04T09:49:34Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"[Cc:ing Jonathan Nieder, who reviewed the first iteration of this patch\nseries, and Jeff Hostetler who is guilty of prodding me into finishing\nthis patch series in the first place.]\n\nOver the past decade, there have been a couple of attempts to remedy the\nsituation regarding line endings (Windows/DOS line endings are\ntraditionally CR/LF even if many current applications can handle LF,\ntoo, Linux/MacOSX/*BSD/Unix uses LF-only line handlings, and old MacOS\nsoftware used to use CR-only line endings).\n\nThe current idea seems to be that the default line endings differ\ndepending on the platform, and for files that should be exempt from that\ndefault, we strongly recommend using .gitattributes to define what the\nsource code requires.\n\nIt is time to heed our own recommendation and mark the files that\nrequire LF-only line endings in our very own .gitattributes.\n\nFor starters, those files include shell scripts: the most prevalent\nshell interpreter in use (and certainly used in Git for Windows) is\nBash, and Bash does not handle CR/LF line endings gracefully.\n\nThere are even two shell scripts that are used in the test suite even if\nthey are not technically supposed to be part of core Git, as indicated\nby their habitat inside contrib/: git-new-workdir and\ngit-completion.bash.\n\nRelated to shell scripts: when generating common-cmds.h, we use tools\nthat generally operate on the assumption that input and output\ndeliminate their lines using LF-only line endings. Consequently, they\nwould happily copy the CR byte verbatim into the strings in\ncommon-cmds.h, which in turn makes the C preprocessor barf (that\ninterprets them as MacOS-style line endings).\n\nFurther, the most obvious required fixes concern tests' support files\ncommitted verbatim, to be compared to Git's output, which is always\nLF-only.\n\nThere are a few SVN dump files, too, supporting the Subversion-related\ntests, requiring LF-only line endings.\n\nFinally, the test suite makes use of text files that are not obviously\nsupporting tests, such as t/README, comparing them to LF-only versions\n(and consequently failing if the files have been checked out with CR/LF\nline endings). Therefore we convert those to LF-only versions when\nthe test hard-codes that expectation.\n\nWithout these fixes, Git will fail to build and pass the test suite, as\ncan be verified even on Linux using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake DEVELOPER=1 -j15 test\n\nNote: I separated out the change marking t/t4051/* as LF-only into an\nindividual commit for one reason: it would appear that the test passes\nif checked out using core.autocrlf=true on Linux, but on Windows the\ntest fails. In that respect, this test is special, as the other changes\ncan be easily validated even without using Windows.\n\nChanges since v1:\n\n- the t/t3901-*.txt files have been moved into t/t3901/, in line with\n  the de facto convention all other tests follow.\n\n- instead of marking files outside of t/t[0-9]* as LF-only, the\n  following tests are now adjusted *not* to expect LF-only line endings\n  in files they do not control: t4003, t4005, t4007 & t4008.\n\n- as a consequence, files used in the tests but living outside\n  t/t[0-9]*, such as COPYING, etc, are no longer marked as LF-only.\n\n- clarified in the commit message of the last patch why t4051 passes on\n  Linux with core.autocrlf=true but not on Windows.\n\n\nJohannes Schindelin (7):\n  Fix build with core.autocrlf=true\n  git-new-workdir: mark script as LF-only\n  completion: mark bash script as LF-only\n  t3901: move supporting files into t/t3901/\n  t4003, t4005, t4007 & t4008: handle CR/LF in t/README &\n    t/diff-lib/README\n  Fix the remaining tests that failed with core.autocrlf=true\n  t4051: mark supporting files as requiring LF-only line endings\n\n .gitattributes                           |  8 ++++++-\n contrib/completion/.gitattributes        |  1 +\n contrib/workdir/.gitattributes           |  1 +\n git-gui/.gitattributes                   |  1 +\n t/.gitattributes                         | 21 +++++++++++++++++-\n t/t0203-gettext-setlocale-sanity.sh      |  4 ++--\n t/t3901-i18n-patch.sh                    | 38 ++++++++++++++++----------------\n t/{t3901-8859-1.txt => t3901/8859-1.txt} |  0\n t/{t3901-utf8.txt => t3901/utf8.txt}     |  0\n t/t4003-diff-rename-1.sh                 |  4 ++--\n t/t4005-diff-rename-2.sh                 |  4 ++--\n t/t4007-rename-3.sh                      |  2 +-\n t/t4008-diff-break-rewrite.sh            |  4 ++--\n t/t9350-fast-export.sh                   |  2 +-\n t/t9500-gitweb-standalone-no-errors.sh   |  4 ++--\n 15 files changed, 61 insertions(+), 33 deletions(-)\n create mode 100644 contrib/completion/.gitattributes\n create mode 100644 contrib/workdir/.gitattributes\n rename t/{t3901-8859-1.txt => t3901/8859-1.txt} (100%)\n rename t/{t3901-utf8.txt => t3901/utf8.txt} (100%)\n\n\nbase-commit: d2bbb7c2bcf6e77ebfcabf4e12110fe6d5c91de6\nPublished-As: https://github.com/dscho/git/releases/tag/lf-attrs-v2\nFetch-It-Via: git fetch https://github.com/dscho/git lf-attrs-v2\n\nInterdiff vs v1:\n\n diff --git a/t/.gitattributes b/t/.gitattributes\n index 1bdc46a53f1..bdd82cf31f7 100644\n --- a/t/.gitattributes\n +++ b/t/.gitattributes\n @@ -1,9 +1,7 @@\n -README eol=lf\n  t[0-9][0-9][0-9][0-9]/* -whitespace\n -/diff-lib/COPYING eol=lf\n  /t0110/url-* binary\n  /t3900/*.txt eol=lf\n -/t3901*.txt eol=lf\n +/t3901/*.txt eol=lf\n  /t4034/*/* eol=lf\n  /t4013/* eol=lf\n  /t4018/* eol=lf\n @@ -20,10 +18,4 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n  /t556x_common eol=lf\n  /t7500/* eol=lf\n  /t8005/*.txt eol=lf\n -/t9110/svm.dump eol=lf\n -/t9111/svnsync.dump eol=lf\n -/t9115/funky-names.dump eol=lf\n -/t9121/renamed-dir.dump eol=lf\n -/t913[56]/svn.dump eol=lf\n -/t915[0134]/*.dump eol=lf\n -/t9161/branches.dump eol=lf\n +/t9*/*.dump eol=lf\n diff --git a/t/t0203-gettext-setlocale-sanity.sh b/t/t0203-gettext-setlocale-sanity.sh\n index a2124600811..71b0d74b4dd 100755\n --- a/t/t0203-gettext-setlocale-sanity.sh\n +++ b/t/t0203-gettext-setlocale-sanity.sh\n @@ -8,7 +8,7 @@ test_description=\"The Git C functions aren't broken by setlocale(3)\"\n  . ./lib-gettext.sh\n  \n  test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \ttest_commit \"iso-c-commit\" iso-under-c &&\n  \tgit show >out 2>err &&\n  \t! test -s err &&\n @@ -16,7 +16,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n  '\n  \n  test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 locale' '\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \ttest_commit \"iso-utf8-commit\" iso-under-utf8 &&\n  \tLANGUAGE=is LC_ALL=\"$is_IS_locale\" git show >out 2>err &&\n  \t! test -s err &&\n diff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\n index f663d567c8a..923eb01f0ea 100755\n --- a/t/t3901-i18n-patch.sh\n +++ b/t/t3901-i18n-patch.sh\n @@ -31,7 +31,7 @@ test_expect_success setup '\n  \n  \t# use UTF-8 in author and committer name to match the\n  \t# i18n.commitencoding settings\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \ttest_tick &&\n  \techo \"$GIT_AUTHOR_NAME\" >mine &&\n @@ -55,7 +55,7 @@ test_expect_success setup '\n  \t\t# the second one on the side branch is ISO-8859-1\n  \t\tgit config i18n.commitencoding ISO8859-1 &&\n  \t\t# use author and committer name in ISO-8859-1 to match it.\n -\t\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt\n +\t\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt\n  \tfi &&\n  \ttest_tick &&\n  \techo Yet another >theirs &&\n @@ -100,7 +100,7 @@ test_expect_success 'rebase (U/U)' '\n  \n  \t# The result will be committed by GIT_COMMITTER_NAME --\n  \t# we want UTF-8 encoded name.\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \tgit checkout -b test &&\n  \tgit rebase master &&\n  \n @@ -110,7 +110,7 @@ test_expect_success 'rebase (U/U)' '\n  test_expect_success 'rebase (U/L)' '\n  \tgit config i18n.commitencoding UTF-8 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase master &&\n @@ -122,7 +122,7 @@ test_expect_success !MINGW 'rebase (L/L)' '\n  \t# In this test we want ISO-8859-1 encoded commits as the result\n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase master &&\n @@ -135,7 +135,7 @@ test_expect_success !MINGW 'rebase (L/U)' '\n  \t# to get ISO-8859-1 results.\n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase master &&\n @@ -148,7 +148,7 @@ test_expect_success 'cherry-pick(U/U)' '\n  \n  \tgit config i18n.commitencoding UTF-8 &&\n  \tgit config i18n.logoutputencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit cherry-pick side^ &&\n @@ -163,7 +163,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '\n  \n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit cherry-pick side^ &&\n @@ -178,7 +178,7 @@ test_expect_success 'cherry-pick(U/L)' '\n  \n  \tgit config i18n.commitencoding UTF-8 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit cherry-pick side^ &&\n @@ -194,7 +194,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n  \n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit cherry-pick side^ &&\n @@ -207,7 +207,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n  test_expect_success 'rebase --merge (U/U)' '\n  \tgit config i18n.commitencoding UTF-8 &&\n  \tgit config i18n.logoutputencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase --merge master &&\n @@ -218,7 +218,7 @@ test_expect_success 'rebase --merge (U/U)' '\n  test_expect_success 'rebase --merge (U/L)' '\n  \tgit config i18n.commitencoding UTF-8 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase --merge master &&\n @@ -230,7 +230,7 @@ test_expect_success 'rebase --merge (L/L)' '\n  \t# In this test we want ISO-8859-1 encoded commits as the result\n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase --merge master &&\n @@ -243,7 +243,7 @@ test_expect_success 'rebase --merge (L/U)' '\n  \t# to get ISO-8859-1 results.\n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \tgit config i18n.logoutputencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard side &&\n  \tgit rebase --merge master &&\n @@ -254,7 +254,7 @@ test_expect_success 'rebase --merge (L/U)' '\n  test_expect_success 'am (U/U)' '\n  \t# Apply UTF-8 patches with UTF-8 commitencoding\n  \tgit config i18n.commitencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit am out-u1 out-u2 &&\n @@ -265,7 +265,7 @@ test_expect_success 'am (U/U)' '\n  test_expect_success !MINGW 'am (L/L)' '\n  \t# Apply ISO-8859-1 patches with ISO-8859-1 commitencoding\n  \tgit config i18n.commitencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit am out-l1 out-l2 &&\n @@ -276,7 +276,7 @@ test_expect_success !MINGW 'am (L/L)' '\n  test_expect_success 'am (U/L)' '\n  \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n  \tgit config i18n.commitencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \tgit reset --hard master &&\n  \n  \t# am specifies --utf8 by default.\n @@ -288,7 +288,7 @@ test_expect_success 'am (U/L)' '\n  test_expect_success 'am --no-utf8 (U/L)' '\n  \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n  \tgit config i18n.commitencoding UTF-8 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \n  \tgit reset --hard master &&\n  \tgit am --no-utf8 out-l1 out-l2 2>err &&\n @@ -303,7 +303,7 @@ test_expect_success 'am --no-utf8 (U/L)' '\n  test_expect_success !MINGW 'am (L/U)' '\n  \t# Apply UTF-8 patches with ISO-8859-1 commitencoding\n  \tgit config i18n.commitencoding ISO8859-1 &&\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \n  \tgit reset --hard master &&\n  \t# mailinfo will re-code the commit message to the charset specified by\n diff --git a/t/t3901-8859-1.txt b/t/t3901/8859-1.txt\n similarity index 100%\n rename from t/t3901-8859-1.txt\n rename to t/t3901/8859-1.txt\n diff --git a/t/t3901-utf8.txt b/t/t3901/utf8.txt\n similarity index 100%\n rename from t/t3901-utf8.txt\n rename to t/t3901/utf8.txt\n diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\n index df2accb6555..c3e0a3c3fc9 100755\n --- a/t/t4003-diff-rename-1.sh\n +++ b/t/t4003-diff-rename-1.sh\n @@ -11,7 +11,7 @@ test_description='More rename detection\n  \n  test_expect_success \\\n      'prepare reference tree' \\\n -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       echo frotz >rezrov &&\n      git update-index --add COPYING rezrov &&\n      tree=$(git write-tree) &&\n @@ -99,7 +99,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n      'prepare work tree once again' \\\n -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       git update-index --add --remove COPYING COPYING.1'\n  \n  # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\n diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\n index 135addbfbda..f1641c35ee2 100755\n --- a/t/t4005-diff-rename-2.sh\n +++ b/t/t4005-diff-rename-2.sh\n @@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw.\n  \n  test_expect_success \\\n      'prepare reference tree' \\\n -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       echo frotz >rezrov &&\n      git update-index --add COPYING rezrov &&\n      tree=$(git write-tree) &&\n @@ -71,7 +71,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n      'prepare work tree once again' \\\n -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       git update-index --add --remove COPYING COPYING.1'\n  \n  git diff-index -C --find-copies-harder $tree >current\n diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\n index dae327fabbf..0157fde5503 100755\n --- a/t/t4007-rename-3.sh\n +++ b/t/t4007-rename-3.sh\n @@ -11,7 +11,7 @@ test_description='Rename interaction with pathspec.\n  \n  test_expect_success 'prepare reference tree' '\n  \tmkdir path0 path1 &&\n -\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n +\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >path0/COPYING &&\n  \tgit update-index --add path0/COPYING &&\n  \ttree=$(git write-tree) &&\n  \techo $tree\n diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\n index 9dd1bc5e162..5af4fa6aadb 100755\n --- a/t/t4008-diff-break-rewrite.sh\n +++ b/t/t4008-diff-break-rewrite.sh\n @@ -25,8 +25,8 @@ Further, with -B and -M together, these should turn into two renames.\n  . \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n  \n  test_expect_success setup '\n -\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n -\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n +\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n +\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n  \tgit update-index --add file0 file1 &&\n  \tgit tag reference $(git write-tree)\n  '\n diff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\n index b5149fde6ec..8dcb05c4a57 100755\n --- a/t/t9350-fast-export.sh\n +++ b/t/t9350-fast-export.sh\n @@ -70,7 +70,7 @@ test_expect_success 'iso-8859-1' '\n  \n  \tgit config i18n.commitencoding ISO8859-1 &&\n  \t# use author and committer name in ISO-8859-1 to match it.\n -\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \ttest_tick &&\n  \techo rosten >file &&\n  \tgit commit -s -m den file &&\n diff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\n index 6d06ed96cbc..cc8d463e01a 100755\n --- a/t/t9500-gitweb-standalone-no-errors.sh\n +++ b/t/t9500-gitweb-standalone-no-errors.sh\n @@ -519,7 +519,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n  \t'encode(commit): utf8' \\\n -\t'. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n +\t'. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n  \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n  \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n  \t echo \"UTF-8\" >> file &&\n @@ -529,7 +529,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n  \t'encode(commit): iso-8859-1' \\\n -\t'. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n +\t'. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n  \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n  \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n  \t echo \"ISO-8859-1\" >> file &&\n\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n"},{"id":"318743","messageId":"0a2af24e3423e402e6607fdc69fcbeb8cfe5489a.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 1/7] Fix build with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:49:20Z","receivedAt":"2017-05-04T09:49:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, the default line endings are denoted by a Carriage Return\nbyte followed by a Line Feed byte, while Linux and MacOSX use a single\nLine Feed byte to denote a line ending.\n\nTo help with this situation, Git introduced several mechanisms over the\nlast decade, most prominently the `core.autocrlf` setting.\n\nSometimes, however, a single setting is incorrect, e.g. when certain\nfiles in the source code are to be consumed by software that can handle\nonly LF line endings, while other files can use whatever is appropriate\nfor the current platform.\n\nTo allow for that, Git added the `eol` option to its .gitattributes\nhandling, expecting every user of Git to mark their source code\nappropriately.\n\nBash assumes that line-endings of scripts are denoted by a single Line\nFeed byte. Therefore, shell scripts in Git's source code are one example\nwhere that `eol=lf` option is *required*.\n\nWhen generating common-cmds.h, the Unix tools we use generally operate on\nthe assumption that input and output deliminate their lines using LF-only\nline endings. Consequently, they would happily copy the CR byte verbatim\ninto the strings in common-cmds.h, which in turn makes the C preprocessor\nbarf (that interprets them as MacOS-style line endings). Therefore, we\nhave to mark the input files as LF-only: command-list.txt and\nDocumentation/git-*.txt.\n\nQuite a bit belatedly, this patch brings Git's own source code in line\nwith those expectations by setting those attributes to allow for a\ncorrect build even when core.autocrlf=true.\n\nThis patch can be validated even on Linux, by using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake -j15 DEVELOPER=1\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n .gitattributes         | 8 +++++++-\n git-gui/.gitattributes | 1 +\n 2 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/.gitattributes b/.gitattributes\nindex 320e33c327c..8ce9c6b8888 100644\n--- a/.gitattributes\n+++ b/.gitattributes\n@@ -1,3 +1,9 @@\n * whitespace=!indent,trail,space\n *.[ch] whitespace=indent,trail,space diff=cpp\n-*.sh whitespace=indent,trail,space\n+*.sh whitespace=indent,trail,space eol=lf\n+*.perl eol=lf\n+*.pm eol=lf\n+/Documentation/git-*.txt eol=lf\n+/command-list.txt eol=lf\n+/GIT-VERSION-GEN eol=lf\n+/mergetools/* eol=lf\ndiff --git a/git-gui/.gitattributes b/git-gui/.gitattributes\nindex 33d07c06bd9..59cd41dbff7 100644\n--- a/git-gui/.gitattributes\n+++ b/git-gui/.gitattributes\n@@ -2,3 +2,4 @@\n *           encoding=US-ASCII\n git-gui.sh  encoding=UTF-8\n /po/*.po    encoding=UTF-8\n+/GIT-VERSION-GEN eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318744","messageId":"fbba7450f2d4475b6d9a0d740dc43e22c81b104e.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 2/7] git-new-workdir: mark script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:49:23Z","receivedAt":"2017-05-04T09:49:53Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Bash does not handle scripts with CR/LF line endings correctly, therefore\nthey *have* to be forced to LF-only line endings.\n\nFunnily enough, this fixes t3000-ls-files-others and\nt1021-rerere-in-workdir when git.git was checked out with\ncore.autocrlf=true, as these test still use git-new-workdir (once `git\nworktree` is no longer marked as experimental, both scripts probably\nwant to be ported to using that command instead).\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/workdir/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/workdir/.gitattributes\n\ndiff --git a/contrib/workdir/.gitattributes b/contrib/workdir/.gitattributes\nnew file mode 100644\nindex 00000000000..1f78c5d1bd3\n--- /dev/null\n+++ b/contrib/workdir/.gitattributes\n@@ -0,0 +1 @@\n+/git-new-workdir eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318745","messageId":"f63ec7ce151febfc7bc64cfbf424d93b56a92ef5.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 4/7] t3901: move supporting files into t/t3901/","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:49:58Z","receivedAt":"2017-05-04T09:50:18Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The current convention is to either generate files on the fly in tests,\nor to use supporting files taken from a t/tNNNN/ directory (where NNNN\nmatches the test's number, or the number of the test from which we\nborrow supporting files).\n\nThe test t3901-i18n-patch.sh was obviously introduced before that\nconvention was in full swing, hence its supporting files still lived in\nt/t3901-8859-1.txt and t/t3901-utf8.txt, respectively.\n\nLet's adjust to the current convention.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t0203-gettext-setlocale-sanity.sh      |  4 ++--\n t/t3901-i18n-patch.sh                    | 38 ++++++++++++++++----------------\n t/{t3901-8859-1.txt => t3901/8859-1.txt} |  0\n t/{t3901-utf8.txt => t3901/utf8.txt}     |  0\n t/t9350-fast-export.sh                   |  2 +-\n t/t9500-gitweb-standalone-no-errors.sh   |  4 ++--\n 6 files changed, 24 insertions(+), 24 deletions(-)\n rename t/{t3901-8859-1.txt => t3901/8859-1.txt} (100%)\n rename t/{t3901-utf8.txt => t3901/utf8.txt} (100%)\n\ndiff --git a/t/t0203-gettext-setlocale-sanity.sh b/t/t0203-gettext-setlocale-sanity.sh\nindex a2124600811..71b0d74b4dd 100755\n--- a/t/t0203-gettext-setlocale-sanity.sh\n+++ b/t/t0203-gettext-setlocale-sanity.sh\n@@ -8,7 +8,7 @@ test_description=\"The Git C functions aren't broken by setlocale(3)\"\n . ./lib-gettext.sh\n \n test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-c-commit\" iso-under-c &&\n \tgit show >out 2>err &&\n \t! test -s err &&\n@@ -16,7 +16,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n '\n \n test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 locale' '\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-utf8-commit\" iso-under-utf8 &&\n \tLANGUAGE=is LC_ALL=\"$is_IS_locale\" git show >out 2>err &&\n \t! test -s err &&\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex f663d567c8a..923eb01f0ea 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -31,7 +31,7 @@ test_expect_success setup '\n \n \t# use UTF-8 in author and committer name to match the\n \t# i18n.commitencoding settings\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \ttest_tick &&\n \techo \"$GIT_AUTHOR_NAME\" >mine &&\n@@ -55,7 +55,7 @@ test_expect_success setup '\n \t\t# the second one on the side branch is ISO-8859-1\n \t\tgit config i18n.commitencoding ISO8859-1 &&\n \t\t# use author and committer name in ISO-8859-1 to match it.\n-\t\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt\n+\t\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt\n \tfi &&\n \ttest_tick &&\n \techo Yet another >theirs &&\n@@ -100,7 +100,7 @@ test_expect_success 'rebase (U/U)' '\n \n \t# The result will be committed by GIT_COMMITTER_NAME --\n \t# we want UTF-8 encoded name.\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \tgit checkout -b test &&\n \tgit rebase master &&\n \n@@ -110,7 +110,7 @@ test_expect_success 'rebase (U/U)' '\n test_expect_success 'rebase (U/L)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -122,7 +122,7 @@ test_expect_success !MINGW 'rebase (L/L)' '\n \t# In this test we want ISO-8859-1 encoded commits as the result\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -135,7 +135,7 @@ test_expect_success !MINGW 'rebase (L/U)' '\n \t# to get ISO-8859-1 results.\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -148,7 +148,7 @@ test_expect_success 'cherry-pick(U/U)' '\n \n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -163,7 +163,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -178,7 +178,7 @@ test_expect_success 'cherry-pick(U/L)' '\n \n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -194,7 +194,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -207,7 +207,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n test_expect_success 'rebase --merge (U/U)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -218,7 +218,7 @@ test_expect_success 'rebase --merge (U/U)' '\n test_expect_success 'rebase --merge (U/L)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -230,7 +230,7 @@ test_expect_success 'rebase --merge (L/L)' '\n \t# In this test we want ISO-8859-1 encoded commits as the result\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -243,7 +243,7 @@ test_expect_success 'rebase --merge (L/U)' '\n \t# to get ISO-8859-1 results.\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -254,7 +254,7 @@ test_expect_success 'rebase --merge (L/U)' '\n test_expect_success 'am (U/U)' '\n \t# Apply UTF-8 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit am out-u1 out-u2 &&\n@@ -265,7 +265,7 @@ test_expect_success 'am (U/U)' '\n test_expect_success !MINGW 'am (L/L)' '\n \t# Apply ISO-8859-1 patches with ISO-8859-1 commitencoding\n \tgit config i18n.commitencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit am out-l1 out-l2 &&\n@@ -276,7 +276,7 @@ test_expect_success !MINGW 'am (L/L)' '\n test_expect_success 'am (U/L)' '\n \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \tgit reset --hard master &&\n \n \t# am specifies --utf8 by default.\n@@ -288,7 +288,7 @@ test_expect_success 'am (U/L)' '\n test_expect_success 'am --no-utf8 (U/L)' '\n \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit am --no-utf8 out-l1 out-l2 2>err &&\n@@ -303,7 +303,7 @@ test_expect_success 'am --no-utf8 (U/L)' '\n test_expect_success !MINGW 'am (L/U)' '\n \t# Apply UTF-8 patches with ISO-8859-1 commitencoding\n \tgit config i18n.commitencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \t# mailinfo will re-code the commit message to the charset specified by\ndiff --git a/t/t3901-8859-1.txt b/t/t3901/8859-1.txt\nsimilarity index 100%\nrename from t/t3901-8859-1.txt\nrename to t/t3901/8859-1.txt\ndiff --git a/t/t3901-utf8.txt b/t/t3901/utf8.txt\nsimilarity index 100%\nrename from t/t3901-utf8.txt\nrename to t/t3901/utf8.txt\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex b5149fde6ec..8dcb05c4a57 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -70,7 +70,7 @@ test_expect_success 'iso-8859-1' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \t# use author and committer name in ISO-8859-1 to match it.\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 6d06ed96cbc..cc8d463e01a 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -519,7 +519,7 @@ test_expect_success \\\n \n test_expect_success \\\n \t'encode(commit): utf8' \\\n-\t'. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t'. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n \t echo \"UTF-8\" >> file &&\n@@ -529,7 +529,7 @@ test_expect_success \\\n \n test_expect_success \\\n \t'encode(commit): iso-8859-1' \\\n-\t'. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t'. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n \t echo \"ISO-8859-1\" >> file &&\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318746","messageId":"a36f1684d302dc961f91e3ac0651b1aac7e00710.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 3/7] completion: mark bash script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:49:53Z","receivedAt":"2017-05-04T09:50:20Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Without this change, the completion script does not work, as Bash expects\nits scripts to have line feeds as end-of-line markers (this is\nparticularly prominent in quoted multi-line strings, where carriage\nreturns would slip into the strings as verbatim characters otherwise).\n\nThis change is required to let t9902-completion pass when Git's source\ncode is checked out with `core.autocrlf = true`.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n contrib/completion/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/completion/.gitattributes\n\ndiff --git a/contrib/completion/.gitattributes b/contrib/completion/.gitattributes\nnew file mode 100644\nindex 00000000000..19116944c15\n--- /dev/null\n+++ b/contrib/completion/.gitattributes\n@@ -0,0 +1 @@\n+*.bash eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318747","messageId":"8afbd831b79b5978c1c2f8641a911c02e4175de2.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 5/7] t4003, t4005, t4007 & t4008: handle CR/LF in t/README & t/diff-lib/README","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:50:31Z","receivedAt":"2017-05-04T09:50:43Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Seeing as Git originates from the Linux ecosystem, it is understandable\nthat the assumption of Unix line endings is deeply ingrained in Git's\nsource code as well as its test suite.\n\nHowever, we must not force files that are otherwise unrelated to tests\nto have Unix line endings just to appease test scripts that may use\nthem. Instead, the test scripts should be indifferent what line endings\nfiles outside their corresponding tNNNN/ directories have.\n\nAs t4003-diff-rename-1.sh, t4005-diff-rename-2.sh, t4007-rename-3.sh &\nt4008-diff-break-rewrite.sh make hard-coded assumptions about the SHA-1\nof the tested files, and as those files' contents originate from outside\nthis script's sphere of authority, it must handle CR/LF line endings in\nthose files gracefully. We do that by simply stripping out CR bytes.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t4003-diff-rename-1.sh      | 4 ++--\n t/t4005-diff-rename-2.sh      | 4 ++--\n t/t4007-rename-3.sh           | 2 +-\n t/t4008-diff-break-rewrite.sh | 4 ++--\n 4 files changed, 7 insertions(+), 7 deletions(-)\n\ndiff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\nindex df2accb6555..c3e0a3c3fc9 100755\n--- a/t/t4003-diff-rename-1.sh\n+++ b/t/t4003-diff-rename-1.sh\n@@ -11,7 +11,7 @@ test_description='More rename detection\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     tree=$(git write-tree) &&\n@@ -99,7 +99,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\ndiff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\nindex 135addbfbda..f1641c35ee2 100755\n--- a/t/t4005-diff-rename-2.sh\n+++ b/t/t4005-diff-rename-2.sh\n@@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw.\n \n test_expect_success \\\n     'prepare reference tree' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n      echo frotz >rezrov &&\n     git update-index --add COPYING rezrov &&\n     tree=$(git write-tree) &&\n@@ -71,7 +71,7 @@ test_expect_success \\\n \n test_expect_success \\\n     'prepare work tree once again' \\\n-    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n+    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n      git update-index --add --remove COPYING COPYING.1'\n \n git diff-index -C --find-copies-harder $tree >current\ndiff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\nindex dae327fabbf..0157fde5503 100755\n--- a/t/t4007-rename-3.sh\n+++ b/t/t4007-rename-3.sh\n@@ -11,7 +11,7 @@ test_description='Rename interaction with pathspec.\n \n test_expect_success 'prepare reference tree' '\n \tmkdir path0 path1 &&\n-\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n+\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >path0/COPYING &&\n \tgit update-index --add path0/COPYING &&\n \ttree=$(git write-tree) &&\n \techo $tree\ndiff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\nindex 9dd1bc5e162..5af4fa6aadb 100755\n--- a/t/t4008-diff-break-rewrite.sh\n+++ b/t/t4008-diff-break-rewrite.sh\n@@ -25,8 +25,8 @@ Further, with -B and -M together, these should turn into two renames.\n . \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n \n test_expect_success setup '\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n-\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n+\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n+\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n \tgit update-index --add file0 file1 &&\n \tgit tag reference $(git write-tree)\n '\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318748","messageId":"daa27cca688e864c0b85a92639e0fb46261dad5c.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 6/7] Fix the remaining tests that failed with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:50:37Z","receivedAt":"2017-05-04T09:51:04Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test suite is mainly developed on Linux and MacOSX, which is the\nreason that nobody thought to mark files as LF-only as needed.\n\nThe symptom is a test suite that fails left and right when being checked\nout using Git for Windows (which defaults to core.autocrlf=true).\n\nMostly, the problems stem from Git's (LF-only) output being compared to\nhard-coded files that are checked out with line endings according to\ncore.autocrlf (which is of course incorrect).\n\nNote: the test suite also uses the t/README file as well as the COPYING\nfile in t/diff-lib/, expecting LF-only line endings explicitly and\nfailing if that assumption does not hold true. That is why we mark them\nas LF-only in the .gitattributes, too.\n\nThis patch can be validated even on Linux by using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake -j15 DEVELOPER=1 test\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/.gitattributes | 20 +++++++++++++++++++-\n 1 file changed, 19 insertions(+), 1 deletion(-)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 2d44088f56e..3525ca43f30 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -1,2 +1,20 @@\n t[0-9][0-9][0-9][0-9]/* -whitespace\n-t0110/url-* binary\n+/t0110/url-* binary\n+/t3900/*.txt eol=lf\n+/t3901/*.txt eol=lf\n+/t4034/*/* eol=lf\n+/t4013/* eol=lf\n+/t4018/* eol=lf\n+/t4100/* eol=lf\n+/t4101/* eol=lf\n+/t4109/* eol=lf\n+/t4110/* eol=lf\n+/t4135/* eol=lf\n+/t4211/* eol=lf\n+/t4252/* eol=lf\n+/t5100/* eol=lf\n+/t5515/* eol=lf\n+/t556x_common eol=lf\n+/t7500/* eol=lf\n+/t8005/*.txt eol=lf\n+/t9*/*.dump eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"318749","messageId":"f648bb03c7fe3945042480f05b9ac229350412b3.1493891336.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v2 7/7] t4051: mark supporting files as requiring LF-only line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T09:50:57Z","receivedAt":"2017-05-04T09:51:10Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test t4051-diff-function-context.sh passes on Linux when\ncore.autocrlf=true even without marking its support files as LF-only,\nbut they fail when core.autocrlf=true in Git for Windows' SDK.\n\nThe reason is that `grep ... >file.c.new` will keep CR/LF line endings\non Linux (obviously treating CRs as if they were regular characters),\nbut will be converted to LF-only line endings with MSYS2's grep that is\nused in Git for Windows.\n\nAs we do not want to validate the way the available `grep` works, let's\njust mark the input as LF-only and move on.\n\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 3525ca43f30..bdd82cf31f7 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -5,6 +5,7 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n /t4034/*/* eol=lf\n /t4013/* eol=lf\n /t4018/* eol=lf\n+/t4051/* eol=lf\n /t4100/* eol=lf\n /t4101/* eol=lf\n /t4109/* eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n"},{"id":"318788","messageId":"xmqq60hgacjp.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"alpine.DEB.2.21.1.1705041129170.4905@virtualbox","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-04T15:04:26Z","receivedAt":"2017-05-04T15:05:16Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Well, a couple of comments about your comment:\n>\n> - we say \"shell scripts\", but we're sloppy there: they are \"Unix shell\n>   scripts\", as they are executed by Unix shells. As such, it is pretty\n>   obvious that they favor Unix line endings, right? And that they do not\n>   really handle anything else well, right?\n\nNot really.  I would expect that\n\n\tcat A B C\n\nwith CRLF line endings (i.e. \"cat A B C<CR><LF>\") on platforms whose\neol convention is LF to barf due to the missing file whose name is\n\"C<CR>\", while on platforms whose eol convention is CRLF, I do\nexpect the contents of file C comes at the end of the output.\n\n> - You try to say that it is not okay for shell scripts to be checked\n>   out as LF-only when the platform convention for *text* files is CR/LF,\n>   right? \n\nI didn't try to and I didn't say that, I hope.  I think it is not OK\nfor shell scripts to be checked out with <CR><LF> when the platform\nconvention for text is <LF>, though.  It may be possible for an\nimplementation on CRLF platform to tolerate missing <CR> (i.e. a\nfile in LF convention--instead of treating a lone <LF> as a non-eol\nbut just a regular \"funny\" byte, treat it as a normal eol), but that\nwould be a quality-of-implementation thing.  So when the platform\nconvention for text files is <CR><LF>, I would have thought that it\nwas more natural to check out shell scripts as such.\n\nHowever, I did not think things through when I said \"I am not sure\nif it is OK for shell scripts not to honor the platform convention,\nthough.\"  In a sense, the \"cat A B C\" example does not have to worry\nabout the platform convention issue very much.  In real scripts, we\nhave things like a string literal that spans lines (i.e. do we have\na LF, or a CRLF pair, in between these two lines?) and here\ndocuments (ditto).  To handle these \"correctly\" while treating shell\nscripts mere \"text\" files, a shell implementation on CRLF platform\nhas to accept CRLF, pretend as if it saw only LF, do all the\nprocessing as if the eol convention were LF, and convert LF in the\noutput from the script to CRLF.  I think that is _too_ much to ask\nfor an implementation, and such an attempt would get corner cases\nwrong.  IOW, I was not sure if it is OK for scripts not to honor the\nplatorm convention when I wrote the message you are responding to,\nbut I think it probably is not just OK but is the simplest/cleanest\nfor shell implementations not to honor the platform convention and\ninstead pretend that they always live in LF-only world.\n\nAnd all of the above ultimately does not matter.  If the shell you\nhave on Windows cannot take CRLF files, then our shell script must\nbe checked out as LF files even on Windows.  My \"I am not sure\" was\nmostly from not knowing how ingrained that \"cannot take CRLF files\"\nwas (i.e. I didn't know if there may be some knobs similar to\ncore.crlf we have that you can toggle for your shell to honor the\nplatform convention).\n\n\n"},{"id":"318798","messageId":"alpine.DEB.2.21.1.1705042038150.4905@virtualbox","threadId":"45850","inReplyTo":"xmqq60hgacjp.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-04T18:48:10Z","receivedAt":"2017-05-04T18:48:21Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Thu, 4 May 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Well, a couple of comments about your comment:\n> >\n> > - we say \"shell scripts\", but we're sloppy there: they are \"Unix shell\n> >   scripts\", as they are executed by Unix shells. As such, it is pretty\n> >   obvious that they favor Unix line endings, right? And that they do not\n> >   really handle anything else well, right?\n> \n> Not really.  I would expect that\n> \n> \tcat A B C\n> \n> with CRLF line endings (i.e. \"cat A B C<CR><LF>\") on platforms whose\n> eol convention is LF to barf due to the missing file whose name is\n> \"C<CR>\", while on platforms whose eol convention is CRLF, I do\n> expect the contents of file C comes at the end of the output.\n\nLet me repeat myself: `cat` is a Unix utility. Unix line endings are\nLF-only.\n\nSo when you say \"platform whose eol convention is CRLF\", you speak about a\nplatform that is not Unix.\n\nIf you want to run `cat` on Linux, you have to have a Unix-y environment.\nErgo: LF-only line endings.\n\nThe real problem arises only because I decided to ship Git for Windows\nwith a POSIX emulating environment to execute the Unix shell and Perl\nscripts.\n\nThe real solution would have been to push harder for \"builtinification\",\nbut you know yourself how hard of an uphill effort that is, as the idea is\nstill prevalent that having a large part of Git be implemented as\nshell/Perl scripts is not only okay, but even a Good Thing (and\nportability is then a matter of making every contributor know what\nconstructs are portable and to avoid, say, Bashisms or GNU sed's options\nthat are incompatible with BSD sed's options).\n\nCiao,\nDscho\n"},{"id":"319019","messageId":"xmqqd1bldyke.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"alpine.DEB.2.21.1.1705042038150.4905@virtualbox","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-07T05:29:37Z","receivedAt":"2017-05-07T22:35:04Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n\n> Let me repeat myself:\n\nDon't. Instead, read through what you are responding to the end\nbefore start typing a byte.  In case you didn't do that, in the end\nI agree with the direction of the series ;-).\n"},{"id":"319051","messageId":"xmqqzieo7x6i.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"0a2af24e3423e402e6607fdc69fcbeb8cfe5489a.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 1/7] Fix build with core.autocrlf=true","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:08:21Z","receivedAt":"2017-05-08T05:08:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> When generating common-cmds.h, the Unix tools we use generally operate on\n> the assumption that input and output deliminate their lines using LF-only\n> line endings. Consequently, they would happily copy the CR byte verbatim\n> into the strings in common-cmds.h, which in turn makes the C preprocessor\n> barf (that interprets them as MacOS-style line endings). Therefore, we\n> have to mark the input files as LF-only: command-list.txt and\n> Documentation/git-*.txt.\n\nI guess nobody in the Windows land opens the doc source with\nNotepad, like experienced Git developers runs \"less\" on them as a\nfaster way than accessing HTMLized (or manified) versions, and\nmarking Documentation/git-*.txt explicitly as eol=lf is OK.  That\nwas the only thing I had brief worry about this patch.\n\nThanks, will queue.\n\n> diff --git a/.gitattributes b/.gitattributes\n> index 320e33c327c..8ce9c6b8888 100644\n> --- a/.gitattributes\n> +++ b/.gitattributes\n> @@ -1,3 +1,9 @@\n>  * whitespace=!indent,trail,space\n>  *.[ch] whitespace=indent,trail,space diff=cpp\n> -*.sh whitespace=indent,trail,space\n> +*.sh whitespace=indent,trail,space eol=lf\n> +*.perl eol=lf\n> +*.pm eol=lf\n> +/Documentation/git-*.txt eol=lf\n> +/command-list.txt eol=lf\n> +/GIT-VERSION-GEN eol=lf\n> +/mergetools/* eol=lf\n> diff --git a/git-gui/.gitattributes b/git-gui/.gitattributes\n> index 33d07c06bd9..59cd41dbff7 100644\n> --- a/git-gui/.gitattributes\n> +++ b/git-gui/.gitattributes\n> @@ -2,3 +2,4 @@\n>  *           encoding=US-ASCII\n>  git-gui.sh  encoding=UTF-8\n>  /po/*.po    encoding=UTF-8\n> +/GIT-VERSION-GEN eol=lf\n"},{"id":"319052","messageId":"xmqqvapc7x1i.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"fbba7450f2d4475b6d9a0d740dc43e22c81b104e.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 2/7] git-new-workdir: mark script as LF-only","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:11:21Z","receivedAt":"2017-05-08T05:11:27Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Bash does not handle scripts with CR/LF line endings correctly, therefore\n> they *have* to be forced to LF-only line endings.\n>\n> Funnily enough, this fixes t3000-ls-files-others and\n> t1021-rerere-in-workdir when git.git was checked out with\n> core.autocrlf=true, as these test still use git-new-workdir (once `git\n> worktree` is no longer marked as experimental, both scripts probably\n> want to be ported to using that command instead).\n>\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n\nI wouldn't bother fixing these myself, but the above two credit\nlines are swapped.  You wrote, then Jonathan reviewed (to which I'll\nappend my own as the 'editor' of the history when I commit).\n\n>  contrib/workdir/.gitattributes | 1 +\n>  1 file changed, 1 insertion(+)\n>  create mode 100644 contrib/workdir/.gitattributes\n>\n> diff --git a/contrib/workdir/.gitattributes b/contrib/workdir/.gitattributes\n> new file mode 100644\n> index 00000000000..1f78c5d1bd3\n> --- /dev/null\n> +++ b/contrib/workdir/.gitattributes\n> @@ -0,0 +1 @@\n> +/git-new-workdir eol=lf\n"},{"id":"319053","messageId":"xmqqr3007wzl.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"f63ec7ce151febfc7bc64cfbf424d93b56a92ef5.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 4/7] t3901: move supporting files into t/t3901/","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:12:30Z","receivedAt":"2017-05-08T05:12:38Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> The current convention is to either generate files on the fly in tests,\n> or to use supporting files taken from a t/tNNNN/ directory (where NNNN\n> matches the test's number, or the number of the test from which we\n> borrow supporting files).\n>\n> The test t3901-i18n-patch.sh was obviously introduced before that\n> convention was in full swing, hence its supporting files still lived in\n> t/t3901-8859-1.txt and t/t3901-utf8.txt, respectively.\n>\n> Let's adjust to the current convention.\n\nThanks for a clean-up.  This obviously is a good change ;-)\n"},{"id":"319054","messageId":"xmqqmvao7wx1.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"8afbd831b79b5978c1c2f8641a911c02e4175de2.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 5/7] t4003, t4005, t4007 & t4008: handle CR/LF in t/README & t/diff-lib/README","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:14:02Z","receivedAt":"2017-05-08T05:14:08Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\n> index df2accb6555..c3e0a3c3fc9 100755\n> --- a/t/t4003-diff-rename-1.sh\n> +++ b/t/t4003-diff-rename-1.sh\n> @@ -11,7 +11,7 @@ test_description='More rename detection\n>  \n>  test_expect_success \\\n>      'prepare reference tree' \\\n> -    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n> +    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n\nGood ;-).  Thanks.\n\n"},{"id":"319055","messageId":"xmqqinlb9b46.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"daa27cca688e864c0b85a92639e0fb46261dad5c.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 6/7] Fix the remaining tests that failed with core.autocrlf=true","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:22:01Z","receivedAt":"2017-05-08T05:22:09Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> Note: the test suite also uses the t/README file as well as the COPYING\n> file in t/diff-lib/, expecting LF-only line endings explicitly and\n> failing if that assumption does not hold true. That is why we mark them\n> as LF-only in the .gitattributes, too.\n\nI said the previous step that used COPYING was good because it\ndidn't force the file to be checked out with lf (and instead fixed\nthe test to strip CR if/as necessary), but come to think of it,\nthese COPYING/README files are in t/diff-lib/ that are shipped as\ntest vector, and meant to stay constant even when the end-user\nfacing COPYING and README at the top level changed.\n\nI do not see t/diff-lib/* marked as eol=lf in this patch, but\nshouldn't it be done here, just like all these test vector files?\n\nI also wonder if that makes the previous step unnecessary.\n\n\n>\n> This patch can be validated even on Linux by using this cadence:\n>\n> \tgit config core.autocrlf true\n> \trm .git/index && git stash\n> \tmake -j15 DEVELOPER=1 test\n>\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/.gitattributes | 20 +++++++++++++++++++-\n>  1 file changed, 19 insertions(+), 1 deletion(-)\n>\n> diff --git a/t/.gitattributes b/t/.gitattributes\n> index 2d44088f56e..3525ca43f30 100644\n> --- a/t/.gitattributes\n> +++ b/t/.gitattributes\n> @@ -1,2 +1,20 @@\n>  t[0-9][0-9][0-9][0-9]/* -whitespace\n> -t0110/url-* binary\n> +/t0110/url-* binary\n> +/t3900/*.txt eol=lf\n> +/t3901/*.txt eol=lf\n> +/t4034/*/* eol=lf\n> +/t4013/* eol=lf\n> +/t4018/* eol=lf\n> +/t4100/* eol=lf\n> +/t4101/* eol=lf\n> +/t4109/* eol=lf\n> +/t4110/* eol=lf\n> +/t4135/* eol=lf\n> +/t4211/* eol=lf\n> +/t4252/* eol=lf\n> +/t5100/* eol=lf\n> +/t5515/* eol=lf\n> +/t556x_common eol=lf\n> +/t7500/* eol=lf\n> +/t8005/*.txt eol=lf\n> +/t9*/*.dump eol=lf\n"},{"id":"319056","messageId":"xmqqefvz9asb.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"f648bb03c7fe3945042480f05b9ac229350412b3.1493891336.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v2 7/7] t4051: mark supporting files as requiring LF-only line endings","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-08T05:29:08Z","receivedAt":"2017-05-08T05:29:17Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n\n> The test t4051-diff-function-context.sh passes on Linux when\n> core.autocrlf=true even without marking its support files as LF-only,\n> but they fail when core.autocrlf=true in Git for Windows' SDK.\n>\n> The reason is that `grep ... >file.c.new` will keep CR/LF line endings\n> on Linux (obviously treating CRs as if they were regular characters),\n> but will be converted to LF-only line endings with MSYS2's grep that is\n> used in Git for Windows.\n\nAhem.  \n\nI thought that according to your claim a UNIX tool like \"grep\" would\nalway use LF endings?  ;-)\n\n> As we do not want to validate the way the available `grep` works, let's\n> just mark the input as LF-only and move on.\n\nI agree with this conclusion; just like we do not want to worry\nabout how `grep` works when given CRLF files in this patch, we do\nnot want to worry about how other commands like `sh` works when\ngiven CRLF files.  And that is consistent with the overall theme of\nthis series that marked *.sh, *.perl and other files with eol=lf\nattribute.\n\nThe only question I still have with this series is about the\nREADME/COPYING thing.  I _think_ it was my ancient mistake to use\nthe toplevel README and COPYING as test files, and that mistake was\ncorrected by somebody else earlier by having a frozen copy in\nt/diff-lib/ and making tests use these files from that directory.\nIf we broke our tests to again use these files from outside\nt/diff-lib/, then we would need to fix the tests not to do so.  And\nif we are only looking at t/diff-lib/ copy, then I think it is more\nconsistent with the rest of this series to mark them with eol=lf\nrather than passing them through \"tr -d '\\015'\".\n\nThanks.\n\n>\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> ---\n>  t/.gitattributes | 1 +\n>  1 file changed, 1 insertion(+)\n>\n> diff --git a/t/.gitattributes b/t/.gitattributes\n> index 3525ca43f30..bdd82cf31f7 100644\n> --- a/t/.gitattributes\n> +++ b/t/.gitattributes\n> @@ -5,6 +5,7 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n>  /t4034/*/* eol=lf\n>  /t4013/* eol=lf\n>  /t4018/* eol=lf\n> +/t4051/* eol=lf\n>  /t4100/* eol=lf\n>  /t4101/* eol=lf\n>  /t4109/* eol=lf\n"},{"id":"319076","messageId":"alpine.DEB.2.21.1.1705081248020.146734@virtualbox","threadId":"45850","inReplyTo":"xmqqd1bldyke.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH 0/5] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-08T10:49:35Z","receivedAt":"2017-05-08T10:49:51Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Sun, 7 May 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <Johannes.Schindelin@gmx.de> writes:\n> \n> > Let me repeat myself:\n> \n> Don't.\n\nI had to. You did not understand me.\n\n> Instead, read through what you are responding to the end before start\n> typing a byte.  In case you didn't do that, in the end I agree with the\n> direction of the series ;-).\n\nAnd I am still convinced that you do not understand me. At least on the\npoint that I tried to repeat in a different way, in an attempt to help you\nto understand me.\n\nWhat makes me so convinced that you do not understand me? The part of your\nmail that you assumed I did not read. (Disclaimer: I did read it.)\n\nCiao,\nDscho\n"},{"id":"319182","messageId":"alpine.DEB.2.21.1.1705091306480.146734@virtualbox","threadId":"45850","inReplyTo":"xmqqefvz9asb.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v2 7/7] t4051: mark supporting files as requiring LF-only line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T11:20:11Z","receivedAt":"2017-05-09T11:20:25Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi Junio,\n\nOn Mon, 8 May 2017, Junio C Hamano wrote:\n\n> Johannes Schindelin <johannes.schindelin@gmx.de> writes:\n> \n> > The test t4051-diff-function-context.sh passes on Linux when\n> > core.autocrlf=true even without marking its support files as LF-only,\n> > but they fail when core.autocrlf=true in Git for Windows' SDK.\n> >\n> > The reason is that `grep ... >file.c.new` will keep CR/LF line endings\n> > on Linux (obviously treating CRs as if they were regular characters),\n> > but will be converted to LF-only line endings with MSYS2's grep that\n> > is used in Git for Windows.\n> \n> Ahem.  \n> \n> I thought that according to your claim a UNIX tool like \"grep\" would\n> alway use LF endings?  ;-)\n\nThe maintainers of the MSYS2 grep package apparently disagree with me on\nthat point. You should be familiar with that reaction.\n\n> > As we do not want to validate the way the available `grep` works,\n> > let's just mark the input as LF-only and move on.\n> \n> I agree with this conclusion; just like we do not want to worry about\n> how `grep` works when given CRLF files in this patch, we do not want to\n> worry about how other commands like `sh` works when given CRLF files.\n> And that is consistent with the overall theme of this series that marked\n> *.sh, *.perl and other files with eol=lf attribute.\n\nGood. That agreement is something on which you and I can build.\n\n> The only question I still have with this series is about the\n> README/COPYING thing.  I _think_ it was my ancient mistake to use the\n> toplevel README and COPYING as test files, and that mistake was\n> corrected by somebody else earlier by having a frozen copy in\n> t/diff-lib/ and making tests use these files from that directory.  If we\n> broke our tests to again use these files from outside t/diff-lib/, then\n> we would need to fix the tests not to do so.  And if we are only looking\n> at t/diff-lib/ copy, then I think it is more consistent with the rest of\n> this series to mark them with eol=lf rather than passing them through\n> \"tr -d '\\015'\".\n\nThank you for pointing out that the README and COPYING files were\nreproduced in t/diff-lib/ specifically to serve as files for use in the\ntests. It had not really occurred to me, as I mistook this to be an extra\nanal licensing clarification for the diff-lib ;-)\n\nI will \"re-roll\" the patch series, dropping the ugly tr calls and marking\nt/diff-lib/* as LF-only, as you suggested.\n\nCiao,\nDscho\n"},{"id":"319186","messageId":"cover.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1493891336.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 0/6] Abide by our own rules regarding line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:53:17Z","receivedAt":"2017-05-09T12:53:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Over the past decade, there have been a couple of attempts to remedy the\nsituation regarding line endings (Windows/DOS line endings are\ntraditionally CR/LF even if many current applications can handle LF,\ntoo, Linux/MacOSX/*BSD/Unix uses LF-only line handlings, and old MacOS\nsoftware used to use CR-only line endings).\n\nThe current idea seems to be that the default line endings differ\ndepending on the platform, and for files that should be exempt from that\ndefault, we strongly recommend using .gitattributes to define what the\nsource code requires.\n\nIt is time to heed our own recommendation and mark the files that\nrequire LF-only line endings in our very own .gitattributes.\n\nFor starters, those files include shell scripts: the most prevalent\nshell interpreter in use (and certainly used in Git for Windows) is\nBash, and Bash does not handle CR/LF line endings gracefully.\n\nThere are even two shell scripts that are used in the test suite even if\nthey are not technically supposed to be part of core Git, as indicated\nby their habitat inside contrib/: git-new-workdir and\ngit-completion.bash.\n\nRelated to shell scripts: when generating common-cmds.h, we use tools\nthat generally operate on the assumption that input and output\ndeliminate their lines using LF-only line endings. Consequently, they\nwould happily copy the CR byte verbatim into the strings in\ncommon-cmds.h, which in turn makes the C preprocessor barf (that\ninterprets them as MacOS-style line endings).\n\nFurther, the most obvious required fixes concern tests' support files\ncommitted verbatim, to be compared to Git's output, which is always\nLF-only. This includes the two files in t/diff-lib/ (which does not, in\nfact contain library functions as suggested by its name, but a copy of\nthe README and the COPYING files, specifically for use in the tests).\n\nThere are a few SVN dump files, too, supporting the Subversion-related\ntests, requiring LF-only line endings.\n\nWithout these fixes, Git will fail to build and pass the test suite, as\ncan be verified even on Linux using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake DEVELOPER=1 -j15 test\n\nNote: I separated out the change marking t/t4051/* as LF-only into an\nindividual commit for one reason: it would appear that some grep builds\non Windows automagically convert CR/LF input into LF-only output. I went\nthe easy route to work around this issue, as I do not want to bother\nchanging MSYS2 grep's behavior.\n\nChanges since v2:\n\n- marked t/diff-lib/* as LF-only, dropping the ugly `tr -d \"\\015\"` patch.\n\n\nJohannes Schindelin (6):\n  Fix build with core.autocrlf=true\n  git-new-workdir: mark script as LF-only\n  completion: mark bash script as LF-only\n  t3901: move supporting files into t/t3901/\n  Fix the remaining tests that failed with core.autocrlf=true\n  t4051: mark supporting files as requiring LF-only line endings\n\n .gitattributes                           |  8 ++++++-\n contrib/completion/.gitattributes        |  1 +\n contrib/workdir/.gitattributes           |  1 +\n git-gui/.gitattributes                   |  1 +\n t/.gitattributes                         | 22 +++++++++++++++++-\n t/t0203-gettext-setlocale-sanity.sh      |  4 ++--\n t/t3901-i18n-patch.sh                    | 38 ++++++++++++++++----------------\n t/{t3901-8859-1.txt => t3901/8859-1.txt} |  0\n t/{t3901-utf8.txt => t3901/utf8.txt}     |  0\n t/t9350-fast-export.sh                   |  2 +-\n t/t9500-gitweb-standalone-no-errors.sh   |  4 ++--\n 11 files changed, 55 insertions(+), 26 deletions(-)\n create mode 100644 contrib/completion/.gitattributes\n create mode 100644 contrib/workdir/.gitattributes\n rename t/{t3901-8859-1.txt => t3901/8859-1.txt} (100%)\n rename t/{t3901-utf8.txt => t3901/utf8.txt} (100%)\n\n\nbase-commit: 9b669787fc6ebc527df9ad058c4bcaf46bacc267\nPublished-As: https://github.com/dscho/git/releases/tag/lf-attrs-v3\nFetch-It-Via: git fetch https://github.com/dscho/git lf-attrs-v3\n\nInterdiff vs v2:\n\n diff --git a/t/.gitattributes b/t/.gitattributes\n index bdd82cf31f7..3bd959ae523 100644\n --- a/t/.gitattributes\n +++ b/t/.gitattributes\n @@ -1,4 +1,5 @@\n  t[0-9][0-9][0-9][0-9]/* -whitespace\n +/diff-lib/* eol=lf\n  /t0110/url-* binary\n  /t3900/*.txt eol=lf\n  /t3901/*.txt eol=lf\n diff --git a/t/t4003-diff-rename-1.sh b/t/t4003-diff-rename-1.sh\n index c3e0a3c3fc9..df2accb6555 100755\n --- a/t/t4003-diff-rename-1.sh\n +++ b/t/t4003-diff-rename-1.sh\n @@ -11,7 +11,7 @@ test_description='More rename detection\n  \n  test_expect_success \\\n      'prepare reference tree' \\\n -    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       echo frotz >rezrov &&\n      git update-index --add COPYING rezrov &&\n      tree=$(git write-tree) &&\n @@ -99,7 +99,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n      'prepare work tree once again' \\\n -    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       git update-index --add --remove COPYING COPYING.1'\n  \n  # tree has COPYING and rezrov.  work tree has COPYING and COPYING.1,\n diff --git a/t/t4005-diff-rename-2.sh b/t/t4005-diff-rename-2.sh\n index f1641c35ee2..135addbfbda 100755\n --- a/t/t4005-diff-rename-2.sh\n +++ b/t/t4005-diff-rename-2.sh\n @@ -11,7 +11,7 @@ test_description='Same rename detection as t4003 but testing diff-raw.\n  \n  test_expect_success \\\n      'prepare reference tree' \\\n -    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       echo frotz >rezrov &&\n      git update-index --add COPYING rezrov &&\n      tree=$(git write-tree) &&\n @@ -71,7 +71,7 @@ test_expect_success \\\n  \n  test_expect_success \\\n      'prepare work tree once again' \\\n -    'tr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n +    'cat \"$TEST_DIRECTORY\"/diff-lib/COPYING >COPYING &&\n       git update-index --add --remove COPYING COPYING.1'\n  \n  git diff-index -C --find-copies-harder $tree >current\n diff --git a/t/t4007-rename-3.sh b/t/t4007-rename-3.sh\n index 0157fde5503..dae327fabbf 100755\n --- a/t/t4007-rename-3.sh\n +++ b/t/t4007-rename-3.sh\n @@ -11,7 +11,7 @@ test_description='Rename interaction with pathspec.\n  \n  test_expect_success 'prepare reference tree' '\n  \tmkdir path0 path1 &&\n -\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >path0/COPYING &&\n +\tcp \"$TEST_DIRECTORY\"/diff-lib/COPYING path0/COPYING &&\n  \tgit update-index --add path0/COPYING &&\n  \ttree=$(git write-tree) &&\n  \techo $tree\n diff --git a/t/t4008-diff-break-rewrite.sh b/t/t4008-diff-break-rewrite.sh\n index 5af4fa6aadb..9dd1bc5e162 100755\n --- a/t/t4008-diff-break-rewrite.sh\n +++ b/t/t4008-diff-break-rewrite.sh\n @@ -25,8 +25,8 @@ Further, with -B and -M together, these should turn into two renames.\n  . \"$TEST_DIRECTORY\"/diff-lib.sh ;# test-lib chdir's into trash\n  \n  test_expect_success setup '\n -\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n -\ttr -d \"\\015\" <\"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n +\tcat \"$TEST_DIRECTORY\"/diff-lib/README >file0 &&\n +\tcat \"$TEST_DIRECTORY\"/diff-lib/COPYING >file1 &&\n  \tgit update-index --add file0 file1 &&\n  \tgit tag reference $(git write-tree)\n  '\n\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n"},{"id":"319187","messageId":"6bc890b10de8a59f90005462f8767d6b022b0749.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 1/6] Fix build with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:53:21Z","receivedAt":"2017-05-09T12:53:42Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"On Windows, the default line endings are denoted by a Carriage Return\nbyte followed by a Line Feed byte, while Linux and MacOSX use a single\nLine Feed byte to denote a line ending.\n\nTo help with this situation, Git introduced several mechanisms over the\nlast decade, most prominently the `core.autocrlf` setting.\n\nSometimes, however, a single setting is incorrect, e.g. when certain\nfiles in the source code are to be consumed by software that can handle\nonly LF line endings, while other files can use whatever is appropriate\nfor the current platform.\n\nTo allow for that, Git added the `eol` option to its .gitattributes\nhandling, expecting every user of Git to mark their source code\nappropriately.\n\nBash assumes that line-endings of scripts are denoted by a single Line\nFeed byte. Therefore, shell scripts in Git's source code are one example\nwhere that `eol=lf` option is *required*.\n\nWhen generating common-cmds.h, the Unix tools we use generally operate on\nthe assumption that input and output deliminate their lines using LF-only\nline endings. Consequently, they would happily copy the CR byte verbatim\ninto the strings in common-cmds.h, which in turn makes the C preprocessor\nbarf (that interprets them as MacOS-style line endings). Therefore, we\nhave to mark the input files as LF-only: command-list.txt and\nDocumentation/git-*.txt.\n\nQuite a bit belatedly, this patch brings Git's own source code in line\nwith those expectations by setting those attributes to allow for a\ncorrect build even when core.autocrlf=true.\n\nThis patch can be validated even on Linux, by using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake -j15 DEVELOPER=1\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n .gitattributes         | 8 +++++++-\n git-gui/.gitattributes | 1 +\n 2 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/.gitattributes b/.gitattributes\nindex 320e33c327c..8ce9c6b8888 100644\n--- a/.gitattributes\n+++ b/.gitattributes\n@@ -1,3 +1,9 @@\n * whitespace=!indent,trail,space\n *.[ch] whitespace=indent,trail,space diff=cpp\n-*.sh whitespace=indent,trail,space\n+*.sh whitespace=indent,trail,space eol=lf\n+*.perl eol=lf\n+*.pm eol=lf\n+/Documentation/git-*.txt eol=lf\n+/command-list.txt eol=lf\n+/GIT-VERSION-GEN eol=lf\n+/mergetools/* eol=lf\ndiff --git a/git-gui/.gitattributes b/git-gui/.gitattributes\nindex 33d07c06bd9..59cd41dbff7 100644\n--- a/git-gui/.gitattributes\n+++ b/git-gui/.gitattributes\n@@ -2,3 +2,4 @@\n *           encoding=US-ASCII\n git-gui.sh  encoding=UTF-8\n /po/*.po    encoding=UTF-8\n+/GIT-VERSION-GEN eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"319188","messageId":"8f7119839285970b14f1bcc36567d9093e3d73d1.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 2/6] git-new-workdir: mark script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:53:25Z","receivedAt":"2017-05-09T12:53:50Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Bash does not handle scripts with CR/LF line endings correctly, therefore\nthey *have* to be forced to LF-only line endings.\n\nFunnily enough, this fixes t3000-ls-files-others and\nt1021-rerere-in-workdir when git.git was checked out with\ncore.autocrlf=true, as these test still use git-new-workdir (once `git\nworktree` is no longer marked as experimental, both scripts probably\nwant to be ported to using that command instead).\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n contrib/workdir/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/workdir/.gitattributes\n\ndiff --git a/contrib/workdir/.gitattributes b/contrib/workdir/.gitattributes\nnew file mode 100644\nindex 00000000000..1f78c5d1bd3\n--- /dev/null\n+++ b/contrib/workdir/.gitattributes\n@@ -0,0 +1 @@\n+/git-new-workdir eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"319189","messageId":"c5bf4bad101cceec942d88c884b237e3e2e9f3da.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 3/6] completion: mark bash script as LF-only","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:54:20Z","receivedAt":"2017-05-09T12:54:33Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Without this change, the completion script does not work, as Bash expects\nits scripts to have line feeds as end-of-line markers (this is\nparticularly prominent in quoted multi-line strings, where carriage\nreturns would slip into the strings as verbatim characters otherwise).\n\nThis change is required to let t9902-completion pass when Git's source\ncode is checked out with `core.autocrlf = true`.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n contrib/completion/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n create mode 100644 contrib/completion/.gitattributes\n\ndiff --git a/contrib/completion/.gitattributes b/contrib/completion/.gitattributes\nnew file mode 100644\nindex 00000000000..19116944c15\n--- /dev/null\n+++ b/contrib/completion/.gitattributes\n@@ -0,0 +1 @@\n+*.bash eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"319190","messageId":"f76799ec601a0d7142c30c9ca9424d1d761df2e0.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 4/6] t3901: move supporting files into t/t3901/","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:54:24Z","receivedAt":"2017-05-09T12:54:37Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The current convention is to either generate files on the fly in tests,\nor to use supporting files taken from a t/tNNNN/ directory (where NNNN\nmatches the test's number, or the number of the test from which we\nborrow supporting files).\n\nThe test t3901-i18n-patch.sh was obviously introduced before that\nconvention was in full swing, hence its supporting files still lived in\nt/t3901-8859-1.txt and t/t3901-utf8.txt, respectively.\n\nLet's adjust to the current convention.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n---\n t/t0203-gettext-setlocale-sanity.sh      |  4 ++--\n t/t3901-i18n-patch.sh                    | 38 ++++++++++++++++----------------\n t/{t3901-8859-1.txt => t3901/8859-1.txt} |  0\n t/{t3901-utf8.txt => t3901/utf8.txt}     |  0\n t/t9350-fast-export.sh                   |  2 +-\n t/t9500-gitweb-standalone-no-errors.sh   |  4 ++--\n 6 files changed, 24 insertions(+), 24 deletions(-)\n rename t/{t3901-8859-1.txt => t3901/8859-1.txt} (100%)\n rename t/{t3901-utf8.txt => t3901/utf8.txt} (100%)\n\ndiff --git a/t/t0203-gettext-setlocale-sanity.sh b/t/t0203-gettext-setlocale-sanity.sh\nindex a2124600811..71b0d74b4dd 100755\n--- a/t/t0203-gettext-setlocale-sanity.sh\n+++ b/t/t0203-gettext-setlocale-sanity.sh\n@@ -8,7 +8,7 @@ test_description=\"The Git C functions aren't broken by setlocale(3)\"\n . ./lib-gettext.sh\n \n test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-c-commit\" iso-under-c &&\n \tgit show >out 2>err &&\n \t! test -s err &&\n@@ -16,7 +16,7 @@ test_expect_success 'git show a ISO-8859-1 commit under C locale' '\n '\n \n test_expect_success GETTEXT_LOCALE 'git show a ISO-8859-1 commit under a UTF-8 locale' '\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_commit \"iso-utf8-commit\" iso-under-utf8 &&\n \tLANGUAGE=is LC_ALL=\"$is_IS_locale\" git show >out 2>err &&\n \t! test -s err &&\ndiff --git a/t/t3901-i18n-patch.sh b/t/t3901-i18n-patch.sh\nindex f663d567c8a..923eb01f0ea 100755\n--- a/t/t3901-i18n-patch.sh\n+++ b/t/t3901-i18n-patch.sh\n@@ -31,7 +31,7 @@ test_expect_success setup '\n \n \t# use UTF-8 in author and committer name to match the\n \t# i18n.commitencoding settings\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \ttest_tick &&\n \techo \"$GIT_AUTHOR_NAME\" >mine &&\n@@ -55,7 +55,7 @@ test_expect_success setup '\n \t\t# the second one on the side branch is ISO-8859-1\n \t\tgit config i18n.commitencoding ISO8859-1 &&\n \t\t# use author and committer name in ISO-8859-1 to match it.\n-\t\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt\n+\t\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt\n \tfi &&\n \ttest_tick &&\n \techo Yet another >theirs &&\n@@ -100,7 +100,7 @@ test_expect_success 'rebase (U/U)' '\n \n \t# The result will be committed by GIT_COMMITTER_NAME --\n \t# we want UTF-8 encoded name.\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \tgit checkout -b test &&\n \tgit rebase master &&\n \n@@ -110,7 +110,7 @@ test_expect_success 'rebase (U/U)' '\n test_expect_success 'rebase (U/L)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -122,7 +122,7 @@ test_expect_success !MINGW 'rebase (L/L)' '\n \t# In this test we want ISO-8859-1 encoded commits as the result\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -135,7 +135,7 @@ test_expect_success !MINGW 'rebase (L/U)' '\n \t# to get ISO-8859-1 results.\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase master &&\n@@ -148,7 +148,7 @@ test_expect_success 'cherry-pick(U/U)' '\n \n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -163,7 +163,7 @@ test_expect_success !MINGW 'cherry-pick(L/L)' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -178,7 +178,7 @@ test_expect_success 'cherry-pick(U/L)' '\n \n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -194,7 +194,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit cherry-pick side^ &&\n@@ -207,7 +207,7 @@ test_expect_success !MINGW 'cherry-pick(L/U)' '\n test_expect_success 'rebase --merge (U/U)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -218,7 +218,7 @@ test_expect_success 'rebase --merge (U/U)' '\n test_expect_success 'rebase --merge (U/L)' '\n \tgit config i18n.commitencoding UTF-8 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -230,7 +230,7 @@ test_expect_success 'rebase --merge (L/L)' '\n \t# In this test we want ISO-8859-1 encoded commits as the result\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -243,7 +243,7 @@ test_expect_success 'rebase --merge (L/U)' '\n \t# to get ISO-8859-1 results.\n \tgit config i18n.commitencoding ISO8859-1 &&\n \tgit config i18n.logoutputencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard side &&\n \tgit rebase --merge master &&\n@@ -254,7 +254,7 @@ test_expect_success 'rebase --merge (L/U)' '\n test_expect_success 'am (U/U)' '\n \t# Apply UTF-8 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit am out-u1 out-u2 &&\n@@ -265,7 +265,7 @@ test_expect_success 'am (U/U)' '\n test_expect_success !MINGW 'am (L/L)' '\n \t# Apply ISO-8859-1 patches with ISO-8859-1 commitencoding\n \tgit config i18n.commitencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \tgit am out-l1 out-l2 &&\n@@ -276,7 +276,7 @@ test_expect_success !MINGW 'am (L/L)' '\n test_expect_success 'am (U/L)' '\n \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \tgit reset --hard master &&\n \n \t# am specifies --utf8 by default.\n@@ -288,7 +288,7 @@ test_expect_success 'am (U/L)' '\n test_expect_success 'am --no-utf8 (U/L)' '\n \t# Apply ISO-8859-1 patches with UTF-8 commitencoding\n \tgit config i18n.commitencoding UTF-8 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \n \tgit reset --hard master &&\n \tgit am --no-utf8 out-l1 out-l2 2>err &&\n@@ -303,7 +303,7 @@ test_expect_success 'am --no-utf8 (U/L)' '\n test_expect_success !MINGW 'am (L/U)' '\n \t# Apply UTF-8 patches with ISO-8859-1 commitencoding\n \tgit config i18n.commitencoding ISO8859-1 &&\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \n \tgit reset --hard master &&\n \t# mailinfo will re-code the commit message to the charset specified by\ndiff --git a/t/t3901-8859-1.txt b/t/t3901/8859-1.txt\nsimilarity index 100%\nrename from t/t3901-8859-1.txt\nrename to t/t3901/8859-1.txt\ndiff --git a/t/t3901-utf8.txt b/t/t3901/utf8.txt\nsimilarity index 100%\nrename from t/t3901-utf8.txt\nrename to t/t3901/utf8.txt\ndiff --git a/t/t9350-fast-export.sh b/t/t9350-fast-export.sh\nindex b5149fde6ec..8dcb05c4a57 100755\n--- a/t/t9350-fast-export.sh\n+++ b/t/t9350-fast-export.sh\n@@ -70,7 +70,7 @@ test_expect_success 'iso-8859-1' '\n \n \tgit config i18n.commitencoding ISO8859-1 &&\n \t# use author and committer name in ISO-8859-1 to match it.\n-\t. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \ttest_tick &&\n \techo rosten >file &&\n \tgit commit -s -m den file &&\ndiff --git a/t/t9500-gitweb-standalone-no-errors.sh b/t/t9500-gitweb-standalone-no-errors.sh\nindex 6d06ed96cbc..cc8d463e01a 100755\n--- a/t/t9500-gitweb-standalone-no-errors.sh\n+++ b/t/t9500-gitweb-standalone-no-errors.sh\n@@ -519,7 +519,7 @@ test_expect_success \\\n \n test_expect_success \\\n \t'encode(commit): utf8' \\\n-\t'. \"$TEST_DIRECTORY\"/t3901-utf8.txt &&\n+\t'. \"$TEST_DIRECTORY\"/t3901/utf8.txt &&\n \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n \t echo \"UTF-8\" >> file &&\n@@ -529,7 +529,7 @@ test_expect_success \\\n \n test_expect_success \\\n \t'encode(commit): iso-8859-1' \\\n-\t'. \"$TEST_DIRECTORY\"/t3901-8859-1.txt &&\n+\t'. \"$TEST_DIRECTORY\"/t3901/8859-1.txt &&\n \t test_when_finished \"GIT_AUTHOR_NAME=\\\"A U Thor\\\"\" &&\n \t test_when_finished \"GIT_COMMITTER_NAME=\\\"C O Mitter\\\"\" &&\n \t echo \"ISO-8859-1\" >> file &&\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"319191","messageId":"aa7ebfea3bb72cc1fba8cbb988705e52e7dd5551.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 5/6] Fix the remaining tests that failed with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:54:27Z","receivedAt":"2017-05-09T12:54:40Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test suite is mainly developed on Linux and MacOSX, which is the\nreason that nobody thought to mark files as LF-only as needed.\n\nThe symptom is a test suite that fails left and right when being checked\nout using Git for Windows (which defaults to core.autocrlf=true).\n\nMostly, the problems stem from Git's (LF-only) output being compared to\nhard-coded files that are checked out with line endings according to\ncore.autocrlf (which is of course incorrect). This includes the two test\nfiles in t/diff-lib/, README and COPYING.\n\nThis patch can be validated even on Linux by using this cadence:\n\n\tgit config core.autocrlf true\n\trm .git/index && git stash\n\tmake -j15 DEVELOPER=1 test\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/.gitattributes | 21 ++++++++++++++++++++-\n 1 file changed, 20 insertions(+), 1 deletion(-)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 2d44088f56e..11e5fe37281 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -1,2 +1,21 @@\n t[0-9][0-9][0-9][0-9]/* -whitespace\n-t0110/url-* binary\n+/diff-lib/* eol=lf\n+/t0110/url-* binary\n+/t3900/*.txt eol=lf\n+/t3901/*.txt eol=lf\n+/t4034/*/* eol=lf\n+/t4013/* eol=lf\n+/t4018/* eol=lf\n+/t4100/* eol=lf\n+/t4101/* eol=lf\n+/t4109/* eol=lf\n+/t4110/* eol=lf\n+/t4135/* eol=lf\n+/t4211/* eol=lf\n+/t4252/* eol=lf\n+/t5100/* eol=lf\n+/t5515/* eol=lf\n+/t556x_common eol=lf\n+/t7500/* eol=lf\n+/t8005/*.txt eol=lf\n+/t9*/*.dump eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n\n\n"},{"id":"319192","messageId":"d69519e027904fd0e109b2a50c627b839aa9889a.1494334366.git.johannes.schindelin@gmx.de","threadId":"45850","inReplyTo":"cover.1494334366.git.johannes.schindelin@gmx.de","subject":"[PATCH v3 6/6] t4051: mark supporting files as requiring LF-only line endings","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-09T12:54:32Z","receivedAt":"2017-05-09T12:54:44Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"The test t4051-diff-function-context.sh passes on Linux when\ncore.autocrlf=true even without marking its support files as LF-only,\nbut they fail when core.autocrlf=true in Git for Windows' SDK.\n\nThe reason is that `grep ... >file.c.new` will keep CR/LF line endings\non Linux (obviously treating CRs as if they were regular characters),\nbut will be converted to LF-only line endings with MSYS2's grep that is\nused in Git for Windows.\n\nAs we do not want to validate the way the available `grep` works, let's\njust mark the input as LF-only and move on.\n\nSigned-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\nReviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n---\n t/.gitattributes | 1 +\n 1 file changed, 1 insertion(+)\n\ndiff --git a/t/.gitattributes b/t/.gitattributes\nindex 11e5fe37281..3bd959ae523 100644\n--- a/t/.gitattributes\n+++ b/t/.gitattributes\n@@ -6,6 +6,7 @@ t[0-9][0-9][0-9][0-9]/* -whitespace\n /t4034/*/* eol=lf\n /t4013/* eol=lf\n /t4018/* eol=lf\n+/t4051/* eol=lf\n /t4100/* eol=lf\n /t4101/* eol=lf\n /t4109/* eol=lf\n-- \n2.12.2.windows.2.800.gede8f145e06\n"},{"id":"320456","messageId":"20170522175709.GC17710@aiede.svl.corp.google.com","threadId":"45850","inReplyTo":"6bc890b10de8a59f90005462f8767d6b022b0749.1494334366.git.johannes.schindelin@gmx.de","subject":"Re: [PATCH v3 1/6] Fix build with core.autocrlf=true","fromName":"Jonathan Nieder","fromEmail":"jrnieder@gmail.com","sentAt":"2017-05-22T17:57:09Z","receivedAt":"2017-05-22T17:57:18Z","isPatch":true,"sender":{"key":"jrnieder@gmail.com","avatar":"https://avatars.githubusercontent.com/u/281595?v=4"},"body":"(+cc: Pat Thoyts, git-gui maintainer)\nHi,\n\nJohannes Schindelin wrote:\n\n> On Windows, the default line endings are denoted by a Carriage Return\n> byte followed by a Line Feed byte, while Linux and MacOSX use a single\n> Line Feed byte to denote a line ending.\n>\n> To help with this situation, Git introduced several mechanisms over the\n> last decade, most prominently the `core.autocrlf` setting.\n>\n> Sometimes, however, a single setting is incorrect, e.g. when certain\n> files in the source code are to be consumed by software that can handle\n> only LF line endings, while other files can use whatever is appropriate\n> for the current platform.\n>\n> To allow for that, Git added the `eol` option to its .gitattributes\n> handling, expecting every user of Git to mark their source code\n> appropriately.\n>\n> Bash assumes that line-endings of scripts are denoted by a single Line\n> Feed byte. Therefore, shell scripts in Git's source code are one example\n> where that `eol=lf` option is *required*.\n>\n> When generating common-cmds.h, the Unix tools we use generally operate on\n> the assumption that input and output deliminate their lines using LF-only\n> line endings. Consequently, they would happily copy the CR byte verbatim\n> into the strings in common-cmds.h, which in turn makes the C preprocessor\n> barf (that interprets them as MacOS-style line endings). Therefore, we\n> have to mark the input files as LF-only: command-list.txt and\n> Documentation/git-*.txt.\n>\n> Quite a bit belatedly, this patch brings Git's own source code in line\n> with those expectations by setting those attributes to allow for a\n> correct build even when core.autocrlf=true.\n>\n> This patch can be validated even on Linux, by using this cadence:\n>\n> \tgit config core.autocrlf true\n> \trm .git/index && git stash\n> \tmake -j15 DEVELOPER=1\n>\n> Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>\n> Reviewed-by: Jonathan Nieder <jrnieder@gmail.com>\n> ---\n\nThanks again for writing this patch.  One bit of administrivia I\nmissed before:\n\nPat, would you mind picking up this .gitattributes change for git-gui?\n\nJunio, how do you prefer to handle this in git.git?  Would you need to\namend the patch to remove the git-gui/.gitattributes change and wait\nto get it from Pat, or is getting the same change twice okay?  If I\nunderstand git-gui/GIT-VERSION-GEN correctly, then either way, once\nyou perform a subtree merge from git://repo.or.cz/git-gui the\n\"version\" file will be okay.\n\nPatch left unsnipped for reference.\n\nThanks,\nJonathan\n\n>  .gitattributes         | 8 +++++++-\n>  git-gui/.gitattributes | 1 +\n>  2 files changed, 8 insertions(+), 1 deletion(-)\n> \n> diff --git a/.gitattributes b/.gitattributes\n> index 320e33c327c..8ce9c6b8888 100644\n> --- a/.gitattributes\n> +++ b/.gitattributes\n> @@ -1,3 +1,9 @@\n>  * whitespace=!indent,trail,space\n>  *.[ch] whitespace=indent,trail,space diff=cpp\n> -*.sh whitespace=indent,trail,space\n> +*.sh whitespace=indent,trail,space eol=lf\n> +*.perl eol=lf\n> +*.pm eol=lf\n> +/Documentation/git-*.txt eol=lf\n> +/command-list.txt eol=lf\n> +/GIT-VERSION-GEN eol=lf\n> +/mergetools/* eol=lf\n> diff --git a/git-gui/.gitattributes b/git-gui/.gitattributes\n> index 33d07c06bd9..59cd41dbff7 100644\n> --- a/git-gui/.gitattributes\n> +++ b/git-gui/.gitattributes\n> @@ -2,3 +2,4 @@\n>  *           encoding=US-ASCII\n>  git-gui.sh  encoding=UTF-8\n>  /po/*.po    encoding=UTF-8\n> +/GIT-VERSION-GEN eol=lf\n"},{"id":"320517","messageId":"xmqqh90cmei6.fsf@gitster.mtv.corp.google.com","threadId":"45850","inReplyTo":"20170522175709.GC17710@aiede.svl.corp.google.com","subject":"Re: [PATCH v3 1/6] Fix build with core.autocrlf=true","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2017-05-23T03:35:45Z","receivedAt":"2017-05-23T03:35:51Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jonathan Nieder <jrnieder@gmail.com> writes:\n\n> Junio, how do you prefer to handle this in git.git?  Would you need to\n> amend the patch to remove the git-gui/.gitattributes change and wait\n> to get it from Pat, or is getting the same change twice okay?\n\nYes, getting the same change twice should be fine.  I'll see\nconflicts when I update from Pat when it happens next time, but we\nknow what the resolution should be already.\n"},{"id":"320535","messageId":"alpine.DEB.2.21.1.1705231057510.3610@virtualbox","threadId":"45850","inReplyTo":"xmqqh90cmei6.fsf@gitster.mtv.corp.google.com","subject":"Re: [PATCH v3 1/6] Fix build with core.autocrlf=true","fromName":"Johannes Schindelin","fromEmail":"johannes.schindelin@gmx.de","sentAt":"2017-05-23T09:01:02Z","receivedAt":"2017-05-23T09:01:36Z","isPatch":true,"sender":{"key":"johannes.schindelin@gmx.de","avatar":"https://avatars.githubusercontent.com/u/127790?v=4"},"body":"Hi,\n\nOn Tue, 23 May 2017, Junio C Hamano wrote:\n\n> Jonathan Nieder <jrnieder@gmail.com> writes:\n> \n> > Junio, how do you prefer to handle this in git.git?  Would you need to\n> > amend the patch to remove the git-gui/.gitattributes change and wait\n> > to get it from Pat, or is getting the same change twice okay?\n> \n> Yes, getting the same change twice should be fine.  I'll see\n> conflicts when I update from Pat when it happens next time, but we\n> know what the resolution should be already.\n\nFWIW the reason why I did not open a Pull Request in\nhttps://github.com/patthoyts/git-gui for this change (which I had\noriginally considered) is that I already have a couple of Pull Requests\nopen in that repository, and they are rotting for over half a year\nalready (and will soon compete with certain Icelandic delicacies):\n\nhttps://github.com/patthoyts/git-gui/pulls/dscho\n\nCiao,\nDscho\n"}]}