From b5f0711c6c33818c149c8d24e2ffb21f560666f5 Mon Sep 17 00:00:00 2001 From: crueter Date: Thu, 21 Aug 2025 16:54:21 -0400 Subject: [PATCH] use better license-header impl that is not as cursed Signed-off-by: crueter --- .ci/license-header.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/.ci/license-header.sh b/.ci/license-header.sh index 6cd62a3bbc..98e88b5824 100755 --- a/.ci/license-header.sh +++ b/.ci/license-header.sh @@ -31,15 +31,13 @@ HEADER_HASH="$(cat "$PWD/.ci/license/header-hash.txt")" echo echo "license-header.sh: Getting branch changes" -BRANCH=$(git rev-parse --abbrev-ref HEAD) -COMMITS=$(git log "${BRANCH}" --not master --pretty=format:"%h") -if [ -z "$COMMITS" ]; then +BASE=$(git merge-base master HEAD) +if git diff --quiet "$BASE"..HEAD; then echo echo "license-header.sh: No commits on this branch different from master." exit 0 fi -RANGE="$(echo "$COMMITS" | tail -n1)^..$(echo "$COMMITS" | head -n1)" -FILES=$(git diff-tree --no-commit-id --name-only "${RANGE}" -r) +FILES=$(git diff --name-only "$BASE") check_header() { CONTENT=$(head -n3 < "$1")