Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqwxn-0002wK-SE for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 14:14:43 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1pqwxm-0007cd-OH for pgsql-hackers@arkaria.postgresql.org; Mon, 24 Apr 2023 14:14:42 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1pqwxm-0007cT-Eo for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 14:14:42 +0000 Received: from relay8-d.mail.gandi.net ([217.70.183.201]) by magus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1pqwxj-004oDs-Gy for pgsql-hackers@lists.postgresql.org; Mon, 24 Apr 2023 14:14:41 +0000 Received: (Authenticated sender: adsend@dunslane.net) by mail.gandi.net (Postfix) with ESMTPSA id 2A48A1BF20D; Mon, 24 Apr 2023 14:14:35 +0000 (UTC) Content-Type: multipart/alternative; boundary="------------8Wpt5KyKmPcS02aTA0UCHgtp" Message-ID: <0abceb57-f194-4aad-d320-76b4c2cb7008@dunslane.net> Date: Mon, 24 Apr 2023 10:14:34 -0400 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.5.0 Subject: Re: Add missing copyright for pg_upgrade/t/* files Content-Language: en-US To: "Hayato Kuroda (Fujitsu)" , 'David Zhang' Cc: PostgreSQL Hackers , 'Amit Kapila' References: <7cf1745e-9bc7-b4ac-eac0-e0cf486de584@highgo.ca> From: Andrew Dunstan In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk This is a multi-part message in MIME format. --------------8Wpt5KyKmPcS02aTA0UCHgtp Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit 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 --------------8Wpt5KyKmPcS02aTA0UCHgtp Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 7bit


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
--------------8Wpt5KyKmPcS02aTA0UCHgtp--