From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Noam Postavsky Newsgroups: gmane.emacs.devel 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 Message-ID: References: <955c464e-5833-10fd-9c02-d7edda70e488@cs.ucla.edu> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 X-Trace: blaine.gmane.org 1492042415 2225 195.159.176.226 (13 Apr 2017 00:13:35 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 13 Apr 2017 00:13:35 +0000 (UTC) Cc: martin rudalics , emacs-devel , Andreas Schwab , Yuri Khan To: Paul Eggert Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Thu Apr 13 02:13:31 2017 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cySOB-0000Sz-4u for ged-emacs-devel@m.gmane.org; Thu, 13 Apr 2017 02:13:31 +0200 Original-Received: from localhost ([::1]:46677 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cySOG-0001XV-VR for ged-emacs-devel@m.gmane.org; Wed, 12 Apr 2017 20:13:36 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:46232) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cySOA-0001XN-RV for emacs-devel@gnu.org; Wed, 12 Apr 2017 20:13:31 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cySO9-0002YH-Lq for emacs-devel@gnu.org; Wed, 12 Apr 2017 20:13:30 -0400 Original-Received: from mail-oi0-x241.google.com ([2607:f8b0:4003:c06::241]:35379) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cySO9-0002Xs-HM for emacs-devel@gnu.org; Wed, 12 Apr 2017 20:13:29 -0400 Original-Received: by mail-oi0-x241.google.com with SMTP id g204so8737616oib.2 for ; Wed, 12 Apr 2017 17:13:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:sender:in-reply-to:references:from:date:message-id :subject:to:cc; bh=oPwuwS+Qotk+kFijrOnMl8spTRb4TQyhkaWqIUuD22Y=; b=XJlzbtnxr4mNRViEKHxdoOBF2GczzWsvapA3wX641lgI5KLcv+W6pnoulXHAUOgFy/ FGSQJ0Umfy2CKzthtKPVZ8MRjIG4mycKf++0B0cETdHeJs6GgXn87sNk+pJjJDgfodJb oyAB6lFvPJPeq73JjAHEf61hL9bsY6rjvUL4ObbrSAcn4fEgIRhesLVsJUahE3enUMMQ cRU3CoxQHVjaRf6oOTB+8ERPhNDpzadvyConDKcCU05X/oVCZ3VAqsDrH9lGePKxHRRq G78tloBjm01zH84Fg5CdNaOrRZRxyyU4LxHIUMAhZbZifB6Oqav32z9SYxK9TadHZjYU PbUA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:sender:in-reply-to:references:from :date:message-id:subject:to:cc; bh=oPwuwS+Qotk+kFijrOnMl8spTRb4TQyhkaWqIUuD22Y=; b=mdKGrqK9c4lIZq6yzY9mwvgUkEII/jUdQYIjRsq6IUAH9zQHWRDXJmpQoR9ltVdHcf cnhz0NJzT/gEcCZ9ApgVTOG0Dwr7iWaxAkknA/iNky7UWFLNTuATAngFRKOpiS8Xi58y Bq0fMXgqk4SB+5lt3mzcJZby2UMOnT/k9s1YFXHY4FZyY+4yGaNbyjzg7p2sO39ZA28V of/zYNzznOZBlRGeRyTdKqhNM/+LGrK6f47x/xgN8iPfhdrf0e9W/4kNwumoahb5Y68c K1Popdq69pB9QxlDmHHF4AP7cmPtqT1pxvo2isJyAFdbdROqTY8zjQNZg4yoBI41OiEZ 8gsA== X-Gm-Message-State: AN3rC/6SNdTYMDTU7pk/yEEM5Th3ARbAiOfm8O1siI7Cl+gq8RSq/KQl Cdb+o0bSkCrga+/yVWixEDlae4NFnQ== X-Received: by 10.157.15.230 with SMTP id m35mr194222otd.30.1492042407098; Wed, 12 Apr 2017 17:13:27 -0700 (PDT) Original-Received: by 10.157.9.178 with HTTP; Wed, 12 Apr 2017 17:13:26 -0700 (PDT) In-Reply-To: <955c464e-5833-10fd-9c02-d7edda70e488@cs.ucla.edu> X-Google-Sender-Auth: BQWeG7BGhAwuSiQcGXYlHPpFyUs X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 2607:f8b0:4003:c06::241 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: "Emacs development discussions." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.org gmane.emacs.devel:213921 Archived-At: On Wed, Apr 12, 2017 at 2:26 PM, Paul Eggert 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.