aboutsummaryrefslogtreecommitdiff
path: root/.gitattributes
AgeCommit message (Collapse)Author
2020-06-08all: treat all files as binary, but check in .bat with CRLFDmitri Shuralyov
This is a followup to CL 96495. It should be simpler and more robust to achieve .bat files having CRLF line endings by treating it as a binary file, like all other files, and checking it in with the desired CRLF line endings. A test is used to check the entire Go tree, short of directories starting with "." and named "testdata", for any .bat files that have anything other than strict CRLF line endings. This will help catch any accidental modifications to existing .bat files or check ins of new .bat files. Importantly, this is compatible with how Gerrit serves .tar.gz files, making it so that CRLF line endings are preserved. The Go project is supported on many different environments, some of which may have limited git implementations available, or none at all. Relying on fewer git features and special rules makes it easier to have confidence in the exact content of all files. Additionally, Go development started in Subversion, moved to Perforce, then Mercurial, and now uses Git.¹ Reducing its reliance on git-specific features will help if there will be another transition in the project's future. There are only 5 .bat files in the entire Go source tree, so a new one being added is a rare event, and we prefer to do things in Go instead. We still have the option of improving the experience for developers by adding a pre-commit converter for .bat files to the git-codereview tool. ¹ https://groups.google.com/d/msg/golang-dev/sckirqOWepg/YmyT7dWJiocJ Fixes #39391. For #37791. Change-Id: I6e202216322872f0307ac96f1b8d3f57cb901e6b Reviewed-on: https://go-review.googlesource.com/c/go/+/236437 Reviewed-by: Bryan C. Mills <bcmills@google.com>
2020-03-22build: force all Windows batch files to CRLFGiovanni Bajo
Batch files should use CRLF endings. LF endings mostly work but in some situations they cause random errors like goto commands failing for mysterious reasons. See golang.org/issue/37791 for more information. Next CL triggered one of such bug (a label was not being recognized), so prepare for it by converting to CRLF. This CL also touches all existing batch files to force git to update the line endings (unfortunately, changing .gitattributes only has effect next time the file is checked out or modified). Fixes #37791 Updates #9281 Change-Id: I6f9a114351cb7ac9881914400aa210c930eb8cc1 Reviewed-on: https://go-review.googlesource.com/c/go/+/96495 Run-TryBot: Giovanni Bajo <rasky@develer.com> Reviewed-by: Ian Lance Taylor <iant@golang.org> Reviewed-by: Alex Brainman <alex.brainman@gmail.com>
2014-12-12.gitattributes: prevent all magic line ending changesBrad Fitzpatrick
Fixes #9281 Change-Id: Id060e9cbad086c994ec74b240f5c61e971e5690b Reviewed-on: https://go-review.googlesource.com/1490 Reviewed-by: Minux Ma <minux@golang.org> Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
2014-12-12.gitattributes: enforce unix eol styleShenghou Ma
Change-Id: I5f021b131f5650217bd14dec09cfb81fb0447b9e Reviewed-on: https://go-review.googlesource.com/1422 Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>