summaryrefslogtreecommitdiff
path: root/going2git
diff options
context:
space:
mode:
Diffstat (limited to 'going2git')
-rw-r--r--going2git/Makefile28
-rw-r--r--going2git/message.go23
2 files changed, 51 insertions, 0 deletions
diff --git a/going2git/Makefile b/going2git/Makefile
new file mode 100644
index 0000000..1e8c9f8
--- /dev/null
+++ b/going2git/Makefile
@@ -0,0 +1,28 @@
+VERSION = $(shell git describe --tags)
+GUIVERSION = $(shell git describe --tags)
+BUILDTIME = $(shell date +%s)
+
+all: build
+
+build: goimports
+ GO111MODULE=off go build \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+vet:
+ GO111MODULE=off go vet
+
+goimports:
+ goimports -w *.go
+ # // to globally reset paths:
+ # // gofmt -w -r '"go.wit.com/gui/gadgets" -> "go.wit.com/lib/gadgets"' *.go
+
+gocui: build
+ reset
+ ./go-clone-test --gui gocui
+
+install: goimports
+ GO111MODULE=off go install \
+ -ldflags "-X main.VERSION=${VERSION} -X main.BUILDTIME=${BUILDTIME} -X gui.GUIVERSION=${VERSION}"
+
+force: build
+ ./go-clone-test --force
diff --git a/going2git/message.go b/going2git/message.go
new file mode 100644
index 0000000..f2bc2ba
--- /dev/null
+++ b/going2git/message.go
@@ -0,0 +1,23 @@
+package main
+
+import (
+ "fmt"
+
+ git "go.wit.com/lib/git2go"
+ "go.wit.com/log"
+)
+
+func main() {
+ var input git.Trailer
+
+ input.Key = "Co-authored-by"
+ input.Value = "Alice <[email protected]>"
+ /*
+ git2go.Trailer
+ git2go.Trailer{Key: "Signed-off-by", Value: "Bob <[email protected]>"}}
+ */
+
+ fmt.Printf("%s", input)
+ actual, err := git.MessageTrailers(input.Key)
+ log.Info("actual", actual, err)
+}