aboutsummaryrefslogtreecommitdiffstats
path: root/options.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2020-03-10 00:02:14 +0100
committerGitHub <noreply@github.com>2020-03-10 00:02:14 +0100
commiteef67789e846acc85e1ed2af2760d6716b2a9f07 (patch)
treeb3578068aca7e71d27fda254d919e6e0ad9e90ba /options.go
parent87d3d897d903af9cdd5cf500fd36d3533235fc02 (diff)
parent027dadf289dcf974405d283d13d5a856b0988b38 (diff)
downloadgo-git-eef67789e846acc85e1ed2af2760d6716b2a9f07.tar.gz
Merge pull request #3 from go-git/pr-1248
git.LogOptions: add `PathFilter func(string) bool`
Diffstat (limited to 'options.go')
-rw-r--r--options.go7
1 files changed, 7 insertions, 0 deletions
diff --git a/options.go b/options.go
index cc8f9c5..9a03560 100644
--- a/options.go
+++ b/options.go
@@ -343,8 +343,15 @@ type LogOptions struct {
// Show only those commits in which the specified file was inserted/updated.
// It is equivalent to running `git log -- <file-name>`.
+ // this field is kept for compatility, it can be replaced with PathFilter
FileName *string
+ // Filter commits based on the path of files that are updated
+ // takes file path as argument and should return true if the file is desired
+ // It can be used to implement `git log -- <path>`
+ // either <path> is a file path, or directory path, or a regexp of file/directory path
+ PathFilter func(string) bool
+
// Pretend as if all the refs in refs/, along with HEAD, are listed on the command line as <commit>.
// It is equivalent to running `git log --all`.
// If set on true, the From option will be ignored.