diff options
| author | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-24 09:06:51 -0700 |
|---|---|---|
| committer | Linus Torvalds <torvalds@ppc970.osdl.org> | 2005-05-24 09:06:51 -0700 |
| commit | e69a19f784b3ff19efc8ab765166e877fffb052e (patch) | |
| tree | 000079a2eaef17b7eae70e1f0f635557ea67b644 | |
| parent | 3e91311ae750af9bf2e3517b1e701288ac3066b9 (diff) | |
Fix cvs2git branch handling
.. and tell 'co' to shut up about the rcs noise.
This still leaves some branch issues up in the air: it looks like
cvsps has some questionable originating branch information, but I
don't know whether that's a cvsps bug or an actual bug in the
syslinux archive I'm using to test.
I'll let David Mansfield answer my questions about CVS. I'm a
total idiot when it comes to branches under CVS ("I'm pure!").
| -rw-r--r-- | cvs2git.c | 12 |
1 files changed, 9 insertions, 3 deletions
@@ -82,18 +82,24 @@ static void prepare_commit(void) if (!strcmp(src_branch, "HEAD")) src_branch = "master"; printf("ln -sf refs/heads/'%s' .git/HEAD\n", src_branch); - printf("git-read-tree -m HEAD\n"); + printf("git-read-tree -m HEAD || exit 1\n"); printf("git-checkout-cache -f -u -a\n"); } static void commit(void) { const char *cmit_parent = initial_commit ? "" : "-p HEAD"; + const char *dst_branch; printf("tree=$(git-write-tree)\n"); printf("cat > .cmitmsg <<EOFMSG\n%s\nEOFMSG\n", log); printf("commit=$(cat .cmitmsg | git-commit-tree $tree %s)\n", cmit_parent); - printf("echo $commit > .git/HEAD\n"); + + dst_branch = branch; + if (!strcmp(dst_branch, "HEAD")) + dst_branch = "master"; + + printf("echo $commit > .git/refs/heads/'%s'\n", dst_branch); *date = 0; *author = 0; @@ -154,7 +160,7 @@ static void update_file(char *line) get_rcs_name(rcspathname, name, dir); - printf("co -p -r%s '%s' > '%s'\n", version, rcspathname, name); + printf("co -q -p -r%s '%s' > '%s'\n", version, rcspathname, name); printf("git-update-cache --add -- '%s'\n", name); } |
