From 75a17780e34b2f1b01a06adc837eaf64a2a40818 Mon Sep 17 00:00:00 2001 From: Benson Muite Date: Dec 30 2025 15:39:01 +0000 Subject: Generate shortcommit safely Follow suggestion from Pavel Raiskups' Flock 2025 talk https://cfp.fedoraproject.org/flock-to-fedora-2025/talk/CLDGTL/ --- diff --git a/guidelines/modules/ROOT/pages/SourceURL.adoc b/guidelines/modules/ROOT/pages/SourceURL.adoc index 51bb955..8e86360 100644 --- a/guidelines/modules/ROOT/pages/SourceURL.adoc +++ b/guidelines/modules/ROOT/pages/SourceURL.adoc @@ -189,10 +189,10 @@ Once the commit hash and git tag are known, you can define them in your spec fil .... %global commit 40-CHARACTER-HASH-VALUE %global gittag GIT-TAG -%global shortcommit %(c=%{commit}; echo ${c:0:7}) [GitHub] -%global shortcommit %(c=%{commit}; echo ${c:0:11}) [Bitbucket] -%global shortcommit %(c=%{commit}; echo ${c:0:7}) [GitLab] -%global shortcommit %(c=%{commit}; echo ${c:0:8}) [Sourcehut] +%global shortcommit %{sub %commit 0 7} [GitHub] +%global shortcommit %{sub %commit 0 11} [Bitbucket] +%global shortcommit %{sub %commit 0 7} [GitLab] +%global shortcommit %{sub %commit 0 8} [Sourcehut] .... === Commit Revision