| 1 | #!/bin/bashscip-shell filesystem . . `/bin/bash`. |
| 2 | |
| 3 | if [scip-shell system . . `[`. $# -lt 2 ] |
| 4 | then |
| 5 | echoscip-shell system . . echo. "USAGE: $0 <git-ref-1> <git-ref-2>" |
| 6 | echoscip-shell system . . echo. "Ex: $0 v0.14.0-a2 v0.14.0-a3" |
| 7 | echoscip-shell system . . echo. "Ex: $0 f9af2a72 master" |
| 8 | exit 1 |
| 9 | fi |
| 10 | |
| 11 | # 1. Get git log between the requested commits |
| 12 | # 2. Get lines +2 after date and bug. This pulls in the commit heading which shows 2nd line after date and all Bug: lines |
| 13 | # 3. Get rid of anything not relevant from output of 2, including the group separator (--). |
| 14 | # 4. Initial sed processing to strip whitespace, add "* " on all lines except "Bug: " lines, convert "Bug: " lines to [[phab: ..]] links |
| 15 | # - In the edge case that a commit heading starts with a %, the "* " will not be appended. |
| 16 | # 5. Further sed processing to collapse phab links onto previous lines |
| 17 | gitscip-shell system . . git. log "$1".."$2" | grepscip-shell system . . grep. -E -A+2 "^\s*(Date|Bug):\s*" | grepscip-shell system . . grep. -E -v "Change-Id:|Depends-On:|Date:|Co-Authored-by:|Needed-By:|Follow-Up:|Follows-Up:|Followup-To:|^--$|^\n*$" | sedscip-shell system . . sed. 's/^[ \t]*//g;s/^Bug:/%%%:/g;s/^[^%]/* &/g;s/%%%:\s*\(.*\)/[[phab:\1|\1]]/g;' | sedscip-shell system . . sed. -e ':a' -e 'N;$!ba' -e 's/\n*\[\[phab/, [[phab/g;' |