<html xmlns:v="urn:schemas-microsoft-com:vml" xmlns:o="urn:schemas-microsoft-com:office:office" xmlns:w="urn:schemas-microsoft-com:office:word" xmlns:m="http://schemas.microsoft.com/office/2004/12/omml" xmlns="http://www.w3.org/TR/REC-html40">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="Generator" content="Microsoft Word 15 (filtered medium)">
<style><!--
/* Font Definitions */
@font-face
        {font-family:"Cambria Math";
        panose-1:2 4 5 3 5 4 6 3 2 4;}
@font-face
        {font-family:Calibri;
        panose-1:2 15 5 2 2 2 4 3 2 4;}
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
        {margin:0in;
        margin-bottom:.0001pt;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
a:link, span.MsoHyperlink
        {mso-style-priority:99;
        color:blue;
        text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
        {mso-style-priority:99;
        color:purple;
        text-decoration:underline;}
p.msonormal0, li.msonormal0, div.msonormal0
        {mso-style-name:msonormal;
        mso-margin-top-alt:auto;
        margin-right:0in;
        mso-margin-bottom-alt:auto;
        margin-left:0in;
        font-size:11.0pt;
        font-family:"Calibri",sans-serif;}
span.EmailStyle18
        {mso-style-type:personal-reply;
        font-family:"Calibri",sans-serif;
        color:windowtext;}
.MsoChpDefault
        {mso-style-type:export-only;
        font-family:"Calibri",sans-serif;}
@page WordSection1
        {size:8.5in 11.0in;
        margin:1.0in 1.0in 1.0in 1.0in;}
div.WordSection1
        {page:WordSection1;}
--></style><!--[if gte mso 9]><xml>
<o:shapedefaults v:ext="edit" spidmax="1026" />
</xml><![endif]--><!--[if gte mso 9]><xml>
<o:shapelayout v:ext="edit">
<o:idmap v:ext="edit" data="1" />
</o:shapelayout></xml><![endif]-->
</head>
<body lang="EN-US" link="blue" vlink="purple">
<div class="WordSection1">
<p class="MsoNormal">Right, my understanding is that files that specifically need CRLF should say so via .gitattributes somewhere.<o:p></o:p></p>
<p class="MsoNormal">autocrlf=false ought to work if your Windows editor doesn’t (or can be persuaded not to) introduce CRLFs.  I’ve observed that the Visual Studio editor will detect the line-ending style of the file you’re editing, and imitate it.  This works
 great until you create a new file. <span style="font-family:"Segoe UI Emoji",sans-serif">
😝</span> So I’ve learned to “create” a file by copying an existing file and then editing it.<o:p></o:p></p>
<p class="MsoNormal">I’m inclined to think the llvm.org docs should say to use “input” on Windows, we’ve been happy with that in the Sony repo as James mentioned.<o:p></o:p></p>
<p class="MsoNormal">But I’d also like to hear from a Windows user from outside Sony first.<o:p></o:p></p>
<p class="MsoNormal">--paulr<o:p></o:p></p>
<p class="MsoNormal"><o:p> </o:p></p>
<div style="border:none;border-left:solid blue 1.5pt;padding:0in 0in 0in 4.0pt">
<div>
<div style="border:none;border-top:solid #E1E1E1 1.0pt;padding:3.0pt 0in 0in 0in">
<p class="MsoNormal"><b>From:</b> llvm-dev <llvm-dev-bounces@lists.llvm.org> <b>On Behalf Of
</b>Greg Bedwell via llvm-dev<br>
<b>Sent:</b> Thursday, January 16, 2020 12:27 PM<br>
<b>To:</b> jh7370.2008@my.bristol.ac.uk<br>
<b>Cc:</b> llvm-dev <llvm-dev@lists.llvm.org><br>
<b>Subject:</b> Re: [llvm-dev] Git autocrlf for Windows - why does the Getting Started guide say to use false?<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<p class="MsoNormal">The previous discussion about it was here:  <a href="https://reviews.llvm.org/D48494">
https://reviews.llvm.org/D48494</a><o:p></o:p></p>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Personally I'd rather see if we could solve it with some clever use of .gitattributes rather than make it a user-setting but sadly I don't have time right now to commit to trying out a solution.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal">I notice that there is one case already of using .gitattributes to make sure autocrlf doesn't change line endings, FWIW:<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><a href="https://github.com/llvm/llvm-project/blob/master/llvm/.gitattributes#L19">https://github.com/llvm/llvm-project/blob/master/llvm/.gitattributes#L19</a>  <o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
</div>
<p class="MsoNormal"><o:p> </o:p></p>
<div>
<div>
<p class="MsoNormal">On Thu, 16 Jan 2020 at 15:19, James Henderson via llvm-dev <<a href="mailto:llvm-dev@lists.llvm.org">llvm-dev@lists.llvm.org</a>> wrote:<o:p></o:p></p>
</div>
<blockquote style="border:none;border-left:solid #CCCCCC 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-right:0in">
<div>
<div>
<p class="MsoNormal">Hi all,<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">TL;DR - should we recommend core.autocrlf=input instead of core.autocrlf=false on Windows?<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I recently switched from doing pre-commit builds and tests from my Ubuntu VM, to my Windows machine where I do all my development. I was aware that line endings is an issue, so made sure to set core.autocrlf=false as directed in the Getting
 Started guide (see <a href="https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm" target="_blank">
https://llvm.org/docs/GettingStarted.html#getting-the-source-code-and-building-llvm</a> and
<a href="https://llvm.org/docs/GettingStarted.html#checkout-llvm-from-git" target="_blank">
https://llvm.org/docs/GettingStarted.html#checkout-llvm-from-git</a> which explicitly say to use "false"). This seemed a little odd to me, as that would mean that if I made any edits, I could potentially end up with Windows line endings, by my understanding,
 but I assumed that I had misunderstood something, so just went along with it.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">However, at some point in one of my commits (at least I assume it was one of mine, since I was working on the file), I somehow managed to change an existing file to using Windows line endings, which someone else fixed for me (see commit
 aca3e70d2bc0dd89b7d486c2a8eac70d8a89e790).<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">Having double-checked against my settings on my downstream clone, I noticed that I had core.autocrlf set to input there, and as far as I know, I've never had any line-ending problems with working with LLVM in that repo. My understanding
 is "input" should avoid problems such as mine, i.e. by ensuring the checked-in files have LF line endings, whilst everybody, regardless of system will get native line endings in their actual clones. I am aware that there are some files that deliberately use
 Windows line endings - I'm guessing that these are not widespread and that they don't need regularly modifying, so presumably those users who need to edit those files can change their setting as needed.<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">I'm happy to update the docs, but I want to make sure that any update I make is correct!<o:p></o:p></p>
</div>
<div>
<p class="MsoNormal"><o:p> </o:p></p>
</div>
<div>
<p class="MsoNormal">James<o:p></o:p></p>
</div>
</div>
<p class="MsoNormal">_______________________________________________<br>
LLVM Developers mailing list<br>
<a href="mailto:llvm-dev@lists.llvm.org" target="_blank">llvm-dev@lists.llvm.org</a><br>
<a href="https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev" target="_blank">https://lists.llvm.org/cgi-bin/mailman/listinfo/llvm-dev</a><o:p></o:p></p>
</blockquote>
</div>
</div>
</div>
</body>
</html>