Merge "Add a minireflect based json parser."
diff --git a/aos/input/driver_station_data.cc b/aos/input/driver_station_data.cc
index fd17d77..8898ca1 100644
--- a/aos/input/driver_station_data.cc
+++ b/aos/input/driver_station_data.cc
@@ -19,7 +19,7 @@
location.joystick() > static_cast<int>(values.joysticks.size())) {
return false;
}
- if (location.number() < 0 || location.number() >= 16) {
+ if (location.number() <= 0 || location.number() > 16) {
return false;
}
return values.joysticks[location.joystick() - 1].buttons &
diff --git a/third_party/rewrite_subtree.sh b/third_party/rewrite_subtree.sh
new file mode 100755
index 0000000..a3e5372
--- /dev/null
+++ b/third_party/rewrite_subtree.sh
@@ -0,0 +1,23 @@
+#!/bin/bash
+#
+# Coppied from:
+# https://stackoverflow.com/questions/40297499/pushing-squashed-subtree-change-to-gerrit
+#
+# This command re-writes the history after doing a git subtree {pull|add}
+# to add Gerrit Change-Id lines to the squash commit message.
+#
+# It assumes that HEAD is the merge commit merging the subtree into HEAD.
+# The original HEAD commit will be backed up under refs/original, which
+# is helpful if something goes wrong.
+
+set -e
+set -o pipefail
+
+GIT_DIR=$(readlink -f "$(git rev-parse --git-dir)")
+TMP_MSG="${GIT_DIR}/COMMIT_MSG_REWRITE"
+
+git filter-branch --msg-filter \
+ "cat > ${TMP_MSG} && \"${GIT_DIR}/hooks/commit-msg\" ${TMP_MSG} && \
+ cat \"${TMP_MSG}\"" HEAD...HEAD~1
+
+rm -rf "${TMP_MSG}"