From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-5.1 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD shortcircuit=no autolearn=ham autolearn_force=no version=3.4.0 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by dcvr.yhbt.net (Postfix) with ESMTP id 33231203E3 for ; Tue, 26 Jul 2016 21:07:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1758153AbcGZVFb (ORCPT ); Tue, 26 Jul 2016 17:05:31 -0400 Received: from pb-smtp2.pobox.com ([64.147.108.71]:50524 "EHLO sasl.smtp.pobox.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1758060AbcGZVFa (ORCPT ); Tue, 26 Jul 2016 17:05:30 -0400 Received: from sasl.smtp.pobox.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 8962A305E7; Tue, 26 Jul 2016 17:05:28 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; s=sasl; bh=8kgCdk46BiX2MNFx7tfyPAUtnUc=; b=Zm/j5V /e0kMq3dAGv8bcs0gT4tpeEntpwyOIQf6/8559jitxUal5Ze6l9r9YFlASubmZ69 76y02CSu2ciS4fbkYXL864SSAqaf4TFL3nb4x9AODLXkfWgS1hZIRzd69rCqueo7 /9whgCb1Z5iGOIzdNqsP9K2cz8RUu+c9H7qyI= DomainKey-Signature: a=rsa-sha1; c=nofws; d=pobox.com; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type; q=dns; s=sasl; b=HTNGFfTKLQ+QBViR8rPFTgjHgv5bv0yc F7pBLFaoGn54qYPZuyG+kMJ7lzAuTpcyjAzKrJrWIir6SA4mgtX8f9uT2wx8kjYs Z1PIPGMVqwyTt2r4KIoCY2dmq3mEwkWVZE8JWyhSpqngGNO5/XgAgMmnlKuUQBoi +ayiP7ZI4RE= Received: from pb-smtp2.nyi.icgroup.com (unknown [127.0.0.1]) by pb-smtp2.pobox.com (Postfix) with ESMTP id 80314305E6; Tue, 26 Jul 2016 17:05:28 -0400 (EDT) Received: from pobox.com (unknown [104.132.0.95]) (using TLSv1.2 with cipher DHE-RSA-AES128-SHA (128/128 bits)) (No client certificate requested) by pb-smtp2.pobox.com (Postfix) with ESMTPSA id E9126305E5; Tue, 26 Jul 2016 17:05:27 -0400 (EDT) From: Junio C Hamano To: Orgad Shaneh Cc: Johannes Schindelin , git Subject: Re: [PATCH] merge: Run commit-msg hook References: <1469519323-11420-1-git-send-email-orgad.shaneh@audiocodes.com> Date: Tue, 26 Jul 2016 14:05:25 -0700 In-Reply-To: (Orgad Shaneh's message of "Tue, 26 Jul 2016 16:50:36 +0300") Message-ID: User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-Pobox-Relay-ID: ADDD8DDC-5374-11E6-93EE-EE617A1B28F4-77302942!pb-smtp2.pobox.com Sender: git-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: git@vger.kernel.org Orgad Shaneh writes: >> Hmm. This is not very convincing to me, as >> >> - if you call commit-msg in `git merge` now, why not `prepare-commit-msg`? > > prepare-commit-msg is already called, a few lines above this addition. I do not see such call in contrib/example/git-merge.sh; could it be a recent bug that it calls it? >> - a merge is a different beast from a simple commit. That is why we have >> two different commands for them. A hook to edit the merge message may >> need to know the *second* parent commit, too, for example to generate >> a diffstat, or to add information about changes in an "evil commit". > > That is correct for a post-merge hook. Why should *message validation* differ > between simple and merge commit? Have you seen a typical merge commit message? They certainly look different to me and different rules would apply. >> - if Gerrit is the intended user, would it not make more sense to >> introduce a new hook, e.g. `merge-msg` (and `prepare-merge-msg`), as you >> have to teach Gerrit a new trick anyway? > > Why is that new? Every commit in gerrit has a Change-Id footer, which is > generated by commit-msg hook. Hmm, I didn't know Gerrit gave Change-ID to merges. In any case, I would think this is completely new. Without this change, commit-msg was not called for merges, so Gerrit wouldn't have added Change-ID to merges with that mechanism. A new merge-msg hook would make more sense, if we were making any change. I do not want to get yelled at by those who wrote their commit-msg hooks long time ago and have happily been using them that updated Git started calling them for their merges where their validation logic for their single-parent commit do not apply at all.