Skip to contentSkip to conversation

cvsserver bug

PATCH In review Daniel Barkalow 4 participants 9 messages Jun 15, 2016

lore
Share & tools
lore
#0 lore raw

It seems like git-cvsserver doesn't know the CVS special case that, if the client has removed the file from the working directory (but not called "cvs remove"), this means to revert it to the server's version. I think that the condition around line 843 needs to exclude this case, and it needs to get to line 892 instead, but I can't even fake perl to fix it.

-Daniel
*This .sig left intentionally blank*

#1 lore raw

PATCH 1/1 cvsserver: Fix handling of diappeared files on update

Only send a modified response if the client sent a "Modified" entry. This fixes the case where the file was locally deleted on the client without being removed from CVS. In this case the client will only have sent the Entry for the file but nothing else.

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

We really, really need a test suite for cvsserver... I've tested this as good for regressions as I could think of but am still unsure about it.

git-cvsserver.perl +1 -0
index 68aa752..25816c5 100755
@@ -843,6 +843,7 @@ sub req_update
         if ( defined ( $wrev )
              and defined($meta->{revision})
              and $wrev == $meta->{revision}
+             and defined($state->{entries}{$filename}{modified_hash})
              and not exists ( $state->{opt}{C} ) )
         {
             $log->info("Tell the client the file is modified");
Signature · 1 line
1.5.1
#2 lore raw

Re: [PATCH] cvsserver: Fix handling of diappeared files on update

Quoted 8 lines · Frank Lichtenheld

Only send a modified response if the client sent a "Modified" entry. This fixes the case where the file was locally deleted on the client without being removed from CVS. In this case the client will only have sent the Entry for the file but nothing else.

Ack. With this, git-cvsserver matches cvs's behaviour. The only difference is that cvs also spits out

E cvs update: warning: $path was lost

cheers,

martin

Signature · 6 lines
-----------------------------------------------------------------------
Martin @ Catalyst .Net .NZ  Ltd, PO Box 11-053, Manners St,  Wellington
WEB: http://catalyst.net.nz/           PHYS: Level 2, 150-154 Willis St
OFFICE: +64(4)916-7224  UK: 0845 868 5733 ext 7224  MOB: +64(21)364-017
      Make things as simple as possible, but no simpler - Einstein
-----------------------------------------------------------------------
#3 lore raw

Re: [PATCH] cvsserver: Fix handling of diappeared files on update

Quoted 8 lines · Martin Langhoff
Quoted 7 lines · Frank Lichtenheld

Only send a modified response if the client sent a "Modified" entry. This fixes the case where the file was locally deleted on the client without being removed from CVS. In this case the client will only have sent the Entry for the file but nothing else.

Quoted 6 lines
Quoted 1 line

Ack. With this, git-cvsserver matches cvs's behaviour. The only difference is that cvs also spits out

E cvs update: warning: $path was lost

My cvs client says:

cvs update: warning: $path unexpectedly disappeared

I'm not sure if something suitable is generated client-side in general, but mine seems to.

-Daniel
*This .sig left intentionally blank*

#4 lore raw

Re: [PATCH] cvsserver: Fix handling of diappeared files on update

In reply to Frank Lichtenheld
Quoted 30 lines · Frank Lichtenheld

Only send a modified response if the client sent a "Modified" entry. This fixes the case where the file was locally deleted on the client without being removed from CVS. In this case the client will only have sent the Entry for the file but nothing else.

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

We really, really need a test suite for cvsserver... I've tested this as good for regressions as I could think of but am still unsure about it.

git-cvsserver.perl +1 -0
index 68aa752..25816c5 100755
@@ -843,6 +843,7 @@ sub req_update
         if ( defined ( $wrev )
              and defined($meta->{revision})
              and $wrev == $meta->{revision}
+             and defined($state->{entries}{$filename}{modified_hash})
              and not exists ( $state->{opt}{C} ) )
         {
             $log->info("Tell the client the file is modified");
Signature · 1 line
1.5.1

This would make the modified response go away, but would it cause a fresh re-checkout to happen?

#5 lore raw

Re: [PATCH] cvsserver: Fix handling of diappeared files on update

Quoted 2 lines · Junio C Hamano

This would make the modified response go away, but would it cause a fresh re-checkout to happen?

Yeah, the rest of the code handles this case correctly if it actually gets the chance to do so.

Gruesse,

Signature · 2 lines
Frank Lichtenheld <[email protected]>
www: http://www.djpig.de/
#6 lore raw

Re: [PATCH] cvsserver: Fix handling of diappeared files on update

In reply to Junio C Hamano
Quoted 27 lines · Junio C Hamano
Quoted 25 lines · Frank Lichtenheld

Only send a modified response if the client sent a "Modified" entry. This fixes the case where the file was locally deleted on the client without being removed from CVS. In this case the client will only have sent the Entry for the file but nothing else.

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

We really, really need a test suite for cvsserver... I've tested this as good for regressions as I could think of but am still unsure about it.

git-cvsserver.perl +1 -0
index 68aa752..25816c5 100755
@@ -843,6 +843,7 @@ sub req_update
         if ( defined ( $wrev )
              and defined($meta->{revision})
              and $wrev == $meta->{revision}
+             and defined($state->{entries}{$filename}{modified_hash})
Quoted 8 lines
Quoted 5 lines
git-cvsserver.perl +0 -0
              and not exists ( $state->{opt}{C} ) )
         {
             $log->info("Tell the client the file is modified");
Signature · 1 line
1.5.1

This would make the modified response go away, but would it cause a fresh re-checkout to happen?

It falls through into the appropriate case, evidently. At least, it seems to resolve my issue.

-Daniel
*This .sig left intentionally blank*

#8 lore raw
In reply to Daniel Barkalow
Quoted 5 lines · Daniel Barkalow

It seems like git-cvsserver doesn't know the CVS special case that, if the client has removed the file from the working directory (but not called "cvs remove"), this means to revert it to the server's version. I think that the condition around line 843 needs to exclude this case, and it needs to get to line 892 instead, but I can't even fake perl to fix it.

I can confirm the bug. Will look into it a bit and see whether I can come up with a fix.

Gruesse,

Signature · 2 lines
Frank Lichtenheld <[email protected]>
www: http://www.djpig.de/