From: Martin Langhoff <martin@catalyst.net.nz>
To: git@vger.kernel.org, junkio@cox.net, Johannes.Schindelin@gmx.de
Cc: Martin Langhoff <martin@catalyst.net.nz>
Subject: [PATCH] cvsimport: setup indexes correctly for ancestors and incremental imports
Date: Sat, 24 Jun 2006 23:13:08 +1200 [thread overview]
Message-ID: <11511475882820-git-send-email-martin@catalyst.net.nz> (raw)
Two bugs had slipped in the "keep one index per branch during import"
patch. Both incremental imports and new branches would see an
empty tree for their initial commit. Now we cover all the relevant
cases, checking whether we actually need to setup the index before
preparing the actual commit, and doing it.
Signed-off-by: Martin Langhoff <martin@catalyst.net.nz>
---
git-cvsimport.perl | 19 +++++++++++++++++--
1 files changed, 17 insertions(+), 2 deletions(-)
diff --git a/git-cvsimport.perl b/git-cvsimport.perl
old mode 100644
new mode 100755
index d961b7b..1c1fd02
--- a/git-cvsimport.perl
+++ b/git-cvsimport.perl
@@ -813,11 +813,26 @@ while(<CVS>) {
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 $?;
+ }
+ }
+ } else {
+ # just in case
+ unless ($index{$branch}) {
+ $index{$branch} = tmpnam();
$ENV{GIT_INDEX_FILE} = $index{$branch};
- }
+ system("git-read-tree", $branch);
+ die "read-tree failed: $?\n" if $?;
+ }
}
$last_branch = $branch if $branch ne $last_branch;
$state = 9;
--
1.4.1.rc1.g59c8
next reply other threads:[~2006-06-24 11:13 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2006-06-24 11:13 Martin Langhoff [this message]
2006-06-24 13:06 ` [PATCH] cvsimport: setup indexes correctly for ancestors and incremental imports Sergey Vlasov
2006-06-24 19:42 ` Johannes Schindelin
2006-06-25 3:10 ` Junio C Hamano
2006-06-25 8:53 ` Petr Baudis
2006-06-25 9:27 ` Junio C Hamano
2006-06-25 9:26 ` Johannes Schindelin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=11511475882820-git-send-email-martin@catalyst.net.nz \
--to=martin@catalyst.net.nz \
--cc=Johannes.Schindelin@gmx.de \
--cc=git@vger.kernel.org \
--cc=junkio@cox.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox