Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/shibumi/go-pathspec
gitignore-style pathspec pattern matching in Go
https://github.com/shibumi/go-pathspec
git gitignore go hacktoberfest pathspec regex
Last synced: 11 days ago
JSON representation
gitignore-style pathspec pattern matching in Go
- Host: GitHub
- URL: https://github.com/shibumi/go-pathspec
- Owner: shibumi
- License: apache-2.0
- Created: 2020-07-13T12:47:44.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2023-07-22T22:48:03.000Z (over 1 year ago)
- Last Synced: 2024-10-17T18:31:50.280Z (21 days ago)
- Topics: git, gitignore, go, hacktoberfest, pathspec, regex
- Language: Go
- Homepage:
- Size: 45.9 KB
- Stars: 7
- Watchers: 2
- Forks: 1
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-pathspec
[![test](https://github.com/shibumi/go-pathspec/workflows/test/badge.svg)](https://github.com/shibumi/go-pathspec/actions?query=workflow%3Atest) [![Coverage Status](https://coveralls.io/repos/github/shibumi/go-pathspec/badge.svg)](https://coveralls.io/github/shibumi/go-pathspec) [![PkgGoDev](https://pkg.go.dev/badge/github.com/shibumi/go-pathspec)](https://pkg.go.dev/github.com/shibumi/go-pathspec)
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/108What does not work is global filename pattern matching. Consider the following
`.gitignore` file:```gitignore
# gitignore test file
parse.go
```Then `parse.go` should match on all filenames called `parse.go`. You can test this via
this shell script:
```shell
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 ()
Christian Rebischke ()