git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Yann Dirson <ydirson@altern.org>
To: GIT list <git@vger.kernel.org>
Subject: [PATCH] Teach cvsexportcommit to add new files
Date: Fri, 6 Jan 2006 21:54:41 +0100	[thread overview]
Message-ID: <20060106205441.GA32585@nowhere.earth> (raw)

Teach cvsexportcommit to add new files
"cvs add" support was already there, but the "unknown" status
returned when querying a file not yet known to cvs caused the
script to abort prematurely.

---
commit 7e1b8a9af653c9a4f8d2a6a4b34ccf56a2f48526
tree f94f057ec672b715ffda28e359bd5d672fdfb6b3
parent 58e3fb40f7ca1c28f9105c15166884f80bb22e55
author Yann Dirson <ydirson@altern.org> Fri, 06 Jan 2006 21:31:21 +0100
committer Yann Dirson <dwitch@gandelf.nowhere.earth> Fri, 06 Jan 2006 21:31:21 +0100

 git-cvsexportcommit.perl |   12 ++++++++++--
 1 files changed, 10 insertions(+), 2 deletions(-)

diff --git a/git-cvsexportcommit.perl b/git-cvsexportcommit.perl
index 5a8c011..d5fbee7 100755
--- a/git-cvsexportcommit.perl
+++ b/git-cvsexportcommit.perl
@@ -103,8 +103,16 @@ undef @files; # don't need it anymore
 
 # check that the files are clean and up to date according to cvs
 my $dirty;
-foreach my $f (@afiles, @mfiles, @dfiles) {
-    # TODO:we need to handle removed in cvs and/or new (from git) 
+foreach my $f (@afiles) {
+    my $status = `cvs -q status "$f" | grep '^File: '`;
+
+    unless ($status =~ m/Status: Unknown$/) {
+	$dirty = 1;
+	warn "File $f is already known in your CVS checkout!\n";
+    }
+}
+foreach my $f (@mfiles, @dfiles) {
+    # TODO:we need to handle removed in cvs
     my $status = `cvs -q status "$f" | grep '^File: '`;
 
     unless ($status =~ m/Status: Up-to-date$/) {

-- 
Yann Dirson    <ydirson@altern.org> |
Debian-related: <dirson@debian.org> |   Support Debian GNU/Linux:
                                    |  Freedom, Power, Stability, Gratis
     http://ydirson.free.fr/        | Check <http://www.debian.org/>

             reply	other threads:[~2006-01-06 20:52 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-01-06 20:54 Yann Dirson [this message]
2006-01-06 22:37 ` [PATCH] Teach cvsexportcommit to add new files Junio C Hamano
2006-01-07  7:29   ` Martin Langhoff
2006-01-07  9:01     ` cvsexportcommit / cvsimport issues Yann Dirson

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=20060106205441.GA32585@nowhere.earth \
    --to=ydirson@altern.org \
    --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).