From d03bc0ca4833c318820b4692b4f1fca6441533e5 Mon Sep 17 00:00:00 2001 From: Thibault DUPONCHELLE Date: Fri, 7 Feb 2025 23:08:10 +0100 Subject: [PATCH] Add describe (patchlevel) to .git_patch and read it from make_patchnum.pl --- .git_patch | 2 +- make_patchnum.pl | 4 +--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/.git_patch b/.git_patch index c044fd5b05..27f39b41da 100644 --- a/.git_patch +++ b/.git_patch @@ -1 +1 @@ -$Format:%H|%ci|%D$ +$Format:%H|%ci|%(describe)|%D$ diff --git a/make_patchnum.pl b/make_patchnum.pl index eceb45468c..17b792a5a4 100644 --- a/make_patchnum.pl +++ b/make_patchnum.pl @@ -135,7 +135,7 @@ if (my $patch_file= read_file(".patch")) { } elsif ($git_patch_file = read_file(".git_patch") and $git_patch_file !~ /\A\$Format:%H/) { chomp $git_patch_file; - ($commit_id, my $commit_date, my $names) + ($commit_id, my $commit_date, $describe, my $names) = split /\|/, $git_patch_file; my @names = split /,\s*/, $names; @@ -146,7 +146,6 @@ elsif ($git_patch_file = read_file(".git_patch") and $git_patch_file !~ /\A\$For } if (!$branch) { ($branch) = map m{^tag: (.*)}, @names; - $describe = $branch; } if (!$branch) { my ($pr) = map m{^refs/pull/([0-9]+)/}, @names; @@ -156,7 +155,6 @@ elsif ($git_patch_file = read_file(".git_patch") and $git_patch_file !~ /\A\$For $branch = $names[0] || $commit_id; } - $describe ||= $commit_id; $extra_info = "git_commit_date='$commit_date'\n"; $extra_info .= "git_snapshot_date='$commit_date'\n"; $commit_title = "Snapshot of:";