git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[PATCH] Make 'cvs -n commit ...' not to commit

From
Eericc <eric.chamberland@giref.ulaval.ca>
Date
Mar 22, 2012, 20:57 UTC
Message-ID
<20120323131100.7262D440B33@melkor.giref.ulaval.ca>

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
Next: Junio C Hamano
Message 1 of 3 in “Make 'cvs -n commit ...' not to commit”
  1. Make 'cvs -n commit ...' not to commitericc, Mar 22, 2012
  2. Junio C HamanoMar 23, 2012
  3. Eric ChamberlandMar 23, 2012

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.