Code

sha1_file.c: fix typo
[git.git] / git-cvsimport.perl
index 47f116f37ee1030ac0cab1f91feec04d673d94bd..e43920296182f320dac31b5832a30844ffaef38f 100755 (executable)
@@ -36,7 +36,7 @@ sub usage(;$) {
        my $msg = shift;
        print(STDERR "Error: $msg\n") if $msg;
        print STDERR <<END;
-Usage: ${\basename $0}     # fetch/update GIT from CVS
+Usage: git cvsimport     # fetch/update GIT from CVS
        [-o branch-for-HEAD] [-h] [-v] [-d CVSROOT] [-A author-conv-file]
        [-p opts-for-cvsps] [-P file] [-C GIT_repository] [-z fuzz] [-i] [-k]
        [-u] [-s subst] [-a] [-m] [-M regex] [-S regex] [-L commitlimit]
@@ -227,6 +227,7 @@ sub conn {
                                $proxyport = $1;
                        }
                }
+               $repo ||= '/';
 
                # if username is not explicit in CVSROOT, then use current user, as cvs would
                $user=(getlogin() || $ENV{'LOGNAME'} || $ENV{'USER'} || "anonymous") unless $user;
@@ -735,7 +736,7 @@ sub commit {
                next unless $logmsg =~ $rx && $1;
                my $mparent = $1 eq 'HEAD' ? $opt_o : $1;
                if (my $sha1 = get_headref("$remote/$mparent")) {
-                       push @commit_args, '-p', $mparent;
+                       push @commit_args, '-p', "$remote/$mparent";
                        print "Merge parent branch: $mparent\n" if $opt_v;
                }
        }
@@ -772,7 +773,7 @@ sub commit {
        waitpid($pid,0);
        die "Error running git-commit-tree: $?\n" if $?;
 
-       system("git-update-ref $remote/$branch $cid") == 0
+       system('git-update-ref', "$remote/$branch", $cid) == 0
                or die "Cannot write branch $branch for update: $!\n";
 
        if ($tag) {
@@ -780,6 +781,7 @@ sub commit {
                $xtag =~ s/\s+\*\*.*$//; # Remove stuff like ** INVALID ** and ** FUNKY **
                $xtag =~ tr/_/\./ if ( $opt_u );
                $xtag =~ s/[\/]/$opt_s/g;
+               $xtag =~ s/\[//g;
 
                system('git-tag', '-f', $xtag, $cid) == 0
                        or die "Cannot create tag $xtag: $!\n";
@@ -950,7 +952,7 @@ while (<CVS>) {
        } elsif (/^-+$/) { # end of unknown-line processing
                $state = 1;
        } elsif ($state != 11) { # ignore stuff when skipping
-               print "* UNKNOWN LINE * $_\n";
+               print STDERR "* UNKNOWN LINE * $_\n";
        }
 }
 commit() if $branch and $state != 11;