Merged
Conversation
Right now, we have a function which can trim the relative path prefix, but that is only available in the `commands` package. In the future, we'll want to use it elsewhere as well, so let's move it somewhere more accessible.
In Go 1.20, `filepath.Rel` always produces a path starting with `.` on Windows if the path is relative to the current directory. While this is valid, it's not helpful, because we want to trim off the leading directory portion leaving us with a bare relative path. If we accepted this behaviour, we'd break our checking for already-present patterns in `git lfs track`, and more importantly, we wouldn't recognize raw patterns wherever they are in the tree, since we'd falsely believe that those patterns were specified with a leading dot. To fix this, always trim the current directory prefix from our relative directory and explicitly check for `.` and turn it into an empty string.
Abuchtela
referenced
this pull request
Mar 21, 2023
`cinst` is deprecated in favour of `choco install`. Convert our CI system and release process to the new form and move the `-y` to its proper place before the package name for better compatibility.
When we compare a pattern path with the version in the `.gitattributes` file, use slashes, since that's what the pattern in the file will be using. To do so, use the `path` module, not `filepath`, the latter of which uses the OS's path separators, which on Windows is backslashes.
643cb7b to
34c680b
Compare
chrisd8088
approved these changes
Mar 23, 2023
Member
chrisd8088
left a comment
There was a problem hiding this comment.
Great detective work, thank you!
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
As some have recently noticed, our Windows CI has been broken due to the
t/t-track.shtest failing, which has been caused by a change to our CI in Go 1.20 wherein it always “helpfully” includes a dot component for relative paths with no other directory. This is not very helpful in our case, and patch 2 here fixes that problem.Patch 3 also fixes a problem that had gone unnoticed by our testsuite but that is related.
As usual, these commits all have their own reasonable commit messages and explain independently why they're valuable.