go-git / go-git

A highly extensible Git implementation in pure Go.
https://pkg.go.dev/github.com/go-git/go-git/v5
Apache License 2.0
5.68k stars 712 forks source link

Documentation on gitignore package #494

Open nbraun-wolf opened 2 years ago

nbraun-wolf commented 2 years ago

Hi, I was looking into the gitignore package, but It's not quite clear to me how this should be used correctly.

I have really no idea what the domain argument is for in the ParsePattern function. I did look at some tests, but I still couldn't figure it out. From some of my own tests, it seems to work just fine when this parameter is nil.

The second thing that's a bit confusing is that the path parameter on Matcher.Match method is a slice. I believe this should be the full path of a file split on some path separator. I.e. forward slash on Linux.

isDir on the Matcher.Match method is also a bit confusing. My guess is that this flag indicates whether the passed path is a file or directory.

It would be great if this package was better documented, or at least had comments in the code explaining the parameters.

github-actions[bot] commented 4 days ago

To help us keep things tidy and focus on the active tasks, we've introduced a stale bot to spot issues/PRs that haven't had any activity in a while.

This particular issue hasn't had any updates or activity in the past 90 days, so it's been labeled as 'stale'. If it remains inactive for the next 30 days, it'll be automatically closed.

We understand everyone's busy, but if this issue is still important to you, please feel free to add a comment or make an update to keep it active.

Thanks for your understanding and cooperation!