File tree Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Expand file tree Collapse file tree 1 file changed +45
-0
lines changed Original file line number Diff line number Diff line change
1
+ #! /bin/bash
2
+
3
+ # Generate a list of markdown formatted changes since the supplied `previous-commit`.
4
+ # You'd run this script like this:
5
+ # ./scripts/get_changes_since_commit.sh --previous-commit 1d2e083acdd88d0829ad31e3a1725e3898565fda
6
+
7
+ while [ " $# " -gt 0 ]; do
8
+ case " $1 " in
9
+ --previous-commit)
10
+ previouscommit=($2 )
11
+ shift 2
12
+ ;;
13
+ * )
14
+ echo " Unknown option: $1 "
15
+ exit 1
16
+ ;;
17
+ esac
18
+ done
19
+
20
+ if [ -z " $previouscommit " ]; then
21
+ echo " Missing --previous-commit"
22
+ exit 1
23
+ fi
24
+
25
+ currentcommit=$( git rev-parse HEAD)
26
+
27
+ # Get the commit messages between the previous commit and now.
28
+ messages=$( git log --pretty=format:" %h %s" $previouscommit ..$currentcommit )
29
+
30
+ function geturl() {
31
+ echo " https://github.com/aptos-labs/aptos-indexer-processors/commit/$1 "
32
+ }
33
+
34
+ cat << EOF
35
+ Full changes since $previouscommit (newest first):
36
+ EOF
37
+
38
+ while IFS= read -r line; do
39
+ sha=$( echo " $line " | cut -d ' ' -f1)
40
+ message=$( echo " $line " | cut -d ' ' -f2-)
41
+ echo " - [$sha ]($( geturl $sha ) ): $message "
42
+ done <<< " $messages"
43
+
44
+ cat << EOF
45
+ EOF
You can’t perform that action at this time.
0 commit comments