Skip to content

Commit 329b939

Browse files
authored
Merge pull request #1034 from ViktorTigerstrom/2025-04-include-commit-hash
Add `commit_hash` field to `GetInfo` response
2 parents 131eda1 + 59ecb77 commit 329b939

File tree

13 files changed

+146
-36
lines changed

13 files changed

+146
-36
lines changed

Makefile

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@ GOIMPORTS_BIN := $(GO_BIN)/gosimports
1616

1717
COMMIT := $(shell git describe --abbrev=40 --dirty --tags)
1818
COMMIT_HASH := $(shell git rev-parse HEAD)
19+
DIRTY := $(shell git diff-index --quiet HEAD -- || echo -dirty)
1920
PUBLIC_URL :=
2021

2122
# GO_VERSION is the Go version used for the release build, docker files, and
@@ -69,6 +70,8 @@ make_ldflags = $(2) -X $(LND_PKG)/build.Commit=lightning-terminal-$(COMMIT) \
6970
-X $(LND_PKG)/build.RawTags=$(shell echo $(1) | sed -e 's/ /,/g') \
7071
-X $(PKG).appFilesPrefix=$(PUBLIC_URL) \
7172
-X $(PKG).Commit=$(COMMIT) \
73+
-X $(PKG).CommitHash=$(COMMIT_HASH) \
74+
-X $(PKG).Dirty=$(DIRTY) \
7275
-X $(LOOP_PKG).Commit=$(LOOP_COMMIT) \
7376
-X $(POOL_PKG).Commit=$(POOL_COMMIT) \
7477
-X $(TAP_PKG).Commit=$(TAP_COMMIT)

app/src/types/generated/proxy_pb.d.ts

Lines changed: 4 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

app/src/types/generated/proxy_pb.js

Lines changed: 31 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

cmd/litcli/main.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,7 @@ var (
7373
func main() {
7474
app := cli.NewApp()
7575

76-
app.Version = terminal.Version()
76+
app.Version = terminal.RichVersion()
7777
app.Name = "litcli"
7878
app.Usage = "control plane for your Lightning Terminal (lit) daemon"
7979
app.Flags = []cli.Flag{

config.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -367,7 +367,7 @@ func loadAndValidateConfig(interceptor signal.Interceptor) (*Config, error) {
367367
appName := filepath.Base(os.Args[0])
368368
appName = strings.TrimSuffix(appName, filepath.Ext(appName))
369369
if preCfg.ShowVersion {
370-
fmt.Println(appName, "version", Version())
370+
fmt.Println(appName, "version", RichVersion())
371371
os.Exit(0)
372372
}
373373
if preCfg.Lnd.ShowVersion {

docs/release-notes/release-notes-0.14.2.md

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,21 @@
5555
`supermacaroon:write` permission to disable access to the
5656
`bakesupermacaroon` endpoint.
5757

58+
* [A `commit_hash` field has been added to the `GetInfo`
59+
response](https://github.com/lightninglabs/lightning-terminal/pull/1034).
60+
The `commit_hash` field will contain the full commit hash of the commit that
61+
LiT release binary build was based on. If the build had uncommitted changes,
62+
the `commit_hash` field will contain the most recent commit hash, suffixed by
63+
"-dirty".
64+
The contents of the `version` field in the `GetInfo` response has also been
65+
updated to only include the semantic version number of the LiT release,
66+
following the semantic versioning 2.0.0 spec (http://semver.org/).
67+
68+
* [A `commit_hash` field has been added to the `--version`
69+
output](https://github.com/lightninglabs/lightning-terminal/pull/1034).
70+
The `commit_hash` field will contain the full commit hash of the commit that
71+
LiT release binary build was based on.
72+
5873
## Integrated Binary Updates
5974

6075
### LND

litrpc/proxy.pb.go

Lines changed: 37 additions & 22 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

litrpc/proxy.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ message GetInfoRequest {
5252
}
5353

5454
message GetInfoResponse {
55-
// The version of the LiTd software that the node is running.
55+
// The application version of the LiTd software running on the node,
56+
// following the Semantic Versioning 2.0.0 specification
57+
// (http://semver.org/).
5658
string version = 1;
59+
60+
// The Git commit hash the LiTd binary build was based on. If the build had
61+
// uncommited changes, this field will contain the most recent commit hash,
62+
// suffixed by "-dirty".
63+
string commit_hash = 2;
5764
}

litrpc/proxy.swagger.json

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -135,7 +135,11 @@
135135
"properties": {
136136
"version": {
137137
"type": "string",
138-
"description": "The version of the LiTd software that the node is running."
138+
"description": "The application version of the LiTd software running on the node,\nfollowing the Semantic Versioning 2.0.0 specification\n(http://semver.org/)."
139+
},
140+
"commit_hash": {
141+
"type": "string",
142+
"description": "The Git commit hash the LiTd binary build was based on. If the build had\nuncommited changes, this field will contain the most recent commit hash,\nsuffixed by \"-dirty\"."
139143
}
140144
}
141145
},

proto/proxy.proto

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,13 @@ message GetInfoRequest {
5252
}
5353

5454
message GetInfoResponse {
55-
// The version of the LiTd software that the node is running.
55+
// The application version of the LiTd software running on the node,
56+
// following the Semantic Versioning 2.0.0 specification
57+
// (http://semver.org/).
5658
string version = 1;
59+
60+
// The Git commit hash the LiTd binary build was based on. If the build had
61+
// uncommited changes, this field will contain the most recent commit hash,
62+
// suffixed by "-dirty".
63+
string commit_hash = 2;
5764
}

0 commit comments

Comments
 (0)