File tree 1 file changed +13
-3
lines changed
1 file changed +13
-3
lines changed Original file line number Diff line number Diff line change 1
1
#! /usr/bin/env bash
2
2
3
- since=" $1 "
4
- until=" $( date -d " $since +7 days" +%Y-%m-%d) "
3
+ if [ $# -eq 0 ]; then
4
+ >&2 echo " gen-merge-summary.sh [SINCE] [UNTIL]"
5
+ >&2 echo " Generate a merge summary between the SINCE and UNTIL date"
6
+ >&2 echo " "
7
+ >&2 echo " Examples:"
8
+ >&2 echo " gen-merge-summary.sh 2023-01-01 2023-01-08"
9
+ >&2 echo " gen-merge-summary.sh 2023-01-01 '2023-01-01 +7 days'"
10
+ exit 1
11
+ fi
12
+
13
+ since=" $( date -d " $1 " +%Y-%m-%d) "
14
+ until=" $( date -d " $2 " +%Y-%m-%d) "
5
15
6
16
echo " # Merge summary for $since to $until "
7
17
@@ -13,6 +23,6 @@ git log --merges --since $since --until $until --format=fuller \
13
23
| (.subject = (.message | split("\n"))[0])
14
24
| (.body = (.message | split("\n") | del(.[0]) | del(.[0]) | join("\n")))
15
25
| select(.subject | startswith("Merge pull request #"))
16
- | (.subject |= sub("^.*#"; "" ))
26
+ | (.subject |= sub("^.*#(?<a>[0-9]+) .*$ "; .a ))
17
27
| ("- [" + (.body | gsub("\n.*"; "")) + "](https://github.com/input-output-hk/cardano-node/pull/" + .subject + ") (" + .author + ")")
18
28
'
You can’t perform that action at this time.
0 commit comments