mirror of
https://github.com/git/git
synced 2024-08-27 11:39:22 +00:00
[PATCH] cvs2git.c: support incremental conversion
Add -u option to indicate incremental conversion. I wanted to be able to track CVS repositories in a GIT repository. The cvs2git program worked fine with the initial import but needed a tiny modification to enable me to resync the GIT repository with the updated CVS tree. [ The original version of this patch failed to track the correct branch on the first new commit. Fixed and tested by Sven. ] Signed-off-by: Panagiotis Issaris <takis@lumumba.luc.ac.be> Signed-off-by: Sven Verdoolaege <skimo@kotnet.org> Signed-off-by: Linus Torvalds <torvalds@osdl.org>
This commit is contained in:
parent
44ab20cd88
commit
31b6d200d6
24
cvs2git.c
24
cvs2git.c
|
@ -28,11 +28,17 @@ static int verbose = 0;
|
||||||
* Usage:
|
* Usage:
|
||||||
*
|
*
|
||||||
* TZ=UTC cvsps -A |
|
* TZ=UTC cvsps -A |
|
||||||
* cvs2git --cvsroot=[root] --module=[module] > script
|
* git-cvs2git --cvsroot=[root] --module=[module] > script
|
||||||
*
|
*
|
||||||
* Creates a shell script that will generate the .git archive of
|
* Creates a shell script that will generate the .git archive of
|
||||||
* the names CVS repository.
|
* the names CVS repository.
|
||||||
*
|
*
|
||||||
|
* TZ=UTC cvsps -s 1234- -A |
|
||||||
|
* git-cvs2git -u --cvsroot=[root] --module=[module] > script
|
||||||
|
*
|
||||||
|
* Creates a shell script that will update the .git archive with
|
||||||
|
* CVS changes from patchset 1234 until the last one.
|
||||||
|
*
|
||||||
* IMPORTANT NOTE ABOUT "cvsps"! This requires version 2.1 or better,
|
* IMPORTANT NOTE ABOUT "cvsps"! This requires version 2.1 or better,
|
||||||
* and the "TZ=UTC" and the "-A" flag is required for sane results!
|
* and the "TZ=UTC" and the "-A" flag is required for sane results!
|
||||||
*/
|
*/
|
||||||
|
@ -233,6 +239,10 @@ int main(int argc, char **argv)
|
||||||
verbose = 1;
|
verbose = 1;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
if (!strcmp(arg, "-u")) {
|
||||||
|
initial_commit = 0;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@ -244,11 +254,13 @@ int main(int argc, char **argv)
|
||||||
exit(1);
|
exit(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
printf("[ -d .git ] && exit 1\n");
|
if (initial_commit) {
|
||||||
printf("git-init-db\n");
|
printf("[ -d .git ] && exit 1\n");
|
||||||
printf("mkdir -p .git/refs/heads\n");
|
printf("git-init-db\n");
|
||||||
printf("mkdir -p .git/refs/tags\n");
|
printf("mkdir -p .git/refs/heads\n");
|
||||||
printf("ln -sf refs/heads/master .git/HEAD\n");
|
printf("mkdir -p .git/refs/tags\n");
|
||||||
|
printf("ln -sf refs/heads/master .git/HEAD\n");
|
||||||
|
}
|
||||||
|
|
||||||
while (fgets(line, sizeof(line), stdin) != NULL) {
|
while (fgets(line, sizeof(line), stdin) != NULL) {
|
||||||
int linelen = strlen(line);
|
int linelen = strlen(line);
|
||||||
|
|
Loading…
Reference in a new issue