threads / patch / 6443

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

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

## tl;dr

4 messages between Jan 19, 2007 and Jan 20, 2007. Diffs are folded; open one to read it.

replies: 3people: 2as markdown or json

Andy Parkins· Jan 19, 2007, 10:49 UTC · lore

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(-)
Show changes to git-cvsserver.perl +0 −1
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
Simon 'corecode' Schubert· Jan 20, 2007, 01:19 UTC · re: Andy Parkins · lore

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

Andy Parkins wrote:
Show 9 quoted lines
> 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;
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
-- 
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   / \
Andy Parkins· Jan 20, 2007, 10:25 UTC · re: Simon 'corecode' Schubert · lore

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

On Saturday 2007, January 20 01:19, Simon 'corecode' Schubert wrote:
> 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
-- 
Dr Andrew Parkins, M Eng (Hons), AMIEE
andyparkins@gmail.com
Simon 'corecode' Schubert· Jan 20, 2007, 10:41 UTC · re: Andy Parkins · lore

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

Andy Parkins wrote:
Show 9 quoted lines
> On Saturday 2007, January 20 01:19, Simon 'corecode' Schubert wrote:
> 
>> 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
-- 
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   / \

← back to recent threads