gitDir := flag.String("git-dir", "", "Path to .git repository")
notesRef := flag.String("ref", "comments", "notes reference name")
umask := flag.String("umask", "027", "umask value")
+ dryRun := flag.Bool("dryrun", false, "Show comment, do not add")
flag.Parse()
uid := syscall.Geteuid()
if err := syscall.Setuid(uid); err != nil {
strings.Join(lines, "\n"),
)))
+ if *dryRun {
+ fmt.Print(buf.String())
+ os.Exit(0)
+ }
+
cmd = exec.Command(
*gitCmd, "--git-dir", *gitDir,
"notes", "--ref", *notesRef, "add",