public inbox for [email protected]  
help / color / mirror / Atom feed
From: Andrew Dunstan <[email protected]>
To: Hayato Kuroda (Fujitsu) <[email protected]>
To: 'David Zhang' <[email protected]>
Cc: PostgreSQL Hackers <[email protected]>
Cc: 'Amit Kapila' <[email protected]>
Subject: Re: Add missing copyright for pg_upgrade/t/* files
Date: Mon, 24 Apr 2023 10:14:34 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <TYAPR01MB5866D4DB7AB7BCC3CA873BAAF5679@TYAPR01MB5866.jpnprd01.prod.outlook.com>
References: <TYCPR01MB587073D91E372B8EF719931EF5929@TYCPR01MB5870.jpnprd01.prod.outlook.com>
	<CAA4eK1+grdj4Br7sGGs=8JO81k94iPWzuEn3WUmtf6SFQWDW-Q@mail.gmail.com>
	<TYAPR01MB5866C9F80BF0C497D017AD83F5939@TYAPR01MB5866.jpnprd01.prod.outlook.com>
	<[email protected]>
	<TYAPR01MB5866D4DB7AB7BCC3CA873BAAF5679@TYAPR01MB5866.jpnprd01.prod.outlook.com>


On 2023-04-24 Mo 03:08, Hayato Kuroda (Fujitsu) wrote:
> Dear David,
>
>> It is great to make sure each file has the Copyright and I see this
>> patch has already been committed.
> Thanks!
> While checking more, I was surprised because I found many files which do not
> have Copyright via " grep -Lr Copyright --exclude-dir .git ..." command.
> I'm not sure whether it is expected, but all sql files in src/test/regress/sql and
> many files in contrib do not have. Do you know something about it?
>
>> Just curious, is there a rule to add Copyright to Postgres?
> Sorry, I'm not sure about it. Before submitting a patch I have checked the
> manual that "PostgreSQL Coding Conventions", but I could not find any.
>
>> For example,
>> if I run a command `grep -rn Copyright --include="*.pl" | awk -F ':'
>> {'print $2, $1'} | sort -nr` inside postgres/src/bin, It seems most
>> Copyright were added to the second line, but these two were added to the
>> very beginning (of course, there are three other files following this
>> pattern as well).
> There seems a tendency that Copyright for recently added files have added it to
> the very beginning, but I can suspect from the result that there are no specific
> rules about it.
>
> ```
> $ grep -rn Copyright --include="*.pl" | awk -F ':' {'print $2'} | sort -nr | uniq -c
>        1 753
>        1 752
>        1 717
> ...
>       22 3
>      158 2
>       24 1
> ```


I suspect many of those came from the last time I did this, at commit 
8fa6e6919c.

IIRC I added "\nCopyright...\n\n" at line 1 unless that was a "#!" line, 
in which case I added it after line 1 (it was done via a sed script IIRC)

I think since then perltidy has dissolved some of the extra blank lines 
added at the end.

I don't think we actually have a rule about it, but the pattern I 
described doesn't seem unreasonable.


cheers


andrew

--
Andrew Dunstan
EDB:https://www.enterprisedb.com


view thread (2+ messages)  latest in thread

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected], [email protected], [email protected]
  Subject: Re: Add missing copyright for pg_upgrade/t/* files
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox