Обсуждение: pgsql: Fix Perl copyright script to skip .git subdirectory; running it
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(-)
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
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. +
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
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. +
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. +