From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Paul Eggert Newsgroups: gmane.emacs.devel Subject: preferring https: to http: in commit messages for gnu.org Date: Sun, 15 Oct 2017 00:14:04 -0700 Organization: UCLA Computer Science Department Message-ID: <61bfc72e-b21f-3fb9-25b7-b718bb69d85b@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="------------AEC1E5694BEAECED648D5DC5" X-Trace: blaine.gmane.org 1508051705 1251 195.159.176.226 (15 Oct 2017 07:15:05 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Sun, 15 Oct 2017 07:15:05 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.4.0 To: Emacs Development Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Sun Oct 15 09:14:59 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e3d8M-0006yR-O8 for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2017 09:14:50 +0200 Original-Received: from localhost ([::1]:56351 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3d8U-0004iJ-0B for ged-emacs-devel@m.gmane.org; Sun, 15 Oct 2017 03:14:58 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50638) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e3d7m-0004i2-03 for Emacs-devel@gnu.org; Sun, 15 Oct 2017 03:14:14 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e3d7h-0003aq-0A for Emacs-devel@gnu.org; Sun, 15 Oct 2017 03:14:13 -0400 Original-Received: from zimbra.cs.ucla.edu ([131.179.128.68]:35204) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1e3d7g-0003ae-MF for Emacs-devel@gnu.org; Sun, 15 Oct 2017 03:14:08 -0400 Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id E83E216015F for ; Sun, 15 Oct 2017 00:14:06 -0700 (PDT) Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id F239yFySy37Q for ; Sun, 15 Oct 2017 00:14:05 -0700 (PDT) Original-Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 8AEF8160E58 for ; Sun, 15 Oct 2017 00:14:05 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Original-Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id 02_Fs-cQcGGK for ; Sun, 15 Oct 2017 00:14:05 -0700 (PDT) Original-Received: from [192.168.1.9] (unknown [47.154.18.85]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 591CB16015F for ; Sun, 15 Oct 2017 00:14:05 -0700 (PDT) Content-Language: en-US X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [fuzzy] X-Received-From: 131.179.128.68 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:219542 Archived-At: This is a multi-part message in MIME format. --------------AEC1E5694BEAECED648D5DC5 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: quoted-printable I installed the attached into the default Git commit hooks to help remind= us=20 (and particularly to remind me, since I write a fair number of these thin= gs)=20 that https: should be preferred to http: in commit-message URLs that poin= t to=20 gnu.org or fsf.org web sites. --------------AEC1E5694BEAECED648D5DC5 Content-Type: text/x-patch; name="0001-Encourage-https-in-commit-messages.patch" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="0001-Encourage-https-in-commit-messages.patch" =46rom 3c78960a4755d7bd583a0411d7089a0c13c0c64b Mon Sep 17 00:00:00 2001 From: Paul Eggert Date: Sat, 14 Oct 2017 19:16:12 -0700 Subject: [PATCH] Encourage https: in commit messages * CONTRIBUTE: Prefer https: when citing. * build-aux/git-hooks/commit-msg: Diagnose http: and ftp: URLs to FSF or GNU hosts. --- CONTRIBUTE | 3 +++ build-aux/git-hooks/commit-msg | 10 ++++++++++ 2 files changed, 13 insertions(+) diff --git a/CONTRIBUTE b/CONTRIBUTE index 8995bb3..c7f3330 100644 --- a/CONTRIBUTE +++ b/CONTRIBUTE @@ -175,6 +175,9 @@ them right the first time, so here are guidelines for= formatting them: bug number NNNNN in the debbugs database. This string is often parenthesized, as in "(Bug#19003)". =20 +- When citing URLs, prefer https: to http: when either will do. In + particular, gnu.org and fsf.org URLs should start with "https:". + - Commit messages should contain only printable UTF-8 characters. =20 - Commit messages should not contain the "Signed-off-by:" lines that diff --git a/build-aux/git-hooks/commit-msg b/build-aux/git-hooks/commit-= msg index 3945086..e21aaf0 100755 --- a/build-aux/git-hooks/commit-msg +++ b/build-aux/git-hooks/commit-msg @@ -66,6 +66,8 @@ at_sign=3D non_print =3D "[^[:print:]]" } } + c_lower =3D "abcdefghijklmnopqrstuvwxyz" + unsafe_gnu_url =3D "(http|ftp)://([" c_lower ".]*\\.)?(gnu|fsf)\\.or= g" } =20 /^#/ { @@ -125,6 +127,14 @@ at_sign=3D status =3D 1 } =20 + { + if (match($0, unsafe_gnu_url)) { + url =3D substr($0, RSTART, RLENGTH) + printf "Use https: URL instead of '\''%s'\'' in commit message\n",= url + status =3D 1 + } + } + $0 ~ non_print { print "Unprintable character in commit message" status =3D 1 --=20 2.7.4 --------------AEC1E5694BEAECED648D5DC5--