Skip to contentSkip to conversation

New files in git weren't being downloaded during CVS update

PATCH In review Andy Parkins 2 participants 4 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 New files in git weren't being downloaded during CVS update

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.

---
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(-)
git-cvsserver.perl +0 -1
index a33a876..c370a53 100755
@@ -882,7 +882,6 @@ sub req_update
 		print "MT text A \n";
                 print "MT fname $filename\n";
                 print "MT newline\n";
-		next;
 
 	    }
 	    else {
Signature · 1 line
1.5.0.rc1.gf4b6c
#1 lore raw

git-cvsserver.perl sub req_update · line 885

Quoted 9 lines · Andy Parkins
git-cvsserver.perl +0 -1
index a33a876..c370a53 100755
@@ -882,7 +882,6 @@ sub req_update
 		print "MT text A \n";
                 print "MT fname $filename\n";
                 print "MT newline\n";
-		next;

I think this is the wrong fix. Reading cvs's classify.c, T_ADDED is only generated for *locally* added files, never for added files in the repo. The correct status would be "U" as well.

cheers
simon

Signature · 4 lines
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \
#2 lore raw
Quoted 3 lines · Simon 'corecode' Schubert

I think this is the wrong fix. Reading cvs's classify.c, T_ADDED is only generated for *locally* added files, never for added files in the repo. The correct status would be "U" as well.

I'm sure you're right; I don't know enough about CVS to comment. The real fix would seem to be to completely remove the special case for added files and let it drop through to the normal update code.

However, I'm not confident about that either.

Andy

Signature · 2 lines
Dr Andrew Parkins, M Eng (Hons), AMIEE
[email protected]
#3 lore raw
Quoted 7 lines · Andy Parkins
Quoted 3 lines · Simon 'corecode' Schubert

I think this is the wrong fix. Reading cvs's classify.c, T_ADDED is only generated for *locally* added files, never for added files in the repo. The correct status would be "U" as well.

I'm sure you're right; I don't know enough about CVS to comment. The real fix would seem to be to completely remove the special case for added files and let it drop through to the normal update code.

yes, that's what I ment.

cheers
simon

Signature · 4 lines
Serve - BSD     +++  RENT this banner advert  +++    ASCII Ribbon   /"\
Work - Mac      +++  space for low €€€ NOW!1  +++      Campaign     \ /
Party Enjoy Relax   |   http://dragonflybsd.org      Against  HTML   \
Dude 2c 2 the max   !   http://golden-apple.biz       Mail + News   / \