diff options
author | C. Brown <hackdom@majoolr.io> | 2019-05-08 21:44:28 +0800 |
---|---|---|
committer | Péter Szilágyi <peterke@gmail.com> | 2019-05-08 21:44:28 +0800 |
commit | be4d74f8d22e573d37a4bf4514aa4320cb62a75d (patch) | |
tree | d451cb8c7c0fb3d91866d933d0038150f951a50f /cmd/geth | |
parent | c113723fdb9d9fa4c8ac57777f9aecfe97391453 (diff) | |
download | go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar.gz go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar.bz2 go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar.lz go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar.xz go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.tar.zst go-tangerine-be4d74f8d22e573d37a4bf4514aa4320cb62a75d.zip |
cmd, internal/build, docker: advertise commit date in unstable build versions (#19522)
* add-date-to unstable
* fields-insteadof-split
* internal/build: support building with missing git
* docker: add git history back to support commit date in version
* internal/build: use PR commits hashes for PR builds
Diffstat (limited to 'cmd/geth')
-rw-r--r-- | cmd/geth/config.go | 2 | ||||
-rw-r--r-- | cmd/geth/consolecmd_test.go | 4 | ||||
-rw-r--r-- | cmd/geth/main.go | 3 | ||||
-rw-r--r-- | cmd/geth/misccmd.go | 3 |
4 files changed, 8 insertions, 4 deletions
diff --git a/cmd/geth/config.go b/cmd/geth/config.go index f316380ce..8f0bae822 100644 --- a/cmd/geth/config.go +++ b/cmd/geth/config.go @@ -101,7 +101,7 @@ func loadConfig(file string, cfg *gethConfig) error { func defaultNodeConfig() node.Config { cfg := node.DefaultConfig cfg.Name = clientIdentifier - cfg.Version = params.VersionWithCommit(gitCommit) + cfg.Version = params.VersionWithCommit(gitCommit, gitDate) cfg.HTTPModules = append(cfg.HTTPModules, "eth", "shh") cfg.WSModules = append(cfg.WSModules, "eth", "shh") cfg.IPCPath = "geth.ipc" diff --git a/cmd/geth/consolecmd_test.go b/cmd/geth/consolecmd_test.go index 34ba87702..436045119 100644 --- a/cmd/geth/consolecmd_test.go +++ b/cmd/geth/consolecmd_test.go @@ -50,7 +50,7 @@ func TestConsoleWelcome(t *testing.T) { geth.SetTemplateFunc("goos", func() string { return runtime.GOOS }) geth.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) geth.SetTemplateFunc("gover", runtime.Version) - geth.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) + geth.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) geth.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) }) geth.SetTemplateFunc("apis", func() string { return ipcAPIs }) @@ -133,7 +133,7 @@ func testAttachWelcome(t *testing.T, geth *testgeth, endpoint, apis string) { attach.SetTemplateFunc("goos", func() string { return runtime.GOOS }) attach.SetTemplateFunc("goarch", func() string { return runtime.GOARCH }) attach.SetTemplateFunc("gover", runtime.Version) - attach.SetTemplateFunc("gethver", func() string { return params.VersionWithMeta }) + attach.SetTemplateFunc("gethver", func() string { return params.VersionWithCommit("", "") }) attach.SetTemplateFunc("etherbase", func() string { return geth.Etherbase }) attach.SetTemplateFunc("niltime", func() string { return time.Unix(0, 0).Format(time.RFC1123) }) attach.SetTemplateFunc("ipc", func() bool { return strings.HasPrefix(endpoint, "ipc") }) diff --git a/cmd/geth/main.go b/cmd/geth/main.go index 0e89481fe..838029333 100644 --- a/cmd/geth/main.go +++ b/cmd/geth/main.go @@ -50,8 +50,9 @@ const ( var ( // Git SHA1 commit hash of the release (set via linker flags) gitCommit = "" + gitDate = "" // The app that holds all commands and flags. - app = utils.NewApp(gitCommit, "the go-ethereum command line interface") + app = utils.NewApp(gitCommit, gitDate, "the go-ethereum command line interface") // flags that configure the node nodeFlags = []cli.Flag{ utils.IdentityFlag, diff --git a/cmd/geth/misccmd.go b/cmd/geth/misccmd.go index f62e25478..39ca47872 100644 --- a/cmd/geth/misccmd.go +++ b/cmd/geth/misccmd.go @@ -112,6 +112,9 @@ func version(ctx *cli.Context) error { if gitCommit != "" { fmt.Println("Git Commit:", gitCommit) } + if gitDate != "" { + fmt.Println("Git Commit Date:", gitDate) + } fmt.Println("Architecture:", runtime.GOARCH) fmt.Println("Protocol Versions:", eth.ProtocolVersions) fmt.Println("Network Id:", eth.DefaultConfig.NetworkId) |