Skip to content

Commit d4ce630

Browse files
committed
8366399: Allow custom base reference for update_copyright_year.sh
Reviewed-by: erikj
1 parent 849570a commit d4ce630

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

make/scripts/update_copyright_year.sh

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -62,17 +62,22 @@ Help()
6262
echo "options:"
6363
echo "-c Specifies the company. Set to Oracle by default."
6464
echo "-y Specifies the copyright year. Set to current year by default."
65+
echo "-b Specifies the base reference for change set lookup."
6566
echo "-f Updates the copyright for all change sets in a given year,"
66-
echo " as specified by -y."
67+
echo " as specified by -y. Overrides -b flag."
6768
echo "-h Print this help."
6869
echo
6970
}
7071

7172
full_year=false
73+
base_reference=master
7274

7375
# Process options
74-
while getopts "c:fhy:" option; do
76+
while getopts "b:c:fhy:" option; do
7577
case $option in
78+
b) # supplied base reference
79+
base_reference=${OPTARG}
80+
;;
7681
c) # supplied company year
7782
company=${OPTARG}
7883
;;
@@ -111,7 +116,7 @@ else
111116
if [ "$full_year" = "true" ]; then
112117
vcs_list_changesets=(git log --no-merges --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
113118
else
114-
vcs_list_changesets=(git log --no-merges 'master..HEAD' --since="${year}-01-01T00:00:00Z" --until="${year}-12-31T23:59:59Z" --pretty=tformat:"%H")
119+
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")
115120
fi
116121
vcs_changeset_message=(git log -1 --pretty=tformat:"%B") # followed by ${changeset}
117122
vcs_changeset_files=(git diff-tree --no-commit-id --name-only -r) # followed by ${changeset}

0 commit comments

Comments
 (0)