From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eliza Velasquez Newsgroups: gmane.emacs.devel Subject: Re: ediff merge wrapper Date: Wed, 4 Nov 2020 18:18:57 -0800 Message-ID: References: <838sbicrqi.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="33348"; mail-complaints-to="usenet@ciao.gmane.io" Cc: emacs-devel To: Eli Zaretskii Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane-mx.org@gnu.org Thu Nov 05 03:19:57 2020 Return-path: Envelope-to: ged-emacs-devel@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1kaUsX-0008ZP-G2 for ged-emacs-devel@m.gmane-mx.org; Thu, 05 Nov 2020 03:19:57 +0100 Original-Received: from localhost ([::1]:57320 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1kaUsW-0007u7-Ie for ged-emacs-devel@m.gmane-mx.org; Wed, 04 Nov 2020 21:19:56 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:50058) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1kaUrr-0007Ov-23 for emacs-devel@gnu.org; Wed, 04 Nov 2020 21:19:16 -0500 Original-Received: from mail-io1-xd29.google.com ([2607:f8b0:4864:20::d29]:35046) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1kaUrm-0006op-Vm for emacs-devel@gnu.org; Wed, 04 Nov 2020 21:19:14 -0500 Original-Received: by mail-io1-xd29.google.com with SMTP id n12so247659ioc.2 for ; Wed, 04 Nov 2020 18:19:09 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=SVozdOIkXZ+Cb7AGEspj0cDRp7Z2Laqvdhl8Fww+U6M=; b=jgkywipx3SEF9QE6aqKOKSmlSwpXWML5xipCWorcMecUbDCSqLkwIEGFZRZX4Ri6IY d1iBDRQDYu/DJ59L2EfPYxV9OA90OG49iT+Od+9mOcphhFSafVoU3bnLwgqfe2LLNxrT yqkJgGUp/NHOUZdT9ZnjOrJqwuzeG5m1+OPOPqtTGdVSxe9Ti3oDxReYFotfrybUbquV szHcRGi4bE9smh77KL7i+s0R/4xXcvQaektDzCtu5qdq8CPId5x306cEVXUfphqEaK8y wNLYp5FPz1KEmHKXJVsRovLMPJA6C7Yq9vyFsEq8lmEcHwz+8jFg6vdn8NmejJRAz0T0 Y2Gw== 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=SVozdOIkXZ+Cb7AGEspj0cDRp7Z2Laqvdhl8Fww+U6M=; b=Mn1kziyGe2D82glqImbtAf+MsZ0bpCfigzCfCFmCwKT6RkVwc/vYqlpjwskKnMrS0X V0gKj4babys+ixyyH1g0/LKZpMNg7HNDU1BUGnxWihfpsk9k8HDJZ0dFxL4oZ07qDDRJ 8Bmrv9rSjybO9KaDhWbM9hjZpnmP4SJqz5KXszxRaKuKNl1CXaA3ep840i0QNdo5hNgU H1kVMUe0/N8/b8ha94PoqhqK2WmlWaNi62GzjXnNPDoIW/ufc4l3NL2SU+RBz1BxTtsZ 5z28HQLardwM8CXH0EmlAMoxg9RMV3Bj/qtmIg2Stp3hvnrKl2apWIfUiPCdYjeo0QIL wCOA== X-Gm-Message-State: AOAM531phC+qS81Q89GKpOkBksam6jEc0M06deSCSNIo5pdr+edD1RYd vXCDD5GvMCUCKooKWccJqTEdiaSl0glNpAeoGSODKHbMf72eduwD X-Google-Smtp-Source: ABdhPJzBN+HhBQ9y9rjod8cCgSyUqh19KDyjVHB9WtQNlH+UwIhjqO84cgYJOogQxqP2jwj7QeIFOlVsGj6ywBxHnOs= X-Received: by 2002:a02:208:: with SMTP id 8mr367023jau.79.1604542748510; Wed, 04 Nov 2020 18:19:08 -0800 (PST) In-Reply-To: Received-SPF: pass client-ip=2607:f8b0:4864:20::d29; envelope-from=exv@google.com; helo=mail-io1-xd29.google.com X-detected-operating-system: by eggs.gnu.org: No matching host in p0f cache. That's all we know. X-Spam_score_int: -175 X-Spam_score: -17.6 X-Spam_bar: ----------------- X-Spam_report: (-17.6 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_MED=-0.001, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, ENV_AND_HDR_SPF_MATCH=-0.5, RCVD_IN_DNSWL_NONE=-0.0001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, USER_IN_DEF_DKIM_WL=-7.5, USER_IN_DEF_SPF_WL=-7.5 autolearn=unavailable autolearn_force=no X-Spam_action: no action X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.23 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-mx.org@gnu.org Original-Sender: "Emacs-devel" Xref: news.gmane.io gmane.emacs.devel:258708 Archived-At: Okay, as I mentioned in the bug thread, I have a fix working which requires some polish before I submit a patch for it. Unfortunately, the emacsclient command to replace the wrapper script would still be pretty long and unwieldy: emacsclient -ucF "((delete-frame-on-ediff-quit . t))" \ -e "(ediff-merge-with-ancestor \"${local}\" \"${other}\" \"${base}\" nil \"${output}\")" \ -e "(add-hook 'ediff-quit-hook (lambda () (when (frame-parameter nil 'delete-frame-on-ediff-quit) (delete-frame))))" I think a more robust version of this command (that could correctly handle cases where the server is not running) could be included as both a bash script and a Windows batch script, which could then easily be used as an HGMERGE or P4MERGE tool. On Tue, Nov 3, 2020 at 10:44 AM Eliza Velasquez wrote: > > I replied with more details about how it works, but it seems I > accidentally sent them in a private email to Stefan. Sorry about that, > I'm not quite used to mailing lists. I'll copy what I wrote here. > > Google's ediff_merge tool is invoked like: > > ediff_merge /path/to/base_file /path/to/ancestor /path/to/file-a > /path/to/file-b /path/to/output-file > > This command blocks until the merge operation is complete, i.e. when > the user quits ediff. > > Upon further investigation of its source code, it seems that the need > for this tool may be obsoleted if this bug were to be fixed instead: > https://debbugs.gnu.org/cgi/bugreport.cgi?bug=25547. Most of the > purpose of this tool seems to be a workaround for this behavior, and > it could probably be replaced with a call to `emacsclient -c -e > '(ediff-merge-with-ancestor "$a" "$b" "$ancestor" nil "$output")'` if > it were fixed. > > Stefan and I had some additional discussion on the bug thread. > > On Tue, Nov 3, 2020 at 8:47 AM Eli Zaretskii wrote: > > > > > From: Eliza Velasquez > > > Date: Mon, 2 Nov 2020 12:01:33 -0800 > > > > > > Internally at Google, we have a wrapper performing an ediff merge with > > > emacs/emacsclient which blocks until the merge operation has > > > completed. It automatically handles edge cases such as creating a new > > > frame over ssh in tty mode or being invoked as an emacs subprocess. I > > > think it would be really useful to upstream a tool like this, given > > > that using emacs as a merge tool that can be invoked by software such > > > as mercurial or perforce can be very fiddly or have unexpected > > > behavior. > > > > Can you describe the use of this tool in more detail, and what > > enhancements it implements beyond what emacsclient provides? I don't > > think I understand that from your short description. > > > > Thanks.