From def62770e5f7cc21e13d231ff38c6545b12a3404 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Mon, 23 Aug 2021 14:13:07 -0400 Subject: [PATCH 1/2] Implement [skip-revcheck] to exclude a commit from consideration --- scripts/rev.php | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/scripts/rev.php b/scripts/rev.php index bd4963d..21b736c 100644 --- a/scripts/rev.php +++ b/scripts/rev.php @@ -432,6 +432,7 @@ function captureGitValues( & $output ) $hash = null; $date = null; $utct = new DateTimeZone( "UTC" ); + $skipThisCommit = false; while ( ( $line = fgets( $fp ) ) !== false ) { if ( substr( $line , 0 , 7 ) == "commit " ) @@ -447,12 +448,20 @@ function captureGitValues( & $output ) if ( trim( $line ) == "" ) continue; if ( substr( $line , 0 , 4 ) == ' ' ) + { + if ( stristr( $line, '[skip-revcheck]' ) !== false ) + { + $skipThisCommit = true; + } continue; + } if ( strpos( $line , ': ' ) > 0 ) continue; $filename = trim( $line ); if ( isset( $output[$filename] ) ) continue; + if ( $skipThisCommit ) + continue; $output[$filename]['hash'] = $hash; } pclose( $fp ); From 1f49aff89f4f12fe4c0f995aecf9e20e32eba523 Mon Sep 17 00:00:00 2001 From: William Entriken Date: Mon, 23 Aug 2021 17:42:45 -0400 Subject: [PATCH 2/2] Only skip one commit per [skip-revcheck] --- scripts/rev.php | 1 + 1 file changed, 1 insertion(+) diff --git a/scripts/rev.php b/scripts/rev.php index 21b736c..31d5eba 100644 --- a/scripts/rev.php +++ b/scripts/rev.php @@ -438,6 +438,7 @@ function captureGitValues( & $output ) if ( substr( $line , 0 , 7 ) == "commit " ) { $hash = trim( substr( $line , 7 ) ); + $skipThisCommit = false; continue; } if ( strpos( $line , 'Date:' ) === 0 )