From 224f047f4f95b44434f84303746c37439929e02b Mon Sep 17 00:00:00 2001 From: Saeed Rasooli Date: Fri, 29 Nov 2019 13:39:29 +0330 Subject: add `PathFilter func(string) bool` to LogOptions Signed-off-by: Saeed Rasooli --- options.go | 7 +++++++ 1 file changed, 7 insertions(+) (limited to 'options.go') 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 -- `. + // 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 -- ` + // either 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 . // It is equivalent to running `git log --all`. // If set on true, the From option will be ignored. -- cgit