From owner-svn-src-head@freebsd.org Tue Dec 29 01:26:54 2020 Return-Path: Delivered-To: svn-src-head@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 EA30D4C9F42; Tue, 29 Dec 2020 01:26:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: from mail-ot1-f53.google.com (mail-ot1-f53.google.com [209.85.210.53]) (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 4D4cG66CYrz51qn; Tue, 29 Dec 2020 01:26:54 +0000 (UTC) (envelope-from asomers@gmail.com) Received: by mail-ot1-f53.google.com with SMTP id d20so10727915otl.3; Mon, 28 Dec 2020 17:26:54 -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=KRhoFPv418Dq2ZypxRy453JggVlwl/1Y0xbto0x2Jb0=; b=bEZacgbyI4jPrA/nEqNkdWlVgs45wvkgWGlteVCn3oQZLyGCZ9ltB8e12oDM7tDUch 5kWlz2oVqwIYJ7UdcF6BKCkBsqxAtnKnJZ2krQVxb9rueERutiOx9VF6KV4tAJFSQF/j UxG44s8xPORgY1TXn24rdUsFgzkNRsIhrDfXM5nmDAp9CcECn+6Qsp2rqUFRGZ3ZSBkx wOWJ5hd6oXqwG4s0cEeuyOiS/trgQ5fjTLapD95FdblsM1oyQwFoTf5RsLiTieAFC7w6 MCw/tqqmYxzeHazUE7qzN3pPqPYuuuFrq+GdKCWf1iD6BzOdaaGhxCJ5Brej+8c2IUL6 7AjQ== X-Gm-Message-State: AOAM531LdtZIDz4xLzUlQTTwYZKclkQu19YtkIlZgMU9OrNPL7NydROj GOPFD1d875NMoGjCKeiuQAkDtWUTocjWtXzylHWZh0005+U= X-Google-Smtp-Source: ABdhPJzSsO+npwt1rP0rTv9oCa2NJ1Z04fDELzlL2IWuIcafw8HbY461aqnj/dUDQhcL1NnaVrn8/PAWKiNEY0da+1Y= X-Received: by 2002:a9d:a61:: with SMTP id 88mr32911493otg.18.1609205213717; Mon, 28 Dec 2020 17:26:53 -0800 (PST) MIME-Version: 1.0 References: <202012171958.0BHJwT9X079850@repo.freebsd.org> In-Reply-To: From: Alan Somers Date: Mon, 28 Dec 2020 18:26:42 -0700 Message-ID: Subject: Re: svn commit: r368736 - head/tools/tools/git/hooks To: Ed Maste Cc: Alan Somers , src-committers , svn-src-all , svn-src-head X-Rspamd-Queue-Id: 4D4cG66CYrz51qn X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.34 X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 29 Dec 2020 01:26:55 -0000 On Mon, Dec 28, 2020 at 3:29 PM Ed Maste wrote: > On Mon, 28 Dec 2020 at 14:34, Alan Somers wrote: > > > > On Thu, Dec 17, 2020 at 12:58 PM Ed Maste wrote: > >> > >> Author: emaste > >> Date: Thu Dec 17 19:58:29 2020 > >> New Revision: 368736 > >> URL: https://svnweb.freebsd.org/changeset/base/368736 > >> > >> Log: > >> Add initial version of git commit message preparation hook > >> > > Thanks! But how can we use it? Is there a "git config" incantation > that will use this file? > > Just copy it into .git/hooks/. Can also fetch the latest version > directly from cgit; lwhsu added this to > https://github.com/bsdimp/freebsd-git-docs/blob/main/URLs.md: > > fetch > https://cgit.freebsd.org/src/plain/tools/tools/git/hooks/prepare-commit-msg > -o > > .git/hooks > chmod 755 .git/hooks/prepare-commit-msg > > I'd like us to end up with a setup-repo.sh or such that will offer to > take care of all of these things. > > >Also, this seems too complicated. Git already has a "config.template" > configuration variable. Could we just use that instead, or does it not > work for some reason? > > It does work, although it's a bit awkward. For one thing, the provided > template is placed at the top of the message, followed by the default > message, but our addition is really commented-out information and fits > best in the middle of the existing text - after the "Please enter > the..." and before the list of changes and such. With config.template > we'd end up with something like: > > ==== > > # PR: > # ... > # Differential Revision: > # > # Please enter the commit message for your changes. Lines starting > # with '#' will be ignored, and an empty message aborts the commit. > # > # ... > ==== > > Additionally we might want to make some more programmatic changes in > the default message (depending on the resolution of some open > questions). For example we could strip the "MFC after" line that's > copied from the original commit, when preparing the commit message for > a MFC/cherry-pick. > Thanks for the explanation. It all makes sense, and the commit template works.