| 1 |
#! /bin/env bash |
| 2 |
|
| 3 |
|
| 4 |
previous_branch="" |
| 5 |
show_log=false |
| 6 |
|
| 7 |
while getopts "hlb:" OPTION |
| 8 |
do |
| 9 |
case $OPTION in |
| 10 |
b) |
| 11 |
previous_branch_version=`echo $OPTARG |sed "s/\./-/g"` |
| 12 |
previous_branch="root-of-trilinos-release-$previous_branch_version-branch" |
| 13 |
;; |
| 14 |
l) |
| 15 |
show_log=true |
| 16 |
;; |
| 17 |
h | ?) |
| 18 |
echo "Usage:" |
| 19 |
echo " $0 -b <branch version> [options]" |
| 20 |
echo |
| 21 |
echo " -h: show help" |
| 22 |
echo " -l: show most recent log of files updated" |
| 23 |
echo " -b: Branch to start looking for changes since." |
| 24 |
exit 0 |
| 25 |
esac |
| 26 |
done |
| 27 |
|
| 28 |
if [[ $previous_branch == "" ]]; then |
| 29 |
echo "Must specify a branch to start from" |
| 30 |
exit 1 |
| 31 |
fi |
| 32 |
|
| 33 |
release_notes_files=`find . -iname "*release*note*" -printf "%P\n"` |
| 34 |
|
| 35 |
last_branch_sha1=`git log -1 --format=%h $previous_branch` |
| 36 |
last_branch_timestamp=`git log -1 --format=%ct $last_branch_sha1` |
| 37 |
|
| 38 |
for file in $release_notes_files |
| 39 |
do |
| 40 |
last_changed_timestamp=`git log -1 --format=%ct $file` |
| 41 |
|
| 42 |
if [[ $last_changed_timestamp > $last_branch_timestamp ]]; then |
| 43 |
if [[ $show_log == true ]]; then |
| 44 |
commit_log="("`git log -1 --format="%h %s %cd" $file`")" |
| 45 |
fi |
| 46 |
echo $file $commit_log |
| 47 |
fi |
| 48 |
|
| 49 |
done |
| 50 |
|