5 # Adds the result of parsecvs as a side history (with the specified prefix) to the local existing Git repository.
6 # I intend to use it for translating RCS histories for individual files into Git as independent histories (parseRCS-indep).
7 # I will manually merge the results of parseRCS-indep to form a good Git history of the tree
8 # (manual merging can give better results than parsecvs in cases when CVS hasn't been used, but there are merely RCS histories).
10 # Author: Ivan Zakharyaschev imz at altlinux dot org, March 2009.
11 # I publish it under GPL (as parsecvs is published).
16 printf $
"Usage: %s REMOTENAME ... , where ... stands for parsecvs args.\n" "$0"
27 readonly WORK_DIR
="$(mktemp -d --tmpdir parsecvs-"$
(basename "$REMOTE")".XXXXXX)"
28 # -- basename is needed to make / possible in the branchnames.
29 # I'll remove the temp dir only if the script completes successfully;
30 # otherwise, let it stay for investigation.
32 printf $
"%s failed; investigate in %s.\n" "$0" "$WORK_DIR"
36 GIT_DIR
="$WORK_DIR"/.git parsecvs
"$@"
38 git fetch
"$WORK_DIR" refs
/heads
/*:"$REMOTE"/*
39 # Sensible are: refs/PREFIX/... (then it can be seen in gitk),
40 # refs/remotes/PREFIX/... (then "git branch -a" shows it);
41 # one of these variants will be used in the wrapper that makes a forest.
44 rm -rf "$WORK_DIR" && printf $
"%s removed.\n" "$WORK_DIR"