From owner-svn-src-head@freebsd.org Mon Dec 28 22:29:28 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 EAE424C333F; Mon, 28 Dec 2020 22:29:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: from mail-io1-f48.google.com (mail-io1-f48.google.com [209.85.166.48]) (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 4D4XKN6JWkz4pVJ; Mon, 28 Dec 2020 22:29:28 +0000 (UTC) (envelope-from carpeddiem@gmail.com) Received: by mail-io1-f48.google.com with SMTP id n4so10627219iow.12; Mon, 28 Dec 2020 14:29:28 -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=Qjl7QvscoyDLVTG3rcrV9X3Fk7x0n0bh5vIQV1ZTMos=; b=bgKyjDHvVOl45D8K1o9uK8evdh7EzJGp/5kDwcT6bxF0LVjA4ppV5N252TzUb1Jz9I NZKhjCjjtRw80FZIBr9vyudYKt89/q8QI46NW3/jbSGR+pgyTVXiIrCVt6Nm8/9Psu+Y dCLclsfSRcMjZI3Uw155PmRubOZa4sz13DGWZ5xwaOOok2JwJnawCii481y05CSaCHA9 0bD5bBPhEsvq49iWyYmdxUoPX6TrHmvnHs6rhaBN/33rHaDWHNxwwaHgUsSf/gNZt/Xm 7sB6cqPw9hBQopImLpxXWoCQ/dw0ASaluieHUoBZlDcxBEhexsujmVGHPrVx2Nnxyz3p 5MlQ== X-Gm-Message-State: AOAM530fbMhLbe284bifmXEoz0G/Edg7LoosOspHfuF2FgKO7xixkgfh IOqm994LupgntRh/ET6tcIc9a3Lg8rysHDowvXLCad2yI4dlEA== X-Google-Smtp-Source: ABdhPJwmQODYvvIdmy3zcFb0X7RXqWgpyq8iBpQp5nuOKT7HpHmxtMSJcS4HEvtPzbtW5uLHxpokp/qE9tklQJPwLG8= X-Received: by 2002:a02:cc54:: with SMTP id i20mr40751894jaq.136.1609194567335; Mon, 28 Dec 2020 14:29:27 -0800 (PST) MIME-Version: 1.0 References: <202012171958.0BHJwT9X079850@repo.freebsd.org> In-Reply-To: From: Ed Maste Date: Mon, 28 Dec 2020 17:29:15 -0500 Message-ID: Subject: Re: svn commit: r368736 - head/tools/tools/git/hooks To: Alan Somers Cc: src-committers , svn-src-all , svn-src-head Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 4D4XKN6JWkz4pVJ X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; none X-Spamd-Result: default: False [-4.00 / 15.00]; REPLY(-4.00)[] 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: Mon, 28 Dec 2020 22:29:29 -0000 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.