env: implement the repodiff command
sample usage:
repodiff ics
repodiff github/ics --numstat
repodiff android-4.0.4_r1.2 android-4.0.4_r2
Change-Id: Id1c1e504c75676707e59f051fd5ff9ce748d4297
Signed-off-by: Tanguy Pruvot <tanguy.pruvot@gmail.com>
diff --git a/envsetup.sh b/envsetup.sh
index 23d4bcf..c02dae7 100644
--- a/envsetup.sh
+++ b/envsetup.sh
@@ -1868,6 +1868,16 @@
;;
esac
}
+
+function repodiff() {
+ if [ -z "$*" ]; then
+ echo "Usage: repodiff <ref-from> [[ref-to] [--numstat]]"
+ return
+ fi
+ diffopts=$* repo forall -c \
+ 'echo "$REPO_PATH ($REPO_REMOTE)"; git diff ${diffopts} 2>/dev/null ;'
+}
+
# Force JAVA_HOME to point to java 1.7 or java 1.6 if it isn't already set.
#
# Note that the MacOS path for java 1.7 includes a minor revision number (sigh).