From 24d018e17cefeb4b15dc8e25b2fe7f64a0130164 Mon Sep 17 00:00:00 2001 From: Matthew Sykes Date: Mon, 13 Apr 2020 09:14:23 -0400 Subject: [PATCH] build: prevent eol modification in vendored code When 'dep ensure -vendor-only' is run, dep will update the dependencies in the vendor directory to match what's referenced in Gopkg.lock. It does this without performing EOL modification. Even if there are no changes to the dependencies, this shows up as pending changes in tree. ``` Changes not staged for commit: (use "git add ..." to update what will be committed) (use "git checkout -- ..." to discard changes in working directory) modified: vendor/github.com/Knetic/govaluate/LICENSE modified: vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE ``` When you run `git diff` to see the changes, warnings like the following are issued: ``` warning: CRLF will be replaced by LF in vendor/github.com/Knetic/govaluate/LICENSE. The file will have its original line endings in your working directory. ``` This is telling us that when we add the changes to the index, git will convert the CRLF to LF leaving is with no changes in the index and nothing to commit. We can prevent this confusion by disabling the automatic text conversion for files in the vendor folder. This change disables text conversion for vendor/** and re-adds the files with CRLF from our vendor tree. Signed-off-by: Matthew Sykes --- .gitattributes | 1 + vendor/github.com/Knetic/govaluate/LICENSE | 42 +++++++++---------- .../{license => LICENSE} | 0 3 files changed, 22 insertions(+), 21 deletions(-) rename vendor/github.com/konsorten/go-windows-terminal-sequences/{license => LICENSE} (100%) diff --git a/.gitattributes b/.gitattributes index bac78964c98..07d42b28b80 100644 --- a/.gitattributes +++ b/.gitattributes @@ -16,3 +16,4 @@ *.yml text eol=lf *.zip binary LICENSE text eol=lf +vendor/** -text diff --git a/vendor/github.com/Knetic/govaluate/LICENSE b/vendor/github.com/Knetic/govaluate/LICENSE index 0ef0f41ec9a..24b9b459192 100644 --- a/vendor/github.com/Knetic/govaluate/LICENSE +++ b/vendor/github.com/Knetic/govaluate/LICENSE @@ -1,21 +1,21 @@ -The MIT License (MIT) - -Copyright (c) 2014-2016 George Lester - -Permission is hereby granted, free of charge, to any person obtaining a copy -of this software and associated documentation files (the "Software"), to deal -in the Software without restriction, including without limitation the rights -to use, copy, modify, merge, publish, distribute, sublicense, and/or sell -copies of the Software, and to permit persons to whom the Software is -furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all -copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR -IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, -FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE -AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER -LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, -OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE -SOFTWARE. +The MIT License (MIT) + +Copyright (c) 2014-2016 George Lester + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/vendor/github.com/konsorten/go-windows-terminal-sequences/license b/vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE similarity index 100% rename from vendor/github.com/konsorten/go-windows-terminal-sequences/license rename to vendor/github.com/konsorten/go-windows-terminal-sequences/LICENSE