aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--git-codereview/change-id.go11
-rw-r--r--git-codereview/review.go3
2 files changed, 14 insertions, 0 deletions
diff --git a/git-codereview/change-id.go b/git-codereview/change-id.go
new file mode 100644
index 0000000..dd2dee0
--- /dev/null
+++ b/git-codereview/change-id.go
@@ -0,0 +1,11 @@
+// Copyright 2024 The Go Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style
+// license that can be found in the LICENSE file.
+
+package main
+
+import "fmt"
+
+func cmdChangeId(args []string) {
+ fmt.Printf("Change-Id: I%x\n", randomBytes())
+}
diff --git a/git-codereview/review.go b/git-codereview/review.go
index ad0632a..940b6dc 100644
--- a/git-codereview/review.go
+++ b/git-codereview/review.go
@@ -65,6 +65,7 @@ Available commands:
branchpoint
change [name]
change NNNN[/PP]
+ change-id
gofmt [-l]
help
hooks
@@ -106,6 +107,8 @@ func main() {
cmd = cmdBranchpoint
case "change":
cmd = cmdChange
+ case "change-id":
+ cmd = cmdChangeId
case "gofmt":
cmd = cmdGofmt
case "hook-invoke":