git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] New files in git weren't being downloaded during CVS update
@ 2007-01-21 14:25 Andy Parkins
  2007-01-22  2:35 ` Junio C Hamano
  2007-01-22 10:44 ` Andy Parkins
  0 siblings, 2 replies; 12+ messages in thread
From: Andy Parkins @ 2007-01-21 14:25 UTC (permalink / raw)
  To: git

If a repository was checked out via git-cvsserver and then later a new
file is added to the git repository via some other method; a CVS update
wasn't fetching the new file.

It would be reported as a new file as
 A some/dir/newfile.c
but would never appear in the directory.

The problem (I think) is that when git-cvsserver detected a new file, it
was issuing the new file message then skipping the actual file send part
and moving to the next file its list.  In fact only an updated file
would be transmitted.

The fix is to make the added file section identical to the udpated file
section.  This additionally makes git-cvsserver behave like a
traditional CVS server and will now output
 U some/dir/newfile.c
for an added file.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
This is in response to Simon Schubert's suggestion that T_ADDED is an
inappropriate category for a remotely added file.  Instead this treats
remotely added files the same as remotely changed files.

 git-cvsserver.perl |   10 +++++-----
 1 files changed, 5 insertions(+), 5 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index a33a876..501c182 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -879,11 +879,11 @@ sub req_update
 	    elsif ( !defined($wrev) || $wrev == 0 )
 	    {
 	        $log->info("Tell the client the file will be added");
-		print "MT text A \n";
-                print "MT fname $filename\n";
-                print "MT newline\n";
-		next;
-
+			print "MT +updated\n";
+			print "MT text U \n";
+			print "MT fname $filename\n";
+			print "MT newline\n";
+			print "MT -updated\n";
 	    }
 	    else {
                 $log->info("Updating '$filename' $wrev");
-- 
1.5.0.rc1.gf4b6c

^ permalink raw reply related	[flat|nested] 12+ messages in thread
* [PATCH] New files in git weren't being downloaded during CVS update
@ 2007-01-19 10:49 Andy Parkins
  2007-01-20  1:19 ` Simon 'corecode' Schubert
  0 siblings, 1 reply; 12+ messages in thread
From: Andy Parkins @ 2007-01-19 10:49 UTC (permalink / raw)
  To: git

If a repository was checked out via git-cvsserver and then later a new
file is added to the git repository via some other method; a CVS update
wasn't fetching the new file.

It would be reported as a new file as
 A some/dir/newfile.c
but would never appear in the directory.

The problem (I think) is that when git-cvsserver detected a new file, it
was issuing the new file message then skipping the actual file send part
and moving to the next file its list.  In fact only an updated file
would be transmitted.

The fix is to simply remove the "next" that was skipping the file
transmit; which is what this patch does.

Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
I don't understand enough about the CVS protocol to know whether this really
is the right fix.  It certainly addresses my problem, but I assume that the "next"
was put in there for a reason.

 git-cvsserver.perl |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)

diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index a33a876..c370a53 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -882,7 +882,6 @@ sub req_update
 		print "MT text A \n";
                 print "MT fname $filename\n";
                 print "MT newline\n";
-		next;
 
 	    }
 	    else {
-- 
1.5.0.rc1.gf4b6c

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

end of thread, other threads:[~2007-01-22 11:08 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-01-21 14:25 [PATCH] New files in git weren't being downloaded during CVS update Andy Parkins
2007-01-22  2:35 ` Junio C Hamano
2007-01-22  7:02   ` Martin Langhoff
2007-01-22  7:16     ` Junio C Hamano
2007-01-22 10:44 ` Andy Parkins
2007-01-22 10:46   ` Andy Parkins
2007-01-22 10:56   ` Andy Parkins
2007-01-22 11:08     ` Simon 'corecode' Schubert
  -- strict thread matches above, loose matches on Subject: below --
2007-01-19 10:49 Andy Parkins
2007-01-20  1:19 ` Simon 'corecode' Schubert
2007-01-20 10:25   ` Andy Parkins
2007-01-20 10:41     ` Simon 'corecode' Schubert

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