unofficial mirror of emacs-devel@gnu.org 
 help / color / mirror / code / Atom feed
From: Lawrence Mitchell <wence@gmx.li>
To: emacs-devel@gnu.org
Subject: Re: smerge autolaunch integration for conflicts in git
Date: Wed, 13 Aug 2014 16:07:43 +0100	[thread overview]
Message-ID: <m28umswhq8.fsf@gmx.li> (raw)
In-Reply-To: 20140813091310.A2525380604@snark.thyrsus.com

Eric S. Raymond wrote:

[...]

> Good news: I merged it anyway because if it breaks, it's not going to
> do so seriously and should be easy to fix.  Multiple git adds on a
> file are harmless.  The most likely failure is that the regexp for
> detecting conflicts in a status listing is slightly off, in which case
> the launch hook will simply not fire.

A better way to do this is to use git ls-files.  For example:

git ls-files -u -z -- directory

gives you the unmerged files in directory (paths
NUL-separated) with each file repeated 3 times

So something like the following gives you the unmerged files:

(let ((lines (split-string (vc-git--run-command-string directory
                            "ls-files" "-u" "-z" "--")
                           "\0" 'omit-nulls)))
 (loop for line in lines
       for i = 0 then (+ i 1)
       ;; Prefix is:
       ;; 6 chars for mode
       ;; 1 space
       ;; 40 chars for SHA1
       ;; 1 space
       ;; 1 char for state
       ;; 1 tab
       ;; filename
       if (zerop (mod i 3)) collect (substring line 50)))

[...]


-- 
Lawrence Mitchell <wence@gmx.li>




  reply	other threads:[~2014-08-13 15:07 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-08-13  9:13 smerge autolaunch integration for conflicts in git Eric S. Raymond
2014-08-13 15:07 ` Lawrence Mitchell [this message]
2014-08-20 20:46 ` Glenn Morris

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=m28umswhq8.fsf@gmx.li \
    --to=wence@gmx.li \
    --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 public inbox

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

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).