From d67acee00211ca563b4a4ac2a607304e7f40cf37 Mon Sep 17 00:00:00 2001 From: Chris Date: Thu, 8 Dec 2022 13:57:16 +1100 Subject: [PATCH] Simplfying the Git commands in the project file * Allowing commands to get the `GIT_COMMIT_ID`, `GIT_COMMIT_DATE` and `GIT_BRANCH` to work with spaces in path --- OpenRGB.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/OpenRGB.pro b/OpenRGB.pro index 8321c69a..aabbd161 100644 --- a/OpenRGB.pro +++ b/OpenRGB.pro @@ -43,9 +43,9 @@ TEMPLATE = app #-----------------------------------------------------------------------------------------------# win32:BUILDDATE = $$system(date /t) unix:BUILDDATE = $$system(date -R -d "@${SOURCE_DATE_EPOCH:-$(date +%s)}") -GIT_COMMIT_ID = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse HEAD) -GIT_COMMIT_DATE = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ show -s --format=%ci HEAD) -GIT_BRANCH = $$system(git --git-dir $$_PRO_FILE_PWD_/.git --work-tree $$_PRO_FILE_PWD_ rev-parse --abbrev-ref HEAD) +GIT_COMMIT_ID = $$system(git log -n 1 --pretty=format:"%H") +GIT_COMMIT_DATE = $$system(git log -n 1 --pretty=format:"%ci") +GIT_BRANCH = $$system(git branch --show-current) DEFINES += \ VERSION_STRING=\\"\"\"$$VERSION\\"\"\" \