google / gitiles

A simple browser for Git repositories.
https://gerrit.googlesource.com/gitiles/
Other
578 stars 174 forks source link

CRLF line endings are lost when downloading an archive #202

Open rasky opened 4 years ago

rasky commented 4 years ago

I've recently pushed a commit to Go repository to force Windows .bat files to have CRLF endings: https://github.com/golang/go/commit/787e7b048cff392d1cb68c57c99ff71602997475

This is caused by a bug in Windows batch file parser. More information can be found in the issue (including a simple reproduction): https://github.com/golang/go/issues/37791

Unfortunately, it seems that gitlies ignores this when downloading an archive. If you get a tgz archive from Go master branch: https://go.googlesource.com/go/+archive/refs/heads/master.tar.gz

all batch files (eg: src/make.bat) have LF endings in the archive.

Notice that this does not match the behavior of git-archive or even GitHub (https://github.com/golang/go/archive/master.zip). Both correctly create archives that respect .gitattributes and have correct CRLF endings for batch files.

rasky commented 4 years ago

Maybe related: https://bugs.eclipse.org/bugs/show_bug.cgi?id=545701