git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Junio C Hamano <gitster@pobox.com>
To: Stefan Beller <sbeller@google.com>
Cc: Kaartic Sivaraam <kaarticsivaraam91196@gmail.com>,
	"git\@vger.kernel.org" <git@vger.kernel.org>
Subject: Re: [PATCHv3] builtin/merge: honor commit-msg hook for merges
Date: Thu, 21 Sep 2017 10:10:29 +0900	[thread overview]
Message-ID: <xmqqy3p8n9fe.fsf@gitster.mtv.corp.google.com> (raw)
In-Reply-To: <CAGZ79kaN4nKwGXq9t+Lv9e4X6qkBUAj4S8gofrNj3VZYw1sv+w@mail.gmail.com> (Stefan Beller's message of "Wed, 20 Sep 2017 12:55:49 -0700")

Stefan Beller <sbeller@google.com> writes:

> I'll send a patch fixing the docs, though with this thought, maybe we need
> to fix other commands, that produce commits as well?
> (git revert, others?)

I do not think "commands that create commits" is not a good
criteria.  "git notes" and "git stash" would (internally) create a
commit while recording a new change, but you obvously would not want
these hooks to kick in.

A command that can stop in the middle and to which running "git
commit" is how the end-user concludes the operation would be a
candidate.  "git merge X", "git cherry-pick A", and "git cherry-pick
A..B" may be good candidates.

For "rebase" and others that have the "convenience --continue"
option that make a commit before continuing, I would think that we
should treat these as invoking "git commit".  That is, when these
commands stop and you resolve the conflict in the index and in the
working tree, the next "git $cmd --continue" you type is merely a
way to let you be lazy.  You'd be typing "git commit && git $cmd
--continue" if you were to refuse the lazy convenience option and
want to spell out what you are doing explicitly, and you'd get the
same result as you'd get from just "git $cmd --continue" if you did
so.

On the other hand, "git am" is not a candidate.  You never use "git
commit" to mark that you are done, even if you refuse to use the
lazy convenience option and spell out what you are doing explicitly.

  reply	other threads:[~2017-09-21  1:10 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-09-05 21:01 [PATCH] builtin/merge: honor commit-msg hook for merges Stefan Beller
2017-09-05 21:38 ` Junio C Hamano
2017-09-05 23:08   ` [PATCH] parse-options: warn developers on negated options Stefan Beller
2017-09-06  1:52     ` Junio C Hamano
2017-09-06  3:16       ` Junio C Hamano
2017-09-06 21:36         ` Stefan Beller
2017-09-06 23:41           ` Junio C Hamano
2017-09-05 23:29   ` [PATCHv2] builtin/merge: honor commit-msg hook for merges Stefan Beller
2017-09-06  1:57     ` Junio C Hamano
2017-09-06 22:11       ` Stefan Beller
2017-09-06 23:43         ` Junio C Hamano
2017-09-07 22:04   ` [PATCHv3] " Stefan Beller
2017-09-08  1:13     ` Junio C Hamano
2017-09-11 17:12       ` Stefan Beller
2017-09-16  6:22     ` Kaartic Sivaraam
2017-09-20 19:55       ` Stefan Beller
2017-09-21  1:10         ` Junio C Hamano [this message]
2017-09-21 20:29       ` [PATCH] Documentation/githooks: mention merge in commit-msg hook Stefan Beller
2017-09-22  1:58         ` Junio C Hamano

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=xmqqy3p8n9fe.fsf@gitster.mtv.corp.google.com \
    --to=gitster@pobox.com \
    --cc=git@vger.kernel.org \
    --cc=kaarticsivaraam91196@gmail.com \
    --cc=sbeller@google.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).