From 1fb5d604a6e177f95a252ffcd28aa6e8df97289e Mon Sep 17 00:00:00 2001 From: ralf Date: Thu, 5 Sep 2024 09:08:37 +0200 Subject: [PATCH] skip (rebased) commits older than the last tag --- doc/rpm-build/checkout-build-archives.php | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/doc/rpm-build/checkout-build-archives.php b/doc/rpm-build/checkout-build-archives.php index 5d17036983..b1dbc1c801 100755 --- a/doc/rpm-build/checkout-build-archives.php +++ b/doc/rpm-build/checkout-build-archives.php @@ -223,9 +223,16 @@ function get_changelog_from_git($_path, $log_pattern=null, &$last_tag=null, $pre $output = null; run_cmd($cmd, $output); + $date_last_tag = new DateTime(preg_replace('/^\d+\.\d+\./', '', $last_tag)); foreach($output as $line) { - if (substr($line, 0, 4) == " " && ($msg = _match_log_pattern(substr($line, 4), $log_pattern, $prefix))) + if (substr($line, 0, 8) === "Date: ") + { + $date_commit = new DateTime(substr($line, 8)); + } + if (substr($line, 0, 4) == " " && + $date_commit > $date_last_tag && // skip (rebased) commits older than the last tag + ($msg = _match_log_pattern(substr($line, 4), $log_pattern, $prefix))) { $changelog .= $msg."\n"; } @@ -1467,4 +1474,4 @@ function usage($error=null) exit(90); } exit(0); -} +} \ No newline at end of file