Re: [PATCH] cvsimport: setup indexes correctly for ancestors and incremental imports

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi,

almost happy.

On Sat, 24 Jun 2006, Martin Langhoff wrote:

>  			unless ($index{$branch}) {
>  			    $index{$branch} = tmpnam();
>  			    $ENV{GIT_INDEX_FILE} = $index{$branch};
> -			    system("git-read-tree", $branch);
> +			}
> +			if ($ancestor) {
> +			    system("git-read-tree", $ancestor);
>  			    die "read-tree failed: $?\n" if $?;
>  			} else {
> +			    unless ($index{$branch}) {
> +				$index{$branch} = tmpnam();
> +				$ENV{GIT_INDEX_FILE} = $index{$branch};
> +				system("git-read-tree", $branch);
> +				die "read-tree failed: $?\n" if $?;
> +			    }
> +			}    

This line ^ seems to have white space at the end.

Also, in my case, this is still broken. $index{$branch} is set, $ancestor 
not, but $ENV{GIT_INDEX_FILE} ne $index{$branch}.

You can reproduce this by importing into branch origin while branch master 
(which is not equal to origin) is checked out.

Plus, the initial setting of GIT_INDEX_FILE forgot to perform a 
git-read-tree.

How about this on top of your patch (which fixes things with my setup):

---
[PATCH] cvsimport: always set $ENV{GIT_INDEX_FILE} to $index{$branch}

Also, make sure that the initial git-read-tree is performed.

Signed-off-by: Johannes Schindelin <Johannes.Schindelin@xxxxxx>

---

 git-cvsimport |   15 ++++++++-------
 1 files changed, 8 insertions(+), 7 deletions(-)

--- git-cvsimport.perl	2006-06-24 20:30:33.000000000 +0200
+++ git-cvsimport	2006-06-24 21:35:42.000000000 +0200
@@ -470,6 +470,9 @@
 $index{$opt_o} = tmpnam();
 
 $ENV{GIT_INDEX_FILE} = $index{$opt_o};
+system("git-read-tree", $opt_o);
+die "read-tree failed: $?\n" if $?;
+
 unless(-d $git_dir) {
 	system("git-init-db");
 	die "Cannot init the GIT db at $git_tree: $?\n" if $?;
@@ -813,17 +816,15 @@
 			unless ($index{$branch}) {
 			    $index{$branch} = tmpnam();
 			    $ENV{GIT_INDEX_FILE} = $index{$branch};
+			    system("git-read-tree", $branch);
+			    die "read-tree failed: $?\n" if $?;
 			}
+			# just in case
+			$ENV{GIT_INDEX_FILE} = $index{$branch};
 			if ($ancestor) {
+			    print "have ancestor $ancestor" if $opt_v;
 			    system("git-read-tree", $ancestor);
 			    die "read-tree failed: $?\n" if $?;
-			} else {
-			    unless ($index{$branch}) {
-				$index{$branch} = tmpnam();
-				$ENV{GIT_INDEX_FILE} = $index{$branch};
-				system("git-read-tree", $branch);
-				die "read-tree failed: $?\n" if $?;
-			    }
 			}
 		} else {
 			# just in case
-
: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]