diff options
author | Thierry Reding <treding@nvidia.com> | 2014-11-21 11:58:01 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2014-11-21 11:58:01 +0100 |
commit | 843c239d683f8c51c51fadd11f3f316c1e6f5598 (patch) | |
tree | 0b6f2f4a80e3cef068fa64c635e3c2540f58ea2f | |
parent | d9e8b451d95b3abaad44925696d1dfeb1f8f5cc8 (diff) | |
download | maint-scripts-843c239d683f8c51c51fadd11f3f316c1e6f5598.tar.gz |
Add option to pretend pushing
This is useful to test what will be pushed without actually pushing to
the remote.
Signed-off-by: Thierry Reding <treding@nvidia.com>
-rwxr-xr-x | push-linux-tegra.sh | 26 |
1 files changed, 25 insertions, 1 deletions
diff --git a/push-linux-tegra.sh b/push-linux-tegra.sh index 0c41635..2401e18 100755 --- a/push-linux-tegra.sh +++ b/push-linux-tegra.sh @@ -6,10 +6,34 @@ set -x . "${0%/*}/tegra-branches.sh.dot" . "${0%/*}/lib.sh" +opt_dry_run=no + +while test $# -gt 0; do + case $1 in + -n | --dry-run) + opt_dry_run=yes + shift + ;; + + *) + echo "usage: $0 [options]" + echo "" + echo "options:" + echo " -n, --dry-run pretend to push" + exit 1 + ;; + esac +done + remote=$(get_remote) +args="--force" + +if test "x$opt_dry_run" = "xyes"; then + args="$args --dry-run" +fi for b in ${branches} for-next; do refspecs="${refspecs} ${b}:${b}" done -git push --force ${remote} ${refspecs} +git push $args ${remote} ${refspecs} |