From d4ce630cea267e746f7feb5124fe2ecd39d7e13a Mon Sep 17 00:00:00 2001 From: Chen Liang Date: Fri, 29 Aug 2025 20:44:09 +0000 Subject: [PATCH] 8366399: Allow custom base reference for update_copyright_year.sh Reviewed-by: erikj --- make/scripts/update_copyright_year.sh | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/make/scripts/update_copyright_year.sh b/make/scripts/update_copyright_year.sh index 578ab4cbc99..fa7989d234b 100644 --- a/make/scripts/update_copyright_year.sh +++ b/make/scripts/update_copyright_year.sh @@ -62,17 +62,22 @@ Help() echo "options:" echo "-c Specifies the company. Set to Oracle by default." echo "-y Specifies the copyright year. Set to current year by default." + echo "-b Specifies the base reference for change set lookup." echo "-f Updates the copyright for all change sets in a given year," - echo " as specified by -y." + echo " as specified by -y. Overrides -b flag." echo "-h Print this help." echo } full_year=false +base_reference=master # Process options -while getopts "c:fhy:" option; do +while getopts "b:c:fhy:" option; do case $option in + b) # supplied base reference + base_reference=${OPTARG} + ;; c) # supplied company year company=${OPTARG} ;; @@ -111,7 +116,7 @@ else if [ "$full_year" = "true" ]; then vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H") else - vcs_list_changesets=(git log --no-merges 'master..HEAD' --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H") + vcs_list_changesets=(git log --no-merges "${base_reference}..HEAD" --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H") fi vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset} vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}