-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathMakefile
25 lines (23 loc) · 847 Bytes
/
Makefile
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
SHELL:=/bin/bash
ifdef VERBOSE
Q :=
else
Q := @
endif
changelog.latest.md:
$(Q)( \
declare TAGS=(`git tag`); \
for ((i=$${#TAGS[@]};i>=0;i--)); do \
if [ $$i -eq 0 ]; then \
echo -e "$${TAGS[$$i]}" >> changelog.latest.md; \
git log $${TAGS[$$i]} --no-merges --format=" * %h %s" >> changelog.latest.md; \
elif [ $$i -eq $${#TAGS[@]} ] && [ $$(git log $${TAGS[$$i-1]}..HEAD --oneline | wc -l) -ne 0 ]; then \
echo -e "$${TAGS[$$i-1]}-$$(git log -n 1 --format='%h')" >> changelog.latest.md; \
git log $${TAGS[$$i-1]}..HEAD --no-merges --format=" * %h %s" >> changelog.latest.md; \
elif [ $$i -lt $${#TAGS[@]} ]; then \
echo -e "$${TAGS[$$i]}" >> changelog.latest.md; \
git log $${TAGS[$$i-1]}..$${TAGS[$$i]} --no-merges --format=" * %h %s" >> changelog.latest.md; \
break; \
fi; \
done \
)