pgsql: Fix Perl copyright script to skip .git subdirectory; running it

Started by Bruce Momjianover 14 years ago6 messagescomitters
Jump to latest
#1Bruce Momjian
bruce@momjian.us

Fix Perl copyright script to skip .git subdirectory; running it on
those files corrupts the index.

Branch
------
master

Details
-------
http://git.postgresql.org/pg/commitdiff/9f60880207c6c7d00a2e4e4d904ef720de58f45b

Modified Files
--------------
src/tools/copyright.pl | 9 ++++++++-
1 files changed, 8 insertions(+), 1 deletions(-)

#2Andrew Dunstan
andrew@dunslane.net
In reply to: Bruce Momjian (#1)
Re: pgsql: Fix Perl copyright script to skip .git subdirectory; running it

On 01/01/2012 05:59 PM, Bruce Momjian wrote:

Fix Perl copyright script to skip .git subdirectory; running it on
those files corrupts the index.

This patch looks a bit dubious. Instead of:

if ($File::Find::name =~ m{^\./\.git$})

I'd use:

if ($_ eq '.git')

cheers

andrew

#3Bruce Momjian
bruce@momjian.us
In reply to: Andrew Dunstan (#2)
Re: pgsql: Fix Perl copyright script to skip .git subdirectory; running it

On Sun, Jan 01, 2012 at 07:05:24PM -0500, Andrew Dunstan wrote:

On 01/01/2012 05:59 PM, Bruce Momjian wrote:

Fix Perl copyright script to skip .git subdirectory; running it on
those files corrupts the index.

This patch looks a bit dubious. Instead of:

if ($File::Find::name =~ m{^\./\.git$})

I'd use:

if ($_ eq '.git')

The question was whether we wanted to skip non-top-of-tree .git
directories. I wasn't sure we wanted to do that. Do we?

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#4Tom Lane
tgl@sss.pgh.pa.us
In reply to: Bruce Momjian (#3)
Re: pgsql: Fix Perl copyright script to skip .git subdirectory; running it

Bruce Momjian <bruce@momjian.us> writes:

On Sun, Jan 01, 2012 at 07:05:24PM -0500, Andrew Dunstan wrote:

I'd use:
if ($_ eq '.git')

The question was whether we wanted to skip non-top-of-tree .git
directories. I wasn't sure we wanted to do that. Do we?

I'd think it'd be reasonable to do so. It's not likely that this
script would be run from a point higher than the git root, but if
it were, you'd still need to skip the git index.

regards, tom lane

#5Bruce Momjian
bruce@momjian.us
In reply to: Bruce Momjian (#3)
Re: pgsql: Fix Perl copyright script to skip .git subdirectory; running it

On Sun, Jan 01, 2012 at 07:24:40PM -0500, Bruce Momjian wrote:

On Sun, Jan 01, 2012 at 07:05:24PM -0500, Andrew Dunstan wrote:

On 01/01/2012 05:59 PM, Bruce Momjian wrote:

Fix Perl copyright script to skip .git subdirectory; running it on
those files corrupts the index.

This patch looks a bit dubious. Instead of:

if ($File::Find::name =~ m{^\./\.git$})

I'd use:

if ($_ eq '.git')

The question was whether we wanted to skip non-top-of-tree .git
directories. I wasn't sure we wanted to do that. Do we?

Thanks, done.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +

#6Bruce Momjian
bruce@momjian.us
In reply to: Tom Lane (#4)
Re: pgsql: Fix Perl copyright script to skip .git subdirectory; running it

On Sun, Jan 01, 2012 at 07:41:46PM -0500, Tom Lane wrote:

Bruce Momjian <bruce@momjian.us> writes:

On Sun, Jan 01, 2012 at 07:05:24PM -0500, Andrew Dunstan wrote:

I'd use:
if ($_ eq '.git')

The question was whether we wanted to skip non-top-of-tree .git
directories. I wasn't sure we wanted to do that. Do we?

I'd think it'd be reasonable to do so. It's not likely that this
script would be run from a point higher than the git root, but if
it were, you'd still need to skip the git index.

Thanks, done.

--
Bruce Momjian <bruce@momjian.us> http://momjian.us
EnterpriseDB http://enterprisedb.com

+ It's impossible for everything to be true. +