From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Lawrence Mitchell Newsgroups: gmane.emacs.devel Subject: Re: smerge autolaunch integration for conflicts in git Date: Wed, 13 Aug 2014 16:07:43 +0100 Message-ID: References: <20140813091310.A2525380604@snark.thyrsus.com> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1407942509 9795 80.91.229.3 (13 Aug 2014 15:08:29 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Wed, 13 Aug 2014 15:08:29 +0000 (UTC) To: emacs-devel@gnu.org Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Wed Aug 13 17:08:23 2014 Return-path: Envelope-to: ged-emacs-devel@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1XHaA1-0003oc-Uc for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2014 17:08:22 +0200 Original-Received: from localhost ([::1]:48045 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHaA1-0002Vi-Gf for ged-emacs-devel@m.gmane.org; Wed, 13 Aug 2014 11:08:21 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54476) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHa9r-0002Uj-OY for emacs-devel@gnu.org; Wed, 13 Aug 2014 11:08:17 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XHa9l-0007cU-Rc for emacs-devel@gnu.org; Wed, 13 Aug 2014 11:08:11 -0400 Original-Received: from plane.gmane.org ([80.91.229.3]:59812) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XHa9l-0007cL-Ln for emacs-devel@gnu.org; Wed, 13 Aug 2014 11:08:05 -0400 Original-Received: from list by plane.gmane.org with local (Exim 4.69) (envelope-from ) id 1XHa9h-0003dr-Cd for emacs-devel@gnu.org; Wed, 13 Aug 2014 17:08:01 +0200 Original-Received: from dyn1190-6.wlan.ic.ac.uk ([129.31.190.6]) by main.gmane.org with esmtp (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 17:08:01 +0200 Original-Received: from wence by dyn1190-6.wlan.ic.ac.uk with local (Gmexim 0.1 (Debian)) id 1AlnuQ-0007hv-00 for ; Wed, 13 Aug 2014 17:08:01 +0200 X-Injected-Via-Gmane: http://gmane.org/ Original-Lines: 39 Original-X-Complaints-To: usenet@ger.gmane.org X-Gmane-NNTP-Posting-Host: dyn1190-6.wlan.ic.ac.uk User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3 (darwin) Cancel-Lock: sha1:jkUYWngd3mv9a+Tz4gd1hrM/Z/0= X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 80.91.229.3 X-BeenThere: emacs-devel@gnu.org X-Mailman-Version: 2.1.14 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-bounces+ged-emacs-devel=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.devel:173625 Archived-At: 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