1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#!/bin/bash git_dir='/usr/src/github/openttd' branches=( signaltunnel sloped-stations underground ) cd "$(dirname "$(readlink -f "$0")")" for branch in "${branches[@]}"; do git -C "${git_dir}" diff \ "$( git -C "${git_dir}" merge-base "${branch}" upstream/master )" \ "${branch}" > \ "${branch}.patch" done