mirror of
https://github.com/hyprwm/Hyprland.git
synced 2026-02-04 12:25:40 +00:00
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
This commit is contained in:
@ -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 --
|
||||
|
||||
@ -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()
|
||||
|
||||
Reference in New Issue
Block a user