Re: [PATCH] New files in git weren't being downloaded during CVS update

2 messages, 2 authors, 2016-06-15 · open the first message on its own page

Re: [PATCH] New files in git weren't being downloaded during CVS update

From: Junio C Hamano <hidden>
Date: 2016-06-15 22:42:50

Andy Parkins [off-list ref] writes:
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 <redacted>
---
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.
Martin, I think this looks like a sane change.  

I do not have anything other than the real CVS running on a
Linux box to try this change (most notably I do not do Eclipse
nor Tortoise) myself and I am reluctant to touch things I cannot
personally test at this stage near the release.  I am sure Andy
tested this for his own use in his environment, but I would
really appreciate a third party Ack from an environment
different from the originator of the patch.
quoted hunk
 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

Re: [PATCH] New files in git weren't being downloaded during CVS update

From: Martin Langhoff <hidden>
Date: 2016-06-15 22:42:50

On 1/22/07, Junio C Hamano [off-list ref] wrote:
quoted
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.
Martin, I think this looks like a sane change.
It does -- sorry I've been offline for a few days and catching up with work.
I do not have anything other than the real CVS running on a
Linux box to try this change (most notably I do not do Eclipse
nor Tortoise) myself and I am reluctant to touch things I cannot
personally test at this stage near the release.
Fair enough. I'll give it whirl later tonight. For a quick test, you can always

export CVS_SERVER=/home/martin/src/git/git-cvsserver.perl
cvs update
tested this for his own use in his environment, but I would
really appreciate a third party Ack from an environment
different from the originator of the patch.
Yup. Will test later tonight.


martin
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help