-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathdemo.sh
More file actions
executable file
·37 lines (31 loc) · 765 Bytes
/
demo.sh
File metadata and controls
executable file
·37 lines (31 loc) · 765 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
BASEDIR=$(dirname $0)
TAGS=(DEMO_START_POINT DOMAIN_MODEL USECASES PERSISTENCE WEBAPP RESTRUCTURE MICROSERVICE BUNDLES OSGI_SERVICE OSGI_REST PORTLET DOSGI)
TAGS_COUNT=${#TAGS[@]}
FILE=/tmp/.demo.status
CURRENT=$(cat $FILE || echo '1')
case $1 in
'start')
CURRENT=0;
;;
'back')
if [[ $CURRENT > 0 ]]; then
CURRENT=$(($CURRENT-1));
fi
;;
*)
if [[ $CURRENT -ge $TAGS_COUNT ]]; then
echo "That's all folks!"
exit
fi
NEXT=$(($CURRENT+1))
clear
echo "Commits between ${TAGS[$CURRENT]} and ${TAGS[$NEXT]} tags:"
git log --pretty=oneline ${TAGS[$CURRENT]}...${TAGS[$NEXT]}
read -s
git difftool -d ${TAGS[$CURRENT]}...${TAGS[$NEXT]}
CURRENT=$NEXT;
;;
esac
git checkout ${TAGS[$CURRENT]}
git clean -d -f
echo $CURRENT > $FILE