You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
buildx/vendor/github.com/shibumi/go-pathspec
Justin Chadwell e61a8cf637 vendor: update buildkit to master@31c870e82a48
Signed-off-by: Justin Chadwell <me@jedevc.com>
2 years ago
..
.gitignore vendor: update buildkit to master@31c870e82a48 2 years ago
GO-LICENSE vendor: update buildkit to master@31c870e82a48 2 years ago
LICENSE vendor: update buildkit to master@31c870e82a48 2 years ago
README.md vendor: update buildkit to master@31c870e82a48 2 years ago
gitignore.go vendor: update buildkit to master@31c870e82a48 2 years ago

README.md

go-pathspec

build Coverage Status PkgGoDev

go-pathspec implements gitignore-style pattern matching for paths.

Alternatives

There are a few alternatives, that try to be gitignore compatible or even state gitignore compatibility:

https://github.com/go-git/go-git

go-git states it would be gitignore compatible, but actually they are missing a few special cases. This issue describes one of the not working patterns: https://github.com/go-git/go-git/issues/108

What does not work is global filename pattern matching. Consider the following .gitignore file:

# gitignore test file
parse.go

Then parse.go should match on all filenames called parse.go. You can test this via this shell script:

mkdir -p /tmp/test/internal/util
touch /tmp/test/internal/util/parse.go
cd /tmp/test/
git init
echo "parse.go" > .gitignore

With git parse.go will be excluded. The go-git implementation behaves different.

https://github.com/monochromegane/go-gitignore

monochromegane's go-gitignore does not support the use of **-operators. This is not consistent to real gitignore behavior, too.

Authors

Sander van Harmelen (sander@xanzy.io)
Christian Rebischke (chris@shibumi.dev)