* [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
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-19 10:49 [PATCH] New files in git weren't being downloaded during CVS update Andy Parkins
@ 2007-01-20 1:19 ` Simon 'corecode' Schubert
2007-01-20 10:25 ` Andy Parkins
0 siblings, 1 reply; 12+ messages in thread
From: Simon 'corecode' Schubert @ 2007-01-20 1:19 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 852 bytes --]
Andy Parkins wrote:
> 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 / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-20 1:19 ` Simon 'corecode' Schubert
@ 2007-01-20 10:25 ` Andy Parkins
2007-01-20 10:41 ` Simon 'corecode' Schubert
0 siblings, 1 reply; 12+ messages in thread
From: Andy Parkins @ 2007-01-20 10:25 UTC (permalink / raw)
To: git
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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-20 10:25 ` Andy Parkins
@ 2007-01-20 10:41 ` Simon 'corecode' Schubert
0 siblings, 0 replies; 12+ messages in thread
From: Simon 'corecode' Schubert @ 2007-01-20 10:41 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 867 bytes --]
Andy Parkins wrote:
> 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 / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [flat|nested] 12+ messages in thread
* [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
* Re: [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 7:02 ` Martin Langhoff
2007-01-22 10:44 ` Andy Parkins
1 sibling, 1 reply; 12+ messages in thread
From: Junio C Hamano @ 2007-01-22 2:35 UTC (permalink / raw)
To: Martin Langhoff; +Cc: git, Andy Parkins
Andy Parkins <andyparkins@gmail.com> 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 <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.
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.
> 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 [flat|nested] 12+ messages in thread
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-22 2:35 ` Junio C Hamano
@ 2007-01-22 7:02 ` Martin Langhoff
2007-01-22 7:16 ` Junio C Hamano
0 siblings, 1 reply; 12+ messages in thread
From: Martin Langhoff @ 2007-01-22 7:02 UTC (permalink / raw)
To: Junio C Hamano; +Cc: git, Andy Parkins
On 1/22/07, Junio C Hamano <junkio@cox.net> wrote:
> > 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
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-22 7:02 ` Martin Langhoff
@ 2007-01-22 7:16 ` Junio C Hamano
0 siblings, 0 replies; 12+ messages in thread
From: Junio C Hamano @ 2007-01-22 7:16 UTC (permalink / raw)
To: Martin Langhoff; +Cc: Junio C Hamano, git, Andy Parkins
"Martin Langhoff" <martin.langhoff@gmail.com> writes:
>> 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
Yes, that's what I did (what I meant was I can test with cvs as
client but not other clients that talk CVS remote protocols).
>> 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.
Thanks.
^ permalink raw reply [flat|nested] 12+ messages in thread
* Re: [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
2007-01-22 10:46 ` Andy Parkins
2007-01-22 10:56 ` Andy Parkins
1 sibling, 2 replies; 12+ messages in thread
From: Andy Parkins @ 2007-01-22 10:44 UTC (permalink / raw)
To: git
On Sunday 2007 January 21 14:25, Andy Parkins wrote:
> 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.
I'm still concerned that this fix is not right. Having thought more about it,
I suspect that this breaks the other "added-file" case, where the file is
added locally but not remotely.
There are three key cases:
1. File present locally and remotely. Modified remotely. Response "U"
2. File present locally only. Response should be "A"
3. File present remotely only. Response should be "U"
I think the real problem is that both 2 and 3 are being handled in the same
place. Hence, my patch, which has fixed case 3; will have broken case 2.
I need a bit of confirmation from Martin; but I suspect that the correct fix
is something like this:
elsif ( (!defined($wrev) || $wrev == 0) && !defined($meta->{revision})
{
$log->info("Tell the client the file will be added");
If I'm correct, this would only run the added section when there is no
matching revision in the repository - this would be case 2. Then case 3
would be handled as the else to this if, which handles every other case.
My testing of this works, but I'd like confirmation that I'm right in this
thinking? Patch to follow...
Andy
--
Dr Andy Parkins, M Eng (hons), MIEE
andyparkins@gmail.com
^ permalink raw reply [flat|nested] 12+ messages in thread
* [PATCH] New files in git weren't being downloaded during CVS update
2007-01-22 10:44 ` Andy Parkins
@ 2007-01-22 10:46 ` Andy Parkins
2007-01-22 10:56 ` Andy Parkins
1 sibling, 0 replies; 12+ messages in thread
From: Andy Parkins @ 2007-01-22 10:46 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 seems to be that git-cvsserver was treating these two cases
identically, as "A" type results.
1. New file in repository
2. New file locally
In fact, traditionally, case 1 is treated as a "U" result, and case 2
only is treated as an "A" result. "A", should just report that the file
is added locally and then skip that file during an update as their is
(of course) nothing to send.
In both these cases there is no working revision, so the checking for
"is there no working revision" will return true. The test for case 2
needs refining to say "if there is no working revision and no upstream
revision". This patch does just that, leaving case 1 to be handled by
the normal "U" handler.
I've also updated the log message to more accurately describe the
operation. i.e. that "A" means that content is scheduled for addition;
not that it actually has been added.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
git-cvsserver.perl | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index a33a876..2479f71 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -876,9 +876,9 @@ sub req_update
print "MT newline\n";
next;
}
- elsif ( !defined($wrev) || $wrev == 0 )
+ elsif ( (!defined($wrev) || $wrev == 0) && (!defined($meta->{revision}) || $meta->{revision} == 0) )
{
- $log->info("Tell the client the file will be added");
+ $log->info("Tell the client the file is scheduled for addition");
print "MT text A \n";
print "MT fname $filename\n";
print "MT newline\n";
--
1.5.0.rc2.g3f8f2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* [PATCH] New files in git weren't being downloaded during CVS update
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
1 sibling, 1 reply; 12+ messages in thread
From: Andy Parkins @ 2007-01-22 10:56 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 seems to be that git-cvsserver was treating these two cases
identically, as "A" type results.
1. New file in repository
2. New file locally
In fact, traditionally, case 1 is treated as a "U" result, and case 2
only is treated as an "A" result. "A", should just report that the file
is added locally and then skip that file during an update as there is
(of course) nothing to send.
In both these cases there is no working revision, so the checking for
"is there no working revision" will return true. The test for case 2
needs refining to say "if there is no working revision and no upstream
revision". This patch does just that, leaving case 1 to be handled by
the normal "U" handler.
I've also updated the log message to more accurately describe the
operation. i.e. that "A" means that content is scheduled for addition;
not that it actually has been added.
Signed-off-by: Andy Parkins <andyparkins@gmail.com>
---
Apologies; this one is the real replacement. The previous patch didn't
include the correction to the update log message which would potentially
use an undefined variable when adding new content.
git-cvsserver.perl | 6 +++---
1 files changed, 3 insertions(+), 3 deletions(-)
diff --git a/git-cvsserver.perl b/git-cvsserver.perl
index a33a876..e18e901 100755
--- a/git-cvsserver.perl
+++ b/git-cvsserver.perl
@@ -876,9 +876,9 @@ sub req_update
print "MT newline\n";
next;
}
- elsif ( !defined($wrev) || $wrev == 0 )
+ elsif ( (!defined($wrev) || $wrev == 0) && (!defined($meta->{revision}) || $meta->{revision} == 0) )
{
- $log->info("Tell the client the file will be added");
+ $log->info("Tell the client the file is scheduled for addition");
print "MT text A \n";
print "MT fname $filename\n";
print "MT newline\n";
@@ -886,7 +886,7 @@ sub req_update
}
else {
- $log->info("Updating '$filename' $wrev");
+ $log->info("Updating '$filename' to ".$meta->{revision});
print "MT +updated\n";
print "MT text U \n";
print "MT fname $filename\n";
--
1.5.0.rc2.g3f8f2
^ permalink raw reply related [flat|nested] 12+ messages in thread
* Re: [PATCH] New files in git weren't being downloaded during CVS update
2007-01-22 10:56 ` Andy Parkins
@ 2007-01-22 11:08 ` Simon 'corecode' Schubert
0 siblings, 0 replies; 12+ messages in thread
From: Simon 'corecode' Schubert @ 2007-01-22 11:08 UTC (permalink / raw)
To: Andy Parkins; +Cc: git
[-- Attachment #1: Type: text/plain, Size: 1039 bytes --]
Andy Parkins wrote:
> @@ -876,9 +876,9 @@ sub req_update
> print "MT newline\n";
> next;
> }
> - elsif ( !defined($wrev) || $wrev == 0 )
> + elsif ( (!defined($wrev) || $wrev == 0) && (!defined($meta->{revision}) || $meta->{revision} == 0) )
> {
> - $log->info("Tell the client the file will be added");
> + $log->info("Tell the client the file is scheduled for addition");
This is nice but probably does not handle a collision (cvs output: file was added by a third party) well and will probably overwrite the locally added file. however it is a step in the right direction. from skimming the code I couldn't find collision handling anyways.
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 / \
[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 252 bytes --]
^ permalink raw reply [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-19 10:49 [PATCH] New files in git weren't being downloaded during CVS update 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
-- strict thread matches above, loose matches on Subject: below --
2007-01-21 14:25 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
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).