Skip to content

Commit c0e66ca

Browse files
authored
Make log command extensible internally (#3888)
I'm experimenting with ways to manipulate the git log that's being used to generate diffs (specifically, limiting its depth in some cases). Tweaking RepoPath for this locally isn't a huge deal but making the log command extensible seems like it could generally be useful, so I figured I'd do it.
1 parent a13ea81 commit c0e66ca

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

pkg/gitparse/gitparse.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ func (c *Parser) RepoPath(
228228
abbreviatedLog bool,
229229
excludedGlobs []string,
230230
isBare bool,
231+
additionalArgs ...string,
231232
) (chan *Diff, error) {
232233
args := []string{
233234
"-C", source,
@@ -246,6 +247,7 @@ func (c *Parser) RepoPath(
246247
} else {
247248
args = append(args, "--all")
248249
}
250+
args = append(args, additionalArgs...) // These need to come before --
249251
for _, glob := range excludedGlobs {
250252
args = append(args, "--", ".", ":(exclude)"+glob)
251253
}

0 commit comments

Comments
 (0)