From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Stefan Monnier Newsgroups: gmane.emacs.devel Subject: Re: Git conflict VC state detection Date: Sun, 10 Nov 2013 21:13:17 -0500 Message-ID: References: <527BCD00.9090105@openmailbox.org> <87d2mcdrgu.fsf@yandex.ru> <877gcia4c5.fsf@web.de> <87fvr61f4d.fsf@wanadoo.es> <877gch1uul.fsf@wanadoo.es> <87wqkgyp7z.fsf_-_@wanadoo.es> <527FFA0B.1080805@yandex.ru> <87ppq7zyqx.fsf@wanadoo.es> <87li0vzrli.fsf@wanadoo.es> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain X-Trace: ger.gmane.org 1384136013 19045 80.91.229.3 (11 Nov 2013 02:13:33 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Mon, 11 Nov 2013 02:13:33 +0000 (UTC) Cc: emacs-devel@gnu.org, Dmitry Gutov To: =?windows-1252?Q?=D3scar?= Fuentes Original-X-From: emacs-devel-bounces+ged-emacs-devel=m.gmane.org@gnu.org Mon Nov 11 03:13:37 2013 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 1Vfh0R-0000Kn-Mn for ged-emacs-devel@m.gmane.org; Mon, 11 Nov 2013 03:13:35 +0100 Original-Received: from localhost ([::1]:34373 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vfh0R-000865-2t for ged-emacs-devel@m.gmane.org; Sun, 10 Nov 2013 21:13:35 -0500 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:53877) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vfh0H-00084M-G3 for emacs-devel@gnu.org; Sun, 10 Nov 2013 21:13:32 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Vfh0A-0001EX-7A for emacs-devel@gnu.org; Sun, 10 Nov 2013 21:13:25 -0500 Original-Received: from ironport2-out.teksavvy.com ([206.248.154.182]:63986) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Vfh0A-0001ER-2J for emacs-devel@gnu.org; Sun, 10 Nov 2013 21:13:18 -0500 X-IronPort-Anti-Spam-Filtered: true X-IronPort-Anti-Spam-Result: Av4EABK/CFG4rwT3/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IPAS-Result: Av4EABK/CFG4rwT3/2dsb2JhbABEvw4Xc4IeAQEEAVYjEAs0EhQYDSSIHgbBLZEKA4hhnBmBXoMV X-IronPort-AV: E=Sophos;i="4.84,565,1355115600"; d="scan'208";a="37534710" Original-Received: from 184-175-4-247.dsl.teksavvy.com (HELO pastel.home) ([184.175.4.247]) by ironport2-out.teksavvy.com with ESMTP/TLS/ADH-AES256-SHA; 10 Nov 2013 21:13:17 -0500 Original-Received: by pastel.home (Postfix, from userid 20848) id 395B960C10; Sun, 10 Nov 2013 21:13:17 -0500 (EST) In-Reply-To: <87li0vzrli.fsf@wanadoo.es> (=?windows-1252?Q?=22=D3scar?= Fuentes"'s message of "Mon, 11 Nov 2013 01:53:29 +0100") User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.3.50 (gnu/linux) X-detected-operating-system: by eggs.gnu.org: Genre and OS details not recognized. X-Received-From: 206.248.154.182 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:165136 Archived-At: >> So, an alternative to fixing vc-state is to add a vc-git-conflict-p called >> from the find-file-hook. > IIUC what you propose does not reduce the number of git invocations > while visiting/reverting a file Indeed :-( It can reduce it in a few other cases where vc-state is called without visiting/reverting a file. Admittedly, these are rare (mostly because vc-dir doesn't use vc-state but some other function). Maybe another option is to do: if status is ambiguous and could be `conflict', look for diff3 markers, and if found, run git a second time to confirm that the status is `conflict'. Of course, if we could get the `conflict' status in a single git invocation that would be much better. Stefan