From 596552c9ebc7e3844f10ac5bd50a87c708cd96b9 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Dec 2024 15:07:04 -0500 Subject: [PATCH 1/4] Makefile: use `git commit -S` for siging the commit Signed-off-by: Simon Deziel --- Makefile | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index a28ffbdd4023..9bf4d93283c5 100644 --- a/Makefile +++ b/Makefile @@ -233,7 +233,8 @@ update-po: if [ -t 0 ] && ! git diff --quiet -- po/*.po; then \ read -rp "Would you like to commit i18n changes (Y/n)? " answer; \ if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \ - git commit -sm "i18n: Update translations." -- po/*.po; fi; \ + git commit -S -sm "i18n: Update translations." -- po/*.po; \ + fi; \ fi .PHONY: update-pot @@ -246,7 +247,8 @@ endif if [ -t 0 ] && ! git diff --quiet --ignore-matching-lines='^\s*"POT-Creation-Date: .*\n"' -- po/*.pot; then \ read -rp "Would you like to commit i18n template changes (Y/n)? " answer; \ if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \ - git commit -sm "i18n: Update translation templates." -- po/*.pot; fi; \ + git commit -S -sm "i18n: Update translation templates." -- po/*.pot; \ + fi; \ fi .PHONY: build-mo From ec45fbe323253333a635a09cd9a0d44751776087 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Dec 2024 14:08:50 -0500 Subject: [PATCH 2/4] Makefile: propose commit'ing generated files after `make update-metadata` Signed-off-by: Simon Deziel --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 9bf4d93283c5..48c96c8cc46a 100644 --- a/Makefile +++ b/Makefile @@ -155,6 +155,12 @@ endif update-metadata: build @echo "Generating golang documentation metadata" $(GOPATH)/bin/lxd-metadata . --json ./lxd/metadata/configuration.json --txt ./doc/metadata.txt --substitution-db ./doc/substitutions.yaml + if [ -t 0 ] && ! git diff --quiet -- ./lxd/metadata/configuration.json ./doc/metadata.txt; then \ + read -rp "Would you like to commit metadata changes (Y/n)? " answer; \ + if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \ + git commit -S -sm "doc: Update metadata" -- ./lxd/metadata/configuration.json ./doc/metadata.txt;\ + fi;\ + fi .PHONY: doc doc: doc-clean doc-install doc-html doc-objects From 03e8dc626b15dadaf664bbc8147ee2748938a7fc Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Dec 2024 14:14:08 -0500 Subject: [PATCH 3/4] Makefile: propose commit'ing generated files after `make update-gomod` Signed-off-by: Simon Deziel --- Makefile | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/Makefile b/Makefile index 48c96c8cc46a..504281d6c4b5 100644 --- a/Makefile +++ b/Makefile @@ -129,6 +129,13 @@ endif go get toolchain@none @echo "Dependencies updated" + if [ -t 0 ] && ! git diff --quiet -- ./go.mod ./go.sum; then \ + read -rp "Would you like to commit gomod changes (Y/n)? " answer; \ + if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \ + git commit -S -sm "gomod: Update dependencies" -- ./go.mod ./go.sum;\ + fi;\ + fi + .PHONY: update-protobuf update-protobuf: From f48d1e7cec14be49b6e215048f0d2b45d29243d9 Mon Sep 17 00:00:00 2001 From: Simon Deziel Date: Mon, 9 Dec 2024 14:18:18 -0500 Subject: [PATCH 4/4] Makefile: propose commit'ing generated files after `make update-api` Signed-off-by: Simon Deziel --- Makefile | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Makefile b/Makefile index 504281d6c4b5..1c1dbda56b7e 100644 --- a/Makefile +++ b/Makefile @@ -157,6 +157,12 @@ endif @# Generate spec and exclude package from dependency which causes a 'classifier: unknown swagger annotation "extendee"' error. @# For more details see: https://github.com/go-swagger/go-swagger/issues/2917. swagger generate spec -o doc/rest-api.yaml -w ./lxd -m -x github.com/grpc-ecosystem/grpc-gateway/v2/protoc-gen-openapiv2/options + if [ -t 0 ] && ! git diff --quiet -- ./doc/rest-api.yaml; then \ + read -rp "Would you like to commit swagger YAML changes (Y/n)? " answer; \ + if [ "$${answer:-y}" = "y" ] || [ "$${answer:-y}" = "Y" ]; then \ + git commit -S -sm "doc/rest-api: Refresh swagger YAML" -- ./doc/rest-api.yaml;\ + fi;\ + fi .PHONY: update-metadata update-metadata: build