Skip to content

📝 document autocrlf needs to be off#3139

Merged
mhegazy merged 1 commit into
microsoft:masterfrom
basarat:patch-1
May 19, 2015
Merged

📝 document autocrlf needs to be off#3139
mhegazy merged 1 commit into
microsoft:masterfrom
basarat:patch-1

Conversation

@basarat
Copy link
Copy Markdown
Contributor

@basarat basarat commented May 12, 2015

otherwise people will get test failures which are not immediately obvious

otherwise people will get test failures which are not immediately obvious
@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 12, 2015

I've seen this come up enough to warrant this documentation

@DanielRosenwasser
Copy link
Copy Markdown
Member

Not sure if we should be suggesting this be set globally.

@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 12, 2015

Not sure if we should be suggesting this be set globally.

Sure see : #3143

@DanielRosenwasser
Copy link
Copy Markdown
Member

@basarat while I work on a real solution, can you just remove the --global flag from the step and move this to CONTRIBUTING.md since this is actually a guide on how to build TypeScript?

@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 15, 2015

move this to CONTRIBUTING.md since this is actually a guide on how to build TypeScript

I think it would be better here because otherwise jake runtests will fail otherwise :

image

@DanielRosenwasser
Copy link
Copy Markdown
Member

Good point; let's just add a step before "Install Jake tools and dev dependencies":

Configure autocrlf settings for your clone:

git config core.autocrlf false

@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 15, 2015

let's just add a step before "Install Jake tools and dev dependencies":

I was just testing this workflow :)

image

@DanielRosenwasser
Copy link
Copy Markdown
Member

Ah...ah! That's going to be bad! Okay, I see. Point well-taken. 😄

@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 15, 2015

I was just testing this workflow

Tested:
image

But didn't work:
image

Seems it needs to be set (globally) before cloning ¯_(ツ)_/¯

@tinganho
Copy link
Copy Markdown
Contributor

How does your .git/config look like?

Mine look like this:

[core]
    repositoryformatversion = 0
    filemode = true
    bare = false
    logallrefupdates = true
    ignorecase = true
    precomposeunicode = true
    autocrlf = false
[branch "master"]
[remote "origin"]
    url = git@github.com:tinganho/TypeScript.git
    fetch = +refs/heads/*:refs/remotes/origin/*
[remote "upstream"]
    url = git@github.com:Microsoft/TypeScript.git
    fetch = +refs/heads/*:refs/remotes/upstream/*
[color "diff"]
    whitespace = red reverse

@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 15, 2015

autocrlf = false

@tinganho gets driven by git config core.autocrlf <option> (There is nothing there by default). However changing it after cloning doesn't get tests to pass.

@tinganho
Copy link
Copy Markdown
Contributor

I always thought a .gitattributes file was more appropriate. But haven't got it worked before.

Though I haven't tested this yet:

src/**/*     crlf
scripts/**/* crlf
tests/**/*   crlf=false

from http://adaptivepatchwork.com/2012/03/01/mind-the-end-of-your-line/

@tinganho
Copy link
Copy Markdown
Contributor

@basarat I just submitted a new PR #3174 with .gitattributes and tests/**/* crlf=false and it seem to have worked.

mhegazy added a commit that referenced this pull request May 19, 2015
📝 document autocrlf needs to be off
@mhegazy mhegazy merged commit 0d5653e into microsoft:master May 19, 2015
@mhegazy
Copy link
Copy Markdown
Contributor

mhegazy commented May 19, 2015

thanks!

@basarat basarat deleted the patch-1 branch May 20, 2015 00:16
@basarat
Copy link
Copy Markdown
Contributor Author

basarat commented May 20, 2015

🌹

@microsoft microsoft locked and limited conversation to collaborators Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants