all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Noam Postavsky <npostavs@users.sourceforge.net>
To: Paul Eggert <eggert@cs.ucla.edu>
Cc: martin rudalics <rudalics@gmx.at>,
	emacs-devel <emacs-devel@gnu.org>,
	Andreas Schwab <schwab@suse.de>,
	Yuri Khan <yuri.v.khan@gmail.com>
Subject: Re: git pre-commit hook for merges (WAS: master has switched from Automake to GNU Make)
Date: Wed, 12 Apr 2017 20:13:26 -0400	[thread overview]
Message-ID: <CAM-tV-9BQTaNs2z=DAb2=E9u1uY-txaLjxs0MjEp8d6ZKjAvsA@mail.gmail.com> (raw)
In-Reply-To: <955c464e-5833-10fd-9c02-d7edda70e488@cs.ucla.edu>

On Wed, Apr 12, 2017 at 2:26 PM, Paul Eggert <eggert@cs.ucla.edu> wrote:

> When I do a merge, though, I'd rather see problems from the other side (so
> that I can fix them).

I would note that a usual 'git merge' skips the pre-commit hook
entirely, unless the commit is delayed somehow. That is, the hook only
triggers if $EDITOR can't run in the current terminal, there is a
merge conflict, or the --no-commit option is given. 'git rebase' runs
the hook for the other side's changes at all. I think this is why
there was so much confusion over this, Martin hits this frequently
because he runs 'git merge' in a *shell* buffer, whereas most other
people hit it very rarely or not at all.

> How about an environment variable that captures the
> user's preference?

That sounds okay. I wonder if it would be more convenient to control
this by a ./configure option instead though.

>> +    head=$(cat "$GIT_DIR"/MERGE_HEAD)
>
> This won't work if MERGE_HEAD file contains more than one entry, which can
> happen when doing a 3- or more-way merge. How about the attached (untested)
> patch instead? It behaves the way that you suggested, when doing a 2-way
> merge and when the GIT_MERGE_BLINDLY environment variable is set to 'true'.
> Offhand I don't see a way of supporting 3- or more-way merges easily, so
> this patch punts and ignores GIT_MERGE_BLINDLY when doing fancier merges.

Ah right, forgot about multiway-merges. Punting should be fine, I'm
sure anyone trying an octopus merge should have enough git expertise
to handle some commit hook errors.



  reply	other threads:[~2017-04-13  0:13 UTC|newest]

Thread overview: 17+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-04-11 16:25 git pre-commit hook for merges (WAS: master has switched from Automake to GNU Make) Noam Postavsky
2017-04-12  9:30 ` martin rudalics
2017-04-12 18:26 ` Paul Eggert
2017-04-13  0:13   ` Noam Postavsky [this message]
2017-04-13  1:49     ` Paul Eggert
2017-04-13  2:05       ` Noam Postavsky
2017-04-13  6:11         ` Paul Eggert
2017-04-13 20:04           ` Noam Postavsky
2017-04-29 18:00   ` Noam Postavsky
2017-04-29 18:44     ` Paul Eggert
2017-04-29 19:15       ` Eli Zaretskii
2017-04-29 19:54         ` Noam Postavsky
2017-04-29 20:04           ` Eli Zaretskii
2017-04-29 23:25             ` Noam Postavsky
2017-04-30  2:34               ` Eli Zaretskii
2017-04-30 19:35                 ` Noam Postavsky
2017-04-30 19:40                   ` Eli Zaretskii

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

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

  git send-email \
    --in-reply-to='CAM-tV-9BQTaNs2z=DAb2=E9u1uY-txaLjxs0MjEp8d6ZKjAvsA@mail.gmail.com' \
    --to=npostavs@users.sourceforge.net \
    --cc=eggert@cs.ucla.edu \
    --cc=emacs-devel@gnu.org \
    --cc=rudalics@gmx.at \
    --cc=schwab@suse.de \
    --cc=yuri.v.khan@gmail.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 external index

	https://git.savannah.gnu.org/cgit/emacs.git
	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.