All of lore.kernel.org
 help / color / mirror / Atom feed
From: Sergei Organov <osv@javad.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com
Subject: [PATCH v2] cvsserver: make the output of 'update' more compatible with cvs.
Date: Mon, 07 Dec 2009 14:11:44 +0300	[thread overview]
Message-ID: <87bpibdonj.fsf@osv.gnss.ru> (raw)
In-Reply-To: <87zl5z4y0w.fsf@osv.gnss.ru>

Native cvs update outputs the string "cvs update: Updating <DIR>" for
every directory it processes (to stderr) unless -q or -Q is given on
comman-line. This is used, e.g., by emacs pcl-cvs to split files by
directory. This commit implements this feature in cvsserver.

Signed-off-by: Sergei Organov <osv@javad.com>
---
 git-cvsserver.perl |   16 ++++++++++++++++
 1 files changed, 16 insertions(+), 0 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 6dc45f5..f4c75bb 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -981,6 +981,8 @@ sub req_update
 
     #$log->debug("update state : " . Dumper($state));
 
+    my $last_dirname = "///";
+    
     # foreach file specified on the command line ...
     foreach my $filename ( @{$state->{args}} )
     {
@@ -988,6 +990,20 @@ sub req_update
 
         $log->debug("Processing file $filename");
 
+        unless ( $state->{globaloptions}{-Q} || $state->{globaloptions}{-q} )
+        {
+            my $cur_dirname = dirname($filename);
+            if ( $cur_dirname ne $last_dirname )
+            {
+                $last_dirname = $cur_dirname;
+                if ( $cur_dirname eq "" )
+                {
+                    $cur_dirname = ".";
+                }
+                print "E cvs update: Updating $cur_dirname\n";
+            }
+        }
+
         # if we have a -C we should pretend we never saw modified stuff
         if ( exists ( $state->{opt}{C} ) )
         {
-- 
1.6.6.rc0.67.gc0456.dirty

  parent reply	other threads:[~2009-12-07 11:12 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-12-03 20:12 [PATCH] cvsserver: make the output of 'update' more compatible with cvs Sergei Organov
2009-12-05 23:48 ` mmogilvi_git
2009-12-07  8:27   ` Sergei Organov
2009-12-07 11:11 ` Sergei Organov [this message]
2009-12-30 13:41   ` [PATCH v2] " Nanako Shiraishi
2009-12-31  6:47     ` Junio C Hamano
2009-12-31 15:20       ` Martin Langhoff
2009-12-31 20:14         ` Junio C Hamano

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=87bpibdonj.fsf@osv.gnss.ru \
    --to=osv@javad.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.