summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLucas Ritzdorf <42657792+LRitzdorf@users.noreply.github.com>2025-11-15 11:23:19 -0800
committerGitHub <noreply@github.com>2025-11-15 19:23:19 +0000
commitb62ab4b5786d55f7f2d70a71410f83f8ce91af6a (patch)
tree097a9d949311619ad4b8164de195521a4da2d42f
parent43527d363472b52f17dd9f9f4f87ec25cbf8a399 (diff)
cmake,meson: fix inclusion of GPG info in Git commit info (#12302)
This manifested for me as a failure to build plugins with `hyprpm`, but the root cause was GPG data getting incorporated into `src/version.h`, like so: ```c #define GIT_COMMIT_MESSAGE "gpg: Signature made Sun 09 Nov 2025 03:31:36 PM PST gpg: using EDDSA key E26A4A2AB9676F54149F8EAA665806380871D640 gpg: Can't check signature: No public key version: bump to 0.52.1" ``` This affected both `GIT_COMMIT_MESSAGE` and `GIT_COMMIT_DATE`, since those are generated via `git show` (which can generate that extra GPG info if the user's personal Git config sets `log.showSignature`). See: https://github.com/hyprwm/Hyprland/discussions/12282
-rw-r--r--CMakeLists.txt4
-rw-r--r--meson.build4
2 files changed, 4 insertions, 4 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 29de4a32..91443da6 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -155,10 +155,10 @@ if(Git_FOUND)
execute_process(COMMAND ${GIT_EXECUTABLE} branch --show-current
WORKING_DIRECTORY ${GIT_TOPLEVEL}
OUTPUT_VARIABLE GIT_BRANCH OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${GIT_EXECUTABLE} show -s --format=%s
+ execute_process(COMMAND ${GIT_EXECUTABLE} show -s --format=%s --no-show-signature
WORKING_DIRECTORY ${GIT_TOPLEVEL}
OUTPUT_VARIABLE GIT_COMMIT_MESSAGE OUTPUT_STRIP_TRAILING_WHITESPACE)
- execute_process(COMMAND ${GIT_EXECUTABLE} show -s --format=%cd --date=local
+ execute_process(COMMAND ${GIT_EXECUTABLE} show -s --format=%cd --date=local --no-show-signature
WORKING_DIRECTORY ${GIT_TOPLEVEL}
OUTPUT_VARIABLE GIT_COMMIT_DATE OUTPUT_STRIP_TRAILING_WHITESPACE)
execute_process(COMMAND ${GIT_EXECUTABLE} diff-index --quiet HEAD --
diff --git a/meson.build b/meson.build
index c7819e80..e1e2df94 100644
--- a/meson.build
+++ b/meson.build
@@ -46,8 +46,8 @@ git = find_program('git', required: false)
if git.found()
git_hash = run_command(git, 'rev-parse', 'HEAD').stdout().strip()
git_branch = run_command(git, 'branch', '--show-current').stdout().strip()
- git_message = run_command(git, 'show', '-s', '--format=%s').stdout().strip()
- git_date = run_command(git, 'show', '-s', '--format=%cd', '--date=local').stdout().strip()
+ git_message = run_command(git, 'show', '-s', '--format=%s', '--no-show-signature').stdout().strip()
+ git_date = run_command(git, 'show', '-s', '--format=%cd', '--date=local', '--no-show-signature').stdout().strip()
git_dirty = run_command(git, 'diff-index', '--quiet', 'HEAD', '--', check: false).returncode() != 0 ? 'dirty' : 'clean'
git_tag = run_command(git, 'describe', '--tags').stdout().strip()
git_commits = run_command(git, 'rev-list', '--count', 'HEAD').stdout().strip()