cmd/coordinator: rewrite parents commits when filtering
When using the -filter option with the watcher, it is possible that
a commit's parent will not be included in the filter. This patch
adds the --parents option to git log so that the filtered commit tree
is rewritten such that each commit's parent is in the filtered tree.
Change-Id: I79dad0b8648e0497bc4ae0bd98ec76573d26de5d
Reviewed-on: https://go-review.googlesource.com/16081
Reviewed-by: Brad Fitzpatrick <bradfitz@golang.org>
diff --git a/cmd/coordinator/watcher_process.go b/cmd/coordinator/watcher_process.go
index cbd34f0..d271920 100644
--- a/cmd/coordinator/watcher_process.go
+++ b/cmd/coordinator/watcher_process.go
@@ -661,7 +661,7 @@
// log runs "git log" with the supplied arguments
// and parses the output into Commit values.
func (r *Repo) log(dir string, args ...string) ([]*Commit, error) {
- args = append([]string{"log", "--date=rfc", "--name-only", logFormat}, args...)
+ args = append([]string{"log", "--date=rfc", "--name-only", "--parents", logFormat}, args...)
if r.path == "" && *filter != "" {
paths := strings.Split(*filter, ",")
args = append(args, "--")