You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It would be nice to be able to have a filter that you configure with a path Pattern and it'll return all commits that have modified files matching the path Pattern.
I see there's PatternFindCommitFilter which is close but it's abstract and implementing classes only check in the commit message and not in file paths.
Thanks for this great tool! :)
The text was updated successfully, but these errors were encountered:
FTR I've been able to write the following after some research (took me a while to understand that to get the path I needed a DiffEntry :)):
publicclassPatternFindPathFilterextendsCommitDiffFilter
{
privatefinalMatchermatcher;
publicPatternFindPathFilter(Stringpattern, intflags)
{
super(false);
this.matcher = Pattern.compile(pattern, flags).matcher("");
}
@Overridepublicbooleaninclude(RevCommitcommit, Collection<DiffEntry> diffs) throwsIOException
{
// If one of the diff entry points to some path matching the pattern then count it in!for (DiffEntrydiffEntry : diffs) {
if (this.matcher.reset(diffEntry.getNewPath()).find()) {
returntrue;
}
}
returnfalse;
}
}
It would be nice to be able to have a filter that you configure with a path Pattern and it'll return all commits that have modified files matching the path Pattern.
I see there's PatternFindCommitFilter which is close but it's abstract and implementing classes only check in the commit message and not in file paths.
Thanks for this great tool! :)
The text was updated successfully, but these errors were encountered: