From owner-dev-commits-src-main@freebsd.org Wed Dec 30 23:24:04 2020 Return-Path: Delivered-To: dev-commits-src-main@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id 5B8F84D2C7D; Wed, 30 Dec 2020 23:24:04 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: from mail-ej1-f51.google.com (mail-ej1-f51.google.com [209.85.218.51]) (using TLSv1.3 with cipher TLS_AES_128_GCM_SHA256 (128/128 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "smtp.gmail.com", Issuer "GTS CA 1O1" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4D5nRS1xZqz4rxX; Wed, 30 Dec 2020 23:24:03 +0000 (UTC) (envelope-from arichardson.kde@gmail.com) Received: by mail-ej1-f51.google.com with SMTP id g20so23709249ejb.1; Wed, 30 Dec 2020 15:24:03 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=byGWGKOZyWkZ4fNcttsUy6j26yJETsmKvY9UqmrnAhI=; b=IhSbWbfmlZVPfjA1WPXoXWVkwJViLdyvxZ5HdZBlaXTZUeFJJ/1EiO9IOjaPpwMmO0 mz9ZFNv3VbZXob3sHQtvIcbQ837l7lybohbHzScpNuhxFWguvrd/eF6CysT5C8FUP/Y0 F3RPHp6vNhnj9HFOJNZ/IS/y76HZa3qRGcc5neKTGVvfD/MvFxORwsfUjVIoeYUAPnrA ZmB3HkY35riD/f8Li9ILe0ljkRZn7WtTCyQ36qYKOaeWcyS19D1MultZZLNPTbI3ngXG RJkVKhBIAWtGVdJBumeUzeKn0rO2vhplmJtK2FPy0M1sdGjyf1EdXROWYoPMYFeSiw09 EXbw== X-Gm-Message-State: AOAM5301S45YgEfUNet/RG4Fw0DqSdAscfC4yGR2D7drQGmq+uLAIbzV 8RusoRYS5v4wwKmSX++V798XG97tbY3MOw== X-Google-Smtp-Source: ABdhPJwiHQevAO95yd83uv5UX0nDZNMj9PC7FxAn8xO6Yfwla9f8W1lso1m0iORqoi/2YJhOKccAwQ== X-Received: by 2002:a17:906:fa8b:: with SMTP id lt11mr51179402ejb.94.1609370641323; Wed, 30 Dec 2020 15:24:01 -0800 (PST) Received: from mail-wr1-f54.google.com (mail-wr1-f54.google.com. [209.85.221.54]) by smtp.gmail.com with ESMTPSA id j9sm38537082eds.66.2020.12.30.15.24.00 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Wed, 30 Dec 2020 15:24:01 -0800 (PST) Received: by mail-wr1-f54.google.com with SMTP id q18so18838565wrn.1; Wed, 30 Dec 2020 15:24:00 -0800 (PST) X-Received: by 2002:a5d:6ccb:: with SMTP id c11mr62269254wrc.224.1609370640729; Wed, 30 Dec 2020 15:24:00 -0800 (PST) MIME-Version: 1.0 References: <202012301733.0BUHXUka053609@gitrepo.freebsd.org> In-Reply-To: <202012301733.0BUHXUka053609@gitrepo.freebsd.org> From: Alexander Richardson Date: Thu, 31 Dec 2020 00:23:49 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: git: b67e44075539 - main - Add comment explaining Git commit message hook To: Ed Maste Cc: src-committers , dev-commits-src-all@freebsd.org, dev-commits-src-main@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D5nRS1xZqz4rxX X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[]; TAGGED_FROM(0.00)[] X-BeenThere: dev-commits-src-main@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: "Commit messages for the main branch of the src repository." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 30 Dec 2020 23:24:04 -0000 On Wed, 30 Dec 2020 at 18:33, Ed Maste wrote: > > The branch main has been updated by emaste: > > URL: https://cgit.FreeBSD.org/src/commit/?id=b67e440755391b4a75363173ca16e170ccbf0394 > > commit b67e440755391b4a75363173ca16e170ccbf0394 > Author: Ed Maste > AuthorDate: 2020-12-30 17:31:29 +0000 > Commit: Ed Maste > CommitDate: 2020-12-30 17:33:19 +0000 > > Add comment explaining Git commit message hook > > Suggested by: jhb > --- > tools/tools/git/hooks/prepare-commit-msg | 10 ++++++++++ > 1 file changed, 10 insertions(+) > > diff --git a/tools/tools/git/hooks/prepare-commit-msg b/tools/tools/git/hooks/prepare-commit-msg > index 9dcb85cd1a3f..e453b73cc45d 100755 > --- a/tools/tools/git/hooks/prepare-commit-msg > +++ b/tools/tools/git/hooks/prepare-commit-msg > @@ -1,5 +1,13 @@ > #!/bin/sh > > +# prepare-commit-msg: Prepare a commit message upon `git commit` for the > +# user to edit. A script (rather than a static template) is used, so > +# that we can insert our template text other than at the top of the > +# message. > +# > +# Install by copying into the git hooks directory - for example, > +# cp tools/tools/git/hooks/prepare-commit-msg .git/hooks/ > + Maybe suggest `ln -s ../../tools/tools/git/hooks/prepare-commit-msg .git/hooks/` to ensure that future updates to the commit template aren't lost? Thanks, Alex > case "$2" in > commit|message) > # It appears git invokes this script for interactive rebase but does > @@ -21,7 +29,9 @@ outfile=$(mktemp /tmp/freebsd-git-commit.XXXXXXXX) > # > # 1. The beginning of the git-provided template (up to the first comment-only > # line) which explains commented lines and such. > +# > # 2. Our template. > +# > # 3. The remainder of the git-provided template (from the first comment-only > # line to the end of the file) which lists files staged for commit, files > # not staged, and untracked files.