FW: [cvsnt] Latest updates - cvsnt 2.5.01 build 1997 (-I @ snafu)

David Somers dsomers at trevezel.com
Tue Jun 14 10:19:34 BST 2005


An update... whilst waiting for my morning coffee to brew, I was strolling
through src/import.c once more...

To ensure that -I @ really does ignore everything under the sun, I think
that the following should be applied:

change line 514 of src/import.c:
if (ign_name (dp->d_name))
to read
if (ignore_cvsignore==0 && ign_name (dp->d_name))

So if the file is matched in the ignore list, its only ignored when
ignore_cvsignore is clear (which is the default behaviour)

I guess ignore_cvsignore should really be called ignore_bypass (since that
is effectively what its being used to flag: that we want to bypass all and
any ignore handling).

(If you do this change, then I think point #2 below doesn't apply, but its
probably best to take a belt-and-braces approach and do both).

Greetings from Luxembourg,

David

-----Original Message-----
From: David Somers [mailto:dsomers at trevezel.com]
Sent: Tuesday, 14 June, 2005 10:22
To: Tony Hoyle; cvsnt at cvsnt.org
Subject: RE: [cvsnt] Latest updates - cvsnt 2.5.01 build 1997


> #33     Add a way for import to ignore .cvsignore files

Great.

But methinks there are two minor bloopers in src/import.c:

1. ignore_cvsignore should be explicitly set to false at the start of
import()... otherwise there is the danger that you are working with an
uninitialized variable... or worse still, once set, its never reset!

2. When -I @ is specified, you no longer call ign_add( "!", 0)... but isn't
that necessary otherwise the default internal cvsignore list is used? (Its
hard to tell as that code in ignore is indeed a bit hairy.)

So:

case 'I':
	if(!strcmp(optarg,"@"))
		ignore_cvsignore = 1;
	else
		ign_add (optarg, 0);
	break;

should be more like
case 'I':
	if(!strcmp(optarg,"@"))
	{
		ign_add ("!", 0);
		ignore_cvsignore = 1;
	}
	else
		ign_add (optarg, 0);
	break;

Cheers,

David.







More information about the cvsnt mailing list