X-Git-Url: https://git.verplant.org/?a=blobdiff_plain;f=cvs2git.c;h=ab0590872e113531aba897e587a08a8dbacf84d9;hb=7323aa11af1527d5a786d93ee34401c72c5df051;hp=d438475d03b7ff897a9e2b976a34a75b86c01a80;hpb=deb153a75ae1f5eca628a38b911474a69edd242d;p=git.git diff --git a/cvs2git.c b/cvs2git.c index d438475d..ab059087 100644 --- a/cvs2git.c +++ b/cvs2git.c @@ -28,11 +28,17 @@ static int verbose = 0; * Usage: * * 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 * 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, * 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; continue; } + if (!strcmp(arg, "-u")) { + initial_commit = 0; + continue; + } } @@ -244,11 +254,13 @@ int main(int argc, char **argv) exit(1); } - printf("[ -d .git ] && exit 1\n"); - printf("git-init-db\n"); - printf("mkdir -p .git/refs/heads\n"); - printf("mkdir -p .git/refs/tags\n"); - printf("ln -sf refs/heads/master .git/HEAD\n"); + if (initial_commit) { + printf("[ -d .git ] && exit 1\n"); + printf("git-init-db\n"); + printf("mkdir -p .git/refs/heads\n"); + printf("mkdir -p .git/refs/tags\n"); + printf("ln -sf refs/heads/master .git/HEAD\n"); + } while (fgets(line, sizeof(line), stdin) != NULL) { int linelen = strlen(line);