all messages for Emacs-related lists mirrored at yhetil.org
 help / color / mirror / code / Atom feed
From: Eliza Velasquez <exv@google.com>
To: Eli Zaretskii <eliz@gnu.org>
Cc: emacs-devel <emacs-devel@gnu.org>
Subject: Re: ediff merge wrapper
Date: Wed, 4 Nov 2020 18:18:57 -0800	[thread overview]
Message-ID: <CAK1djOpNambrzCq1WidJ2AWF8iORonS3oDHymhunphBTqO2f4Q@mail.gmail.com> (raw)
In-Reply-To: <CAK1djOp1ECsn5cpGB147hfsJevFqMzEry+P-XwR+smHBwABOgw@mail.gmail.com>

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 <exv@google.com> 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 <eliz@gnu.org> wrote:
> >
> > > From: Eliza Velasquez <exv@google.com>
> > > 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.



      reply	other threads:[~2020-11-05  2:18 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-11-02 20:01 ediff merge wrapper Eliza Velasquez
2020-11-03  9:23 ` Daniel Martín
2020-11-03 16:42 ` chad
2020-11-03 16:47 ` Eli Zaretskii
2020-11-03 18:44   ` Eliza Velasquez
2020-11-05  2:18     ` Eliza Velasquez [this message]

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=CAK1djOpNambrzCq1WidJ2AWF8iORonS3oDHymhunphBTqO2f4Q@mail.gmail.com \
    --to=exv@google.com \
    --cc=eliz@gnu.org \
    --cc=emacs-devel@gnu.org \
    /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.