git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: ericc <eric.chamberland@giref.ulaval.ca>
To: undisclosed-recipients:;
Subject: [PATCH] Make 'cvs -n commit ...' not to commit
Date: Thu, 22 Mar 2012 16:57:43 -0400	[thread overview]
Message-ID: <20120323131100.7262D440B33@melkor.giref.ulaval.ca> (raw)

Actually, doing a 'cvs -n commit' will _do_ the commit...
With this patch, it now goes through the code, but don't do the commit.
A further progress would be to do the pre-commit hook is possible...

Eric Chamberland <Eric.Chamberland@giref.ulaval.ca>
---
 git-cvsserver.perl |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index b8eddab..67ec4d0 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -1395,6 +1395,9 @@ sub req_ci
         push @committedfiles, $committedfile;
         $log->info("Committing $filename");
 
+        # Don't want to actually _DO_ the update if -n specified
+        unless ( $state->{globaloptions}{-n} ) 
+        {
         system("mkdir","-p",$dirpart) unless ( -d $dirpart );
 
         unless ( $rmflag )
@@ -1424,6 +1427,7 @@ sub req_ci
             $log->info("Updating file '$filename'");
             system("git", "update-index", $filename);
         }
+        }
     }
 
     unless ( scalar(@committedfiles) > 0 )
@@ -1434,6 +1438,9 @@ sub req_ci
         return;
     }
 
+    # Don't want to actually _DO_ the update if -n specified
+    unless ( $state->{globaloptions}{-n} ) 
+    {
     my $treehash = `git write-tree`;
     chomp $treehash;
 
@@ -1537,7 +1544,7 @@ sub req_ci
             print "/$filepart/1.$meta->{revision}//$kopts/\n";
         }
     }
-
+    }
     cleanupWorkTree();
     print "ok\n";
 }
-- 
1.7.3.4

             reply	other threads:[~2012-03-23 13:18 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-03-22 20:57 ericc [this message]
2012-03-23 18:39 ` [PATCH] Make 'cvs -n commit ...' not to commit Junio C Hamano
2012-03-23 19:02   ` Eric Chamberland

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=20120323131100.7262D440B33@melkor.giref.ulaval.ca \
    --to=eric.chamberland@giref.ulaval.ca \
    /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).