unofficial mirror of help-gnu-emacs@gnu.org
 help / color / mirror / Atom feed
From: Hi-Angel <hiangel999@gmail.com>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: help-gnu-emacs@gnu.org
Subject: Re: How to navigate to next git conflict?
Date: Wed, 6 Feb 2019 14:37:06 +0300	[thread overview]
Message-ID: <CAHGDjgD7+gXH1BGPm6fZRASdRVwFXoi34Ogzr6DOg8cbeXsa3Q@mail.gmail.com> (raw)
In-Reply-To: <jwv4l9rrecg.fsf-monnier+emacs@gnu.org>

Thanks!

So, for now I wrote the following function, hope this helps someone

(defun smerge-next-safe ()
    "returns t on success, nil otherwise"
  (condition-case err
      (not (smerge-next))
    ('error
     nil)))


(defun next-conflict ()
  (interactive)
  (let ((buffer (current-buffer)))
    (when (not (smerge-next-safe))
      (vc-find-conflicted-file)
      (if (eq buffer (current-buffer))
        (message "No conflicts found"))
        (smerge-next-safe)))
  )

I guess I'll try to contribute a similar functional to Emacs on the weekend.

On Tue, 29 Jan 2019 at 12:43, Stefan Monnier <monnier@iro.umontreal.ca> wrote:
>
> > For working with git I noted one of frequent actions I do is resolving
> > conflicts. I'm comfortable to work with most of that from terminal
> > (I've got a completion in zsh and what not…) except that conflict
> > navigation could use a bit of automation.
> >
> > So far I only managed to find `smerge-next`, but it is limited to the
> > focused buffer, in there I can as well search for a HEAD or <<<
> > markers, so not really useful.
>
> There's also `vc-find-conflicted-file` to go to the next file with
> conflicts when you're done with one.
>
>
>         Stefan
>
>



  reply	other threads:[~2019-02-06 11:37 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-01-29  7:51 How to navigate to next git conflict? Hi-Angel
2019-01-29  9:42 ` Stefan Monnier
2019-02-06 11:37   ` Hi-Angel [this message]
2019-02-06 14:11     ` Stefan Monnier
2019-02-06 14:47       ` Hi-Angel
2019-02-06 15:30         ` Stefan Monnier
2019-02-06 21:22           ` Hi-Angel
2019-02-06 21:34             ` tomas
2019-02-10 22:00               ` Hi-Angel

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: https://www.gnu.org/software/emacs/

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

  git send-email \
    --in-reply-to=CAHGDjgD7+gXH1BGPm6fZRASdRVwFXoi34Ogzr6DOg8cbeXsa3Q@mail.gmail.com \
    --to=hiangel999@gmail.com \
    --cc=help-gnu-emacs@gnu.org \
    --cc=monnier@iro.umontreal.ca \
    /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.
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).