git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] cvsserver: make the output of 'update' more compatible with cvs.
@ 2009-12-03 20:12 Sergei Organov
  2009-12-05 23:48 ` mmogilvi_git
  2009-12-07 11:11 ` [PATCH v2] " Sergei Organov
  0 siblings, 2 replies; 8+ messages in thread
From: Sergei Organov @ 2009-12-03 20:12 UTC (permalink / raw)
  To: git; +Cc: gitster

Native cvs update outputs the string "cvs update: Updating <DIR>" for
every directory it processes (to stderr). This is used, e.g., by emacs
pcl-cvs to split files by directory. This commit implements this
feature in cvsserver.
---
 git-cvsserver.perl |   12 ++++++++++++
 1 files changed, 12 insertions(+), 0 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index 6dc45f5..5994951 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -981,10 +981,22 @@ sub req_update
 
     #$log->debug("update state : " . Dumper($state));
 
+    my $last_dirname = "///";
+    
     # foreach file specified on the command line ...
     foreach my $filename ( @{$state->{args}} )
     {
         $filename = filecleanup($filename);
+        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";
+        }
 
         $log->debug("Processing file $filename");
 
-- 
1.6.6.rc0.67.g68b144.dirty

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH] cvsserver: make the output of 'update' more compatible with cvs.
  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 ` [PATCH v2] " Sergei Organov
  1 sibling, 1 reply; 8+ messages in thread
From: mmogilvi_git @ 2009-12-05 23:48 UTC (permalink / raw)
  To: Sergei Organov; +Cc: git, gitster

On Thu, Dec 03, 2009 at 11:12:47PM +0300, Sergei Organov wrote:
>  
> +    my $last_dirname = "///";
> +    
>      # foreach file specified on the command line ...
>      foreach my $filename ( @{$state->{args}} )
>      {
>          $filename = filecleanup($filename);
> +        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";
> +        }
>  
>          $log->debug("Processing file $filename");

This should probably be conditional on the absense of the
global "cvs -q update" and "cvs -Q update" options, in case
other CVS clients depend on quiet operation when they specify
those options.

--
Matthew Ogilvie   [mmogilvi_git@miniinfo.net]

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH] cvsserver: make the output of 'update' more compatible with cvs.
  2009-12-05 23:48 ` mmogilvi_git
@ 2009-12-07  8:27   ` Sergei Organov
  0 siblings, 0 replies; 8+ messages in thread
From: Sergei Organov @ 2009-12-07  8:27 UTC (permalink / raw)
  To: mmogilvi_git; +Cc: git, gitster

mmogilvi_git@miniinfo.net writes:

> On Thu, Dec 03, 2009 at 11:12:47PM +0300, Sergei Organov wrote:
>>  
>> +    my $last_dirname = "///";
>> +    
>>      # foreach file specified on the command line ...
>>      foreach my $filename ( @{$state->{args}} )
>>      {
>>          $filename = filecleanup($filename);
>> +        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";
>> +        }
>>  
>>          $log->debug("Processing file $filename");
>
> This should probably be conditional on the absense of the
> global "cvs -q update" and "cvs -Q update" options, in case
> other CVS clients depend on quiet operation when they specify
> those options.

Good catch, thanks! I'll redo the patch.

-- Sergei.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* [PATCH v2] cvsserver: make the output of 'update' more compatible with cvs.
  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 11:11 ` Sergei Organov
  2009-12-30 13:41   ` Nanako Shiraishi
  1 sibling, 1 reply; 8+ messages in thread
From: Sergei Organov @ 2009-12-07 11:11 UTC (permalink / raw)
  To: git; +Cc: gitster

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

^ permalink raw reply related	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] cvsserver: make the output of 'update' more compatible with cvs.
  2009-12-07 11:11 ` [PATCH v2] " Sergei Organov
@ 2009-12-30 13:41   ` Nanako Shiraishi
  2009-12-31  6:47     ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Nanako Shiraishi @ 2009-12-30 13:41 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Sergei Organov, git

Junio, could you tell us what happened to this thread?

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] cvsserver: make the output of 'update' more compatible with cvs.
  2009-12-30 13:41   ` Nanako Shiraishi
@ 2009-12-31  6:47     ` Junio C Hamano
  2009-12-31 15:20       ` Martin Langhoff
  0 siblings, 1 reply; 8+ messages in thread
From: Junio C Hamano @ 2009-12-31  6:47 UTC (permalink / raw)
  To: Nanako Shiraishi; +Cc: Junio C Hamano, Sergei Organov, git

Nanako Shiraishi <nanako3@lavabit.com> writes:

> Junio, could you tell us what happened to this thread?

Well, since I don't use cvsserver myself, but this v2 was done with
improvements based on some review suggestions, I was waiting for a
response or two from people who know better and care more about cvs server
emulation than me, which unfortunately didn't happen.

Thanks for reminding; I can queue it to 'pu' or perhaps 'next' and see if
anybody screams by getting hit by an unintended side effects.

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] cvsserver: make the output of 'update' more compatible  with cvs.
  2009-12-31  6:47     ` Junio C Hamano
@ 2009-12-31 15:20       ` Martin Langhoff
  2009-12-31 20:14         ` Junio C Hamano
  0 siblings, 1 reply; 8+ messages in thread
From: Martin Langhoff @ 2009-12-31 15:20 UTC (permalink / raw)
  To: Junio C Hamano; +Cc: Nanako Shiraishi, Sergei Organov, git

On Thu, Dec 31, 2009 at 7:47 AM, Junio C Hamano <gitster@pobox.com> wrote:
> Well, since I don't use cvsserver myself, but this v2 was done with
> improvements based on some review suggestions, I was waiting for a
> response or two from people who know better and care more about cvs server
> emulation than me, which unfortunately didn't happen.

Looks good to me -- good to get it into pu. While I continue to use
git extensively, I don't use cvsserver anymore, nor work with people
that do. Might have reason to revisit cvsserver in the near future
though, to help Moodle transition to git.

That transition will bring a few top-posters and Eclipse lovers to the
list. Looking past such details, they are fine people who may need a
little bit of git-newbie help ;-)

happy new year,



m
-- 
 martin.langhoff@gmail.com
 martin@laptop.org -- School Server Architect
 - ask interesting questions
 - don't get distracted with shiny stuff  - working code first
 - http://wiki.laptop.org/go/User:Martinlanghoff

^ permalink raw reply	[flat|nested] 8+ messages in thread

* Re: [PATCH v2] cvsserver: make the output of 'update' more compatible  with cvs.
  2009-12-31 15:20       ` Martin Langhoff
@ 2009-12-31 20:14         ` Junio C Hamano
  0 siblings, 0 replies; 8+ messages in thread
From: Junio C Hamano @ 2009-12-31 20:14 UTC (permalink / raw)
  To: Martin Langhoff; +Cc: Nanako Shiraishi, Sergei Organov, git

Martin Langhoff <martin.langhoff@gmail.com> writes:

> On Thu, Dec 31, 2009 at 7:47 AM, Junio C Hamano <gitster@pobox.com> wrote:
>> Well, since I don't use cvsserver myself, but this v2 was done with
>> improvements based on some review suggestions, I was waiting for a
>> response or two from people who know better and care more about cvs server
>> emulation than me, which unfortunately didn't happen.
>
> Looks good to me -- good to get it into pu. While I continue to use
> git extensively, I don't use cvsserver anymore, nor work with people
> that do. Might have reason to revisit cvsserver in the near future
> though, to help Moodle transition to git.
>
> That transition will bring a few top-posters and Eclipse lovers to the
> list. Looking past such details, they are fine people who may need a
> little bit of git-newbie help ;-)
>
> happy new year,

Happy new year to you, Nana and Sergei, but not yet in my timezone ;-)

Thanks; I'll forge/add your "Acked-by:" when I queue it.

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2009-12-31 20:14 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 ` [PATCH v2] " Sergei Organov
2009-12-30 13:41   ` 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

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).