git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* cvs importer woes
@ 2006-06-27 10:05 Andreas Ericsson
  2006-06-27 10:35 ` [TRYTHIS] cvsimport: fix initial import Johannes Schindelin
  2006-06-27 10:42 ` cvs importer woes Martin Langhoff
  0 siblings, 2 replies; 7+ messages in thread
From: Andreas Ericsson @ 2006-06-27 10:05 UTC (permalink / raw)
  To: Git Mailing List

Sadly, the cvsimport command no longer works to create new repositories 
from scratch. I'm not nearly perl literate enough to fix it, but the 
problem seems to be firstly 061303f0b50a648db8e0af23791fc56181f6bf93. In 
particular "Also, make sure that the initial git-read-tree is 
performed." which fails if there is not a complete git repo already 
created with at least one tree committed.

Some sample output:

$ git cvsimport -k -u -d:local:/home/CVS packages
fatal: Not a git repository: '/data/home/exon/git/packages/.git'
read-tree failed: 32768

Removing the unconditional read-tree call, I get this (still in an empty 
directory which isn't a repo):

$ git cvsimport -k -u -d:local:/home/CVS packages
fatal: Not a git repository: '/data/home/exon/git/packages/.git'
read-tree failed: 32768

$ git init-db
defaulting to local storage area

$ git cvsimport -k -u -d:local:/home/CVS packages
fatal: Not a valid object name origin
read-tree failed: 32768

Bisect running now. v1.3.1 is good and imports the stuff properly to an 
empty directory.

Oh, now it's done (4 minutes for 620 revisions with automated testing 
between good/bad. *LOVE* bisect).

The culprit is definitely 061303f0b50a648db8e0af23791fc56181f6bf93.

Any perl-literate takers? Otherwise, just reverting the patch makes 
things work (for me) again.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 7+ messages in thread

* [TRYTHIS] cvsimport: fix initial import
  2006-06-27 10:05 cvs importer woes Andreas Ericsson
@ 2006-06-27 10:35 ` Johannes Schindelin
  2006-06-27 10:41   ` Andreas Ericsson
  2006-06-27 10:52   ` Martin Langhoff
  2006-06-27 10:42 ` cvs importer woes Martin Langhoff
  1 sibling, 2 replies; 7+ messages in thread
From: Johannes Schindelin @ 2006-06-27 10:35 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Git Mailing List

---
Hi,

On Tue, 27 Jun 2006, Andreas Ericsson wrote:

> Sadly, the cvsimport command no longer works to create new repositories from
> scratch. I'm not nearly perl literate enough to fix it, but the problem seems
> to be firstly 061303f0b50a648db8e0af23791fc56181f6bf93.

My bad. Could you try this patch on top of 'next'?

 git-cvsimport.perl |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 50f5d96..f8eb6ef 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -471,7 +471,6 @@ my %index; # holds filenames of one inde
 
 $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");

^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [TRYTHIS] cvsimport: fix initial import
  2006-06-27 10:35 ` [TRYTHIS] cvsimport: fix initial import Johannes Schindelin
@ 2006-06-27 10:41   ` Andreas Ericsson
  2006-06-27 10:52   ` Martin Langhoff
  1 sibling, 0 replies; 7+ messages in thread
From: Andreas Ericsson @ 2006-06-27 10:41 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Git Mailing List

Johannes Schindelin wrote:
> ---
> Hi,
> 
> On Tue, 27 Jun 2006, Andreas Ericsson wrote:
> 
> 
>>Sadly, the cvsimport command no longer works to create new repositories from
>>scratch. I'm not nearly perl literate enough to fix it, but the problem seems
>>to be firstly 061303f0b50a648db8e0af23791fc56181f6bf93.
> 
> 
> My bad. Could you try this patch on top of 'next'?
> 

Works wonderfully. Weird that it didn't when I removed the read-tree 
completely. There was probably some pilot error involved on my part 
there and then.

Thanks, and ack.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cvs importer woes
  2006-06-27 10:05 cvs importer woes Andreas Ericsson
  2006-06-27 10:35 ` [TRYTHIS] cvsimport: fix initial import Johannes Schindelin
@ 2006-06-27 10:42 ` Martin Langhoff
  2006-06-27 10:49   ` Andreas Ericsson
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Langhoff @ 2006-06-27 10:42 UTC (permalink / raw)
  To: Andreas Ericsson; +Cc: Git Mailing List

On 6/27/06, Andreas Ericsson <ae@op5.se> wrote:
> Sadly, the cvsimport command no longer works to create new repositories
> from scratch.

We are seeing some breakage in cvsimport that started with a patch of mine:

 8f732649bc4d5619a1b399e5808b3f4c662ad200 cvsimport: keep one index
per branch during import

so I'd say that if you are using cvsimport, stick to the v1.4.0
version. You can do

  git-cat-file blob v1.4.0:git-cvsimport.perl >git-cvsimport.perl

> problem seems to be firstly 061303f0b50a648db8e0af23791fc56181f6bf93.

Yes, that commit will break brand new imports, but it's trying to
fixup breakage that started with my patch. It shouldn't be too hard to
fix up, but real life is interfering.

> Oh, now it's done (4 minutes for 620 revisions with automated testing
> between good/bad. *LOVE* bisect).

Love bisect too for easy-to-test cases.

> The culprit is definitely 061303f0b50a648db8e0af23791fc56181f6bf93.
>
> Any perl-literate takers? Otherwise, just reverting the patch makes
> things work (for me) again.

Don't just revert that patch, unless I'm wrong there is some subtle
branch-creation breakage too.

cheers,




martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: cvs importer woes
  2006-06-27 10:42 ` cvs importer woes Martin Langhoff
@ 2006-06-27 10:49   ` Andreas Ericsson
  0 siblings, 0 replies; 7+ messages in thread
From: Andreas Ericsson @ 2006-06-27 10:49 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Git Mailing List

Martin Langhoff wrote:
> On 6/27/06, Andreas Ericsson <ae@op5.se> wrote:
> 
>> Sadly, the cvsimport command no longer works to create new repositories
>> from scratch.
> 
> 
> We are seeing some breakage in cvsimport that started with a patch of mine:
> 
> 8f732649bc4d5619a1b399e5808b3f4c662ad200 cvsimport: keep one index
> per branch during import
> 

I experimented a bit with that one too, but it worked for my (very 
small, no branches, no tags) cvs repo

> 
>> The culprit is definitely 061303f0b50a648db8e0af23791fc56181f6bf93.
>>
>> Any perl-literate takers? Otherwise, just reverting the patch makes
>> things work (for me) again.
> 
> 
> Don't just revert that patch, unless I'm wrong there is some subtle
> branch-creation breakage too.
> 

Dscho's patch on top of 061303f0b works wonders. Thanks all the same though.

-- 
Andreas Ericsson                   andreas.ericsson@op5.se
OP5 AB                             www.op5.se
Tel: +46 8-230225                  Fax: +46 8-230231

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [TRYTHIS] cvsimport: fix initial import
  2006-06-27 10:35 ` [TRYTHIS] cvsimport: fix initial import Johannes Schindelin
  2006-06-27 10:41   ` Andreas Ericsson
@ 2006-06-27 10:52   ` Martin Langhoff
  2006-06-27 11:01     ` Johannes Schindelin
  1 sibling, 1 reply; 7+ messages in thread
From: Martin Langhoff @ 2006-06-27 10:52 UTC (permalink / raw)
  To: Johannes Schindelin; +Cc: Andreas Ericsson, Git Mailing List

Hi Johannes,

this patch doesn't quite make sense to me. The git-read-tree should be
in the else block of the unless you have right there (and it's
actually there, but it may be breaking in some cases? Perhaps should
happen a bit earlier?).

How do you expect to run git-read-tree or die _before_ git-init-db?

cheers,


martin

^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [TRYTHIS] cvsimport: fix initial import
  2006-06-27 10:52   ` Martin Langhoff
@ 2006-06-27 11:01     ` Johannes Schindelin
  0 siblings, 0 replies; 7+ messages in thread
From: Johannes Schindelin @ 2006-06-27 11:01 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Andreas Ericsson, Git Mailing List

Hi,

On Tue, 27 Jun 2006, Martin Langhoff wrote:

> this patch doesn't quite make sense to me. The git-read-tree should be
> in the else block of the unless you have right there (and it's
> actually there, but it may be breaking in some cases? Perhaps should
> happen a bit earlier?).
> 
> How do you expect to run git-read-tree or die _before_ git-init-db?

Oops. I even do not remember what I smoked.

The git-read-tree before git-init-db evidently only works if this is not 
the initial import. Which it wasn't in my case.

And I keep getting confused with the "if" and "unless" sometimes 
prepended, sometimes appended. Well, that is Perl before Swine for me ;-)

How about this instead:

 git-cvsimport.perl |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/git-cvsimport.perl b/git-cvsimport.perl
index 50f5d96..4caef10 100755
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -470,8 +470,6 @@ my %index; # holds filenames of one inde
 $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");
@@ -482,6 +480,8 @@ unless(-d $git_dir) {
 	$last_branch = $opt_o;
 	$orig_branch = "";
 } else {
+	system("git-read-tree", $opt_o);
+	die "read-tree failed: $?\n" if $?;
 	-f "$git_dir/refs/heads/$opt_o"
 		or die "Branch '$opt_o' does not exist.\n".
 		       "Either use the correct '-o branch' option,\n".

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2006-06-27 11:01 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2006-06-27 10:05 cvs importer woes Andreas Ericsson
2006-06-27 10:35 ` [TRYTHIS] cvsimport: fix initial import Johannes Schindelin
2006-06-27 10:41   ` Andreas Ericsson
2006-06-27 10:52   ` Martin Langhoff
2006-06-27 11:01     ` Johannes Schindelin
2006-06-27 10:42 ` cvs importer woes Martin Langhoff
2006-06-27 10:49   ` Andreas Ericsson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).