Re: .cvsignore file

From: Rod Taylor <rbt(at)rbt(dot)ca>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: PostgreSQL Patches <pgsql-patches(at)postgresql(dot)org>
Subject: Re: .cvsignore file
Date: 2002-10-12 14:57:39
Message-ID: 1034434660.6674.110.camel@jester
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-patches

On Sat, 2002-10-12 at 00:56, Tom Lane wrote:
> Rod Taylor <rbt(at)rbt(dot)ca> writes:
> > On Fri, 2002-10-11 at 00:22, Tom Lane wrote:
> >> This strikes me as a bad idea. We use .cvsignore only for files that
> >> should survive "make distclean", which the built docs files surely
> >> shouldn't.
>
> > Why not ignore the set of compiled files as well? I realize its a much
> > larger list, but seems a fairly common thing to do.
>
> Well, exactly, it's a much larger list, and hence a much larger
> maintenance effort. If it were near-zero cost to maintain then
> I'd be okay with it ... but right now, it seems most reasonable
> to expect people to do "make distclean" before they try a "cvs diff".
>
> In practice, you have to be mighty savvy to do "cvs update"s without a
> "make distclean" beforehand --- I don't ever risk it myself; the extra
> machine cycles for a full rebuild are way cheaper than my time to debug
> an incomplete rebuild. So I have little concern for the "cvs diff"
> case.

Yes, before updating you definitely want to do that, but it usually
takes me a few tries to undo parts where I've gone wrong. So diffs
regularly happen along the way.

Anyway, don't maintain by hand

The below should make .cvsignore entries for most files. I can test it,
and clean it up to be put under src/tools if wanted if this method is
ok. No, it's not perfect but running it shortly before or after a
pgindent run would cover 90% of the cases.

#!/bin/sh
# Run from PGSQL directory
./configure
find * -name .cvsignore -delete
make all check
cd doc/src && make all && cd ..
cvs diff 2>&1 | perl -e '
while ($line = <STDIN>)
{
chomp($line);
if ($line =~ /^\?\s.*\/.*/)
{
$line =~ s/^\?\s(.*\/)([^\/]+)$/echo \"$2\" >> $1.cvsignore\n/;
print $line;
} elsif ($line =~ /^\?\s/)
{
$line =~ s/^\?\s([^\/]+)$/echo \"$1\" >> .cvsignore\n/;
print $line;
}
}' | sh

--
Rod Taylor

In response to

Responses

Browse pgsql-patches by date

  From Date Subject
Next Message Tom Lane 2002-10-12 15:46:58 Re: .cvsignore file
Previous Message Bruce Momjian 2002-10-12 14:45:47 Re: Catalogs Doc update