about summary refs log tree commit diff stats
path: root/subx
diff options
context:
space:
mode:
authorKartik Agaram <vc@akkartik.com>2018-07-15 22:29:01 -0700
committerKartik Agaram <vc@akkartik.com>2018-07-15 22:29:01 -0700
commite1fcc521be3d2ec9e379b3baa974cb805386496d (patch)
tree0a4bdc3f2eb32d1dbbcb404ced0537a93efbaf31 /subx
parent8f64fc0a603c728348c14401dafbe2e10709a201 (diff)
downloadmu-e1fcc521be3d2ec9e379b3baa974cb805386496d.tar.gz
4349
Diffstat (limited to 'subx')
-rwxr-xr-xsubx/ggdiff22
-rwxr-xr-xsubx/xdiff4
2 files changed, 26 insertions, 0 deletions
diff --git a/subx/ggdiff b/subx/ggdiff
new file mode 100755
index 00000000..e2263ec2
--- /dev/null
+++ b/subx/ggdiff
@@ -0,0 +1,22 @@
+#!/usr/bin/env zsh
+# git diff a specific example's generated binary after converting through xxd.
+
+if [ $# -eq 0 ]
+then
+  echo "ggdiff <target> [rev]"
+  exit 1
+fi
+
+target=$1
+rev=${2:-HEAD}
+
+tmp=`mktemp`
+
+if [[ $target == 'test'* ]]
+then
+  git show ${rev}:subx/teensy/$target > $tmp
+  xdiff $tmp teensy/$target
+else
+  git show ${rev}:subx/$target > $tmp
+  xdiff $tmp $target
+fi
diff --git a/subx/xdiff b/subx/xdiff
new file mode 100755
index 00000000..3e0c034d
--- /dev/null
+++ b/subx/xdiff
@@ -0,0 +1,4 @@
+#!/usr/bin/env zsh
+# Compare xxd output of two files.
+
+diff -u <(xxd $1) <(xxd $2)