Debian Codegraph @

extensions/VisualEditor/bin/listRecentCommits.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`. -eu
2
3 # This script generates a structured git log of commits to the VisualEditor-MediaWiki repository,
4 # and walks the submodule updates to the lib/ve submodule and the OOjs and OOjs UI pull-through
5 # build commits to detail all changes since a given branch point.
6
7 # Using `git branch -a | grep wmf | sort -V` to automatically pick the latest branch version would
8 # be nice here, but doesn't work because Mac OS X's version of sort is too old.
9
10 # cd to the VisualEditor directory
11 cd $(cd $(dirnamescip-shell system . . dirname. $0)/..; pwdscip-shell system . . pwd.)
12
13 # Ensure input is correct
14 if [scip-shell system . . `[`. -z "${1:-}" ]
15 then
16 echoscip-shell system . . echo. >&2 "Usage: listRecentCommits.sh <startBranch>"
17 exit 1
18 fi
19 STARTHASH=`gitscip-shell system . . git. rev-parse $1`
20 if [scip-shell system . . `[`. "$?" -ne "0" ]
21 then
22 echoscip-shell system . . echo. >&2 "Parameter is not a valid git branch"
23 exit 1
24 fi
25
26 echoscip-shell system . . echo. "Listing changes since '$1' (hash: $STARTHASH)"
27 echoscip-shell system . . echo. ""
28
29 LOCALCHANGES=`gitscip-shell system . . git. log $1.. --oneline --no-merges --reverse --color=never |
30 egrepscip-shell system . . egrep. --color=never -v '(translatewiki|BrowserTest)'`
31
32 # Iterate over lines matching "Update VE core submodule"
33 while read -r CHANGE
34 do
35 printfscip-shell system . . printf. "$CHANGE\n"
36
37 if [[ $CHANGE == *"Update VE core submodule"* ]]
38 then
39 CHANGEHASH=`cutscip-shell system . . cut. -f1 -d' ' <<< $CHANGE`
40
41 SUBCHANGES=`gitscip-shell system . . git. log --format=%B -n1 $CHANGEHASH -- |
42 sedscip-shell system . . sed. -n -e '/New changes/,/^$/pscip-shell filesystem . . `/New changes/,/^$/p`.' |
43 tailscip-shell system . . tail. -n +2 |
44 sedscip-shell system . . sed. -e '$ d' |
45 grepscip-shell system . . grep. --color=never -v 'translatewiki'`
46 while read -r SUBCHANGE
47 do
48 printfscip-shell system . . printf. "\t$SUBCHANGE\n"
49 done <<< "$SUBCHANGES"
50
51 # Extra new-line between sub-module pulls for clarity
52 printfscip-shell system . . printf. "\n"
53 fi
54 done <<< "$LOCALCHANGES"
55 exit