From 5c156fa55e2ee7980a6bbfc9a0a7df5b8984aef0 Mon Sep 17 00:00:00 2001 From: Jeff Carr Date: Wed, 18 Dec 2024 01:29:07 -0600 Subject: add --purge to get rid of all notes --- notes.go | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 notes.go (limited to 'notes.go') diff --git a/notes.go b/notes.go new file mode 100644 index 0000000..59543c9 --- /dev/null +++ b/notes.go @@ -0,0 +1,19 @@ +package main + +import ( + "strings" + + "go.wit.com/lib/protobuf/gitpb" + "go.wit.com/log" +) + +func purgeNotes(repo *gitpb.Repo) error { + result := repo.Run([]string{"git", "notes", "list"}) + for _, line := range result.Stdout { + parts := strings.Fields(line) + log.Info("line:", line, "part", parts[1]) + blah := repo.Run([]string{"git", "notes", "remove", parts[1]}) + log.Info(strings.Join(blah.Stdout, "\n")) + } + return nil +} -- cgit v1.2.3