-
Notifications
You must be signed in to change notification settings - Fork 0
/
haikuchanges.sh
executable file
·51 lines (40 loc) · 1.23 KB
/
haikuchanges.sh
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
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/bin/bash
if [ -z "$tag" ]; then
echo "tag variable not defined when called directly, using hardcoded test tag"
tag="hrev57573"
echo
echo
fi
if [ -n "$HAIKU_SRC" ]; then
echo
# must cd anyways to show commits even if we don't update
cd $HAIKU_SRC
echo "You have Haiku Sources installed"
echo "in $HAIKU_SRC"
read -p "check for remote changes (y/n) " response
echo
if [[ $response =~ ^[Yy]$ ]]; then
echo "Fetching state for \$HAIKU_SRC"
git fetch
if [ $(git rev-parse HEAD) != $(git rev-parse @{u}) ]; then
echo "!! HAIKU-SRC - your branch is behind the remote repository."
read -p "Pull latest changes? (y/n) " response
echo
if [[ $response =~ ^[Yy]$ ]]; then
git pull
else
echo "Okay, doing nothing. You may not see recent commit messages if $tag is recent."
fi
else
echo "OK - Haiku source is up to date with remote"
fi
else
echo "Okay, doing nothing. You may not see recent commit messages if $tag is recent."
fi
echo "Commit messages for tag $tag :"
echo
git log --oneline --decorate | grep $tag | sed 's/([^)]*)//' | cut -d' ' -f2-
echo
else
echo "(you need to define $HAIKU_SRC to see commit messages for this tag)"
fi