aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThierry Reding <treding@nvidia.com>2014-07-11 14:33:22 +0200
committerThierry Reding <treding@nvidia.com>2014-11-07 17:13:15 +0100
commitb3801fe58bf1d2de018d435dd1c7dea554917e3c (patch)
treed8f9a6f1401df5eb86583efc8b9f77922111e113
parentfaadf4ca7bce1f02dbf1f1ff8ce2a6d4820c1363 (diff)
downloadmaint-scripts-b3801fe58bf1d2de018d435dd1c7dea554917e3c.tar.gz
Add pull-linux-tegra.sh script
This script is useful to reproduce the remote branch hierarchy described in the tegra-branches.sh.dot file in the working copy. Signed-off-by: Thierry Reding <treding@nvidia.com>
-rwxr-xr-xpull-linux-tegra.sh20
1 files changed, 20 insertions, 0 deletions
diff --git a/pull-linux-tegra.sh b/pull-linux-tegra.sh
new file mode 100755
index 0000000..fc35520
--- /dev/null
+++ b/pull-linux-tegra.sh
@@ -0,0 +1,20 @@
+#!/bin/bash
+
+set -e
+set -x
+
+. "${0%/*}/tegra-branches.sh.dot"
+. "${0%/*}/lib.sh"
+
+remote=$(get_remote)
+
+git fetch $remote
+
+for b in ${branches} for-next; do
+ if ! git rev-parse ${b} > /dev/null 2>&1; then
+ git branch ${b} ${remote}/${b}
+ else
+ git checkout ${b}
+ git reset --hard ${remote}/${b}
+ fi
+done