From: Alex Bennee <kernel-hacker@bennee.com>
To: git <git@vger.kernel.org>
Subject: [PATCH] cvs export: ensure we add directories in order
Date: Thu, 18 Oct 2007 17:15:44 +0100 [thread overview]
Message-ID: <1192724144.26933.64.camel@murta.transitives.com> (raw)
Hi,
CVS gets understandably upset if you try and add a subdirectory before
it's parent directory. This patch fixes that.
>From d99d4e7eb0ce7b85fb84d3c57f57abbb100baa5e Mon Sep 17 00:00:00 2001
From: Alex Bennee <alex@bennee.com>
Date: Thu, 18 Oct 2007 17:12:13 +0100
Subject: [PATCH] Ensure we add directories in the correct order
---
git-cvsexportcommit.perl | 11 +++++++++++
1 files changed, 11 insertions(+), 0 deletions(-)
diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 0a21215..a70c583 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -234,6 +234,17 @@ print "Applying\n";
print "Patch applied successfully. Adding new files and directories to CVS\n";
my $dirtypatch = 0;
+
+#
+# We have to add the directories in order otherwise we will have
+# problems when we try and add the sub-directory of a directory we
+# have not added yet.
+#
+# Luckily this is easy to deal with by sorting the directories and
+# dealing with the shortest ones first.
+#
+@dirs = sort { length $a <=> length $b} @dirs;
+
foreach my $d (@dirs) {
if (system(@cvs,'add',$d)) {
$dirtypatch = 1;
--
1.5.2.5
--
Alex, homepage: http://www.bennee.com/~alex/
Business is a good game -- lots of competition and minimum of rules. You
keep score with money. -- Nolan Bushnell, founder of Atari
reply other threads:[~2007-10-18 16:44 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=1192724144.26933.64.camel@murta.transitives.com \
--to=kernel-hacker@bennee.com \
--cc=git@vger.kernel.org \
/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;
as well as URLs for NNTP newsgroup(s).