Initial revision
[parsecvs/imz-RCS2git-use-cases.git] / parsecvs-as-sidehist
blob9e737e69ba8008838896f9baa3277900edde6be6
1 #!/bin/bash
3 set -e
5 usage() {
6 printf $"Usage: %s REMOTENAME ... , where ... stands for parsecvs args.\n" "$0"
9 if [[ $# < 1 ]]; then
10 usage
11 exit 1
14 readonly REMOTE="$1"
15 shift
17 readonly WORK_DIR="$(mktemp -d --tmpdir parsecvs-"$REMOTE".XXXXXX)"
18 # I'll remove the temp dir only if the script completes successfully;
19 # otherwise, let it stay for investigation.
20 failed() {
21 printf $"%s failed; investigate in %s.\n" "$0" "$WORK_DIR"
23 trap failed ERR
25 GIT_DIR="$WORKDIR"/.git parsecvs "$@"
27 git fetch "$WORKDIR" *:"$REMOTE"/*
29 rm -rf "$WORKDIR"