#!/bin/sh repos='system/core system/extras external/libselinux external/f2fs-tools' [ $# -eq 2 ] || exit 1 from=android-$1 to=android-$2 for r in $repos; do if ! [ -d "$(basename $r)/.git" ]; then git clone https://android.googlesource.com/platform/$r else ( cd $(basename $r) git fetch ) fi done d() { git diff ${from}..${to} -- "$@" } ( cd core d adb fastboot libcutils libzipfile libsparse ) ( cd extras d ext4_utils f2fs_utils ) ( cd libselinux d src )