From unknown Sun Sep 07 21:36:10 2025 X-Loop: help-debbugs@gnu.org Subject: bug#18391: 24.4.50; [patch] vc-git-conflicted-files and empty git status Resent-From: Rasmus Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Wed, 03 Sep 2014 00:12:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: report 18391 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch To: 18391@debbugs.gnu.org X-Debbugs-Original-To: bug-gnu-emacs@gnu.org Received: via spool by submit@debbugs.gnu.org id=B.140970311726333 (code B ref -1); Wed, 03 Sep 2014 00:12:02 +0000 Received: (at submit) by debbugs.gnu.org; 3 Sep 2014 00:11:57 +0000 Received: from localhost ([127.0.0.1]:57211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOyB2-0006qe-O1 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 20:11:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32813) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOxxq-0006V7-40 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOxxf-0006Fi-H7 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxf-0006Fe-EL for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxa-0002Mt-Hp for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOxxV-0006F7-GS for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:58:02 -0400 Received: from mout.gmx.net ([212.227.15.18]:59730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxV-0006Ey-72 for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:57:57 -0400 Received: from W530 ([109.201.154.180]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0McVKy-1XgUqJ0s5o-00HbVt for ; Wed, 03 Sep 2014 01:57:55 +0200 From: Rasmus Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAHPSURBVEjHjZbJlQMxCAU7AKKsuCo3UpkDaOnNPX2wn22VPqAP8hH/ flDh+FgUAUSAmqn+BgBVVDO/ACIQ1FDT1C8FQCiZVAU/cyBCKigiPpOu6sD6dDzvewb2D8fTMk4E yfrB43nfDcF0g08hAaP0a9cw3YI61v59pIyKTGAUCJgATVAmqN9mTPWFmjmThiDGOdFiG2GbKadC CVBFH8HVRrQrdACsR6VcJC0MZmZmmmaXtQUcGh3VeBtONfOq4J4GVLb09gvoBETXKzjg3J6R9La/ ZWTKpESFpDegDc9Yv86jiBMQM+YuYEcz7TSJCTijGc3FNIR5B9p0Q0DQPuN5CneABYjEUHyo0shi CTAzxlegQqJz3tz6CMSmsNwNgfITyL0d0Ew2lfPUmMe19Vtm+bZrdQWmvzfZ8lod3nWQ4d7wc5gs Q3FXYDmlR2X1kGbeZ+tsnJFK93+f9MMwno3qqdCt4MP0rkWnL2YyGnkHyndjYKyCmQB3YJbQ66mD j0BEQJrpYgpM8Q3oqWXuxlPe7ri+1NLcjeqrQqzG2BSquC933Bo2aypVmG+XoosY66t4b0CbYwup Z+z7tTvH60kgv/5r9HqJDu7rn0ARgt1zfwjk8VmXGaNCAAAAAElFTkSuQmCC Date: Wed, 03 Sep 2014 01:57:53 +0200 Message-ID: <877g1l60e6.fsf@gmx.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:9Ww/3W8KkQBMYTk3IJxa7pm3kTjIHiyv4cCChJAmqsNUIw/ppdE ZzCgWiSOzVY5tE2osVjcZ6GMEhSkWnnMVjS4mLppq2620MV4xLocidzobPp0zSD8pWrTII7 bXwjrId63+vMZK1/7tcBLXAY8Tie3HXPwKxRUKHJiuYET7cPlJbKA16BrKwJRFI2ElD+Prt SJeS+7hxQkNFcXC1trtCQ== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Mailman-Approved-At: Tue, 02 Sep 2014 20:11:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, [I tried to send this report earlier, though it seems something went wrong. If it did already show up: sorry about the noise]. Recently, I get an error every time I open a new file in my document folder due to `vc-git-conflicted-files'. The function was introduced in revno: 117697 committer: Eric S. Raymond branch nick: trunk timestamp: Wed 2014-08-13 04:05:45 -0400 message: Integrate R=C3=BCdiger Sonderfeld's code for detecting=20 conflicted files under git. Background: My document folder is stored in a git annex direct-mode folder (see http://git-annex.branchable.com/). git annex is used for keeping folders in sync across computers, and is build on top of git. In my particular setup (direct mode) "git status" returns nil (or an empty string). However, `vc-git-conflicted-files' expects it to return a non-trivial string. The attach patch addresses this by checking that git status did in fact returned non-nil. Please let me know (preferably with wide reply) if you want me to fix the problem in some other way. I have signed papers to FSF. Thanks, Rasmus In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-08-25 on W530 Repository revision: dmantipov@yandex.ru-20140825070042-1o6sutsne8cexjdb Windowing system distributor `The X.Org Foundation', version 11.0.11600000 System Description: Arch Linux --=20 Er du tosset for noge' l=C3=A5rt! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=fix-vc-git-conflict.patch === modified file 'lisp/ChangeLog' *** lisp/ChangeLog 2014-08-25 03:16:36 +0000 --- lisp/ChangeLog 2014-08-25 23:12:30 +0000 *************** *** 1,3 **** --- 1,8 ---- + 2014-08-25 Rasmus Pank Roulund + + * vc/vc-git.el (vc-git-conflicted-files): Fix bug when git status + returns nil. + 2014-08-25 Christoph Scholtes * subr.el (remq): Fix docstring (Bug#18253). === modified file 'lisp/vc/vc-git.el' *** lisp/vc/vc-git.el 2014-08-13 08:42:33 +0000 --- lisp/vc/vc-git.el 2014-08-25 22:59:45 +0000 *************** This prompts for a branch to merge from. *** 774,790 **** "Return the list of files with conflicts in DIRECTORY." (let* ((status (vc-git--run-command-string directory "status" "--porcelain" "--")) ! (lines (split-string status "\n" 'omit-nulls)) files) ! (dolist (line lines files) ! (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" ! line) ! (let ((state (match-string 1 line)) ! (file (match-string 2 line))) ! ;; See git-status(1). ! (when (member state '("AU" "UD" "UA" ;; "DD" ! "DU" "AA" "UU")) ! (push file files))))))) (defun vc-git-resolve-when-done () "Call \"git add\" if the conflict markers have been removed." --- 774,791 ---- "Return the list of files with conflicts in DIRECTORY." (let* ((status (vc-git--run-command-string directory "status" "--porcelain" "--")) ! (lines (when status (split-string status "\n" 'omit-nulls))) files) ! (when lines ! (dolist (line lines files) ! (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" ! line) ! (let ((state (match-string 1 line)) ! (file (match-string 2 line))) ! ;; See git-status(1). ! (when (member state '("AU" "UD" "UA" ;; "DD" ! "DU" "AA" "UU")) ! (push file files)))))))) (defun vc-git-resolve-when-done () "Call \"git add\" if the conflict markers have been removed." --=-=-=-- From unknown Sun Sep 07 21:36:10 2025 MIME-Version: 1.0 X-Mailer: MIME-tools 5.503 (Entity 5.503) X-Loop: help-debbugs@gnu.org From: help-debbugs@gnu.org (GNU bug Tracking System) To: Rasmus Subject: bug#18391: closed (Re: bug#18391: 24.4.50; [patch] vc-git-conflicted-files and empty git status) Message-ID: References: <877g1l60e6.fsf@gmx.us> X-Gnu-PR-Message: they-closed 18391 X-Gnu-PR-Package: emacs X-Gnu-PR-Keywords: patch Reply-To: 18391@debbugs.gnu.org Date: Thu, 04 Sep 2014 16:36:02 +0000 Content-Type: multipart/mixed; boundary="----------=_1409848562-22236-1" This is a multi-part message in MIME format... ------------=_1409848562-22236-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" Your bug report #18391: 24.4.50; [patch] vc-git-conflicted-files and empty git status=20 which was filed against the emacs package, has been closed. The explanation is attached below, along with your original report. If you require more details, please reply to 18391@debbugs.gnu.org. --=20 18391: http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3D18391 GNU Bug Tracking System Contact help-debbugs@gnu.org with problems ------------=_1409848562-22236-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at 18391-done) by debbugs.gnu.org; 4 Sep 2014 16:35:47 +0000 Received: from localhost ([127.0.0.1]:58971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPa0g-0005m9-Gb for submit@debbugs.gnu.org; Thu, 04 Sep 2014 12:35:46 -0400 Received: from relais.videotron.ca ([24.201.245.36]:9578) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XPa0d-0005lu-OM for 18391-done@debbugs.gnu.org; Thu, 04 Sep 2014 12:35:44 -0400 MIME-version: 1.0 Content-transfer-encoding: 7BIT Content-type: text/plain; CHARSET=US-ASCII Received: from ceviche.home ([24.201.170.218]) by VL-VM-MR007.ip.videotron.ca (Oracle Communications Messaging Exchange Server 7u4-22.01 64bit (built Apr 21 2011)) with ESMTP id <0NBD003LGY3EQT90@VL-VM-MR007.ip.videotron.ca> for 18391-done@debbugs.gnu.org; Thu, 04 Sep 2014 12:35:38 -0400 (EDT) Received: by ceviche.home (Postfix, from userid 20848) id A7016660C4; Thu, 04 Sep 2014 12:35:38 -0400 (EDT) From: Stefan Monnier To: Rasmus Subject: Re: bug#18391: 24.4.50; [patch] vc-git-conflicted-files and empty git status Message-id: References: <877g1l60e6.fsf@gmx.us> Date: Thu, 04 Sep 2014 12:35:38 -0400 In-reply-to: <877g1l60e6.fsf@gmx.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) X-Spam-Score: 1.0 (+) X-Debbugs-Envelope-To: 18391-done Cc: 18391-done@debbugs.gnu.org X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: 1.0 (+) > The attach patch addresses this by checking that git status did in > fact returned non-nil. Thanks, installed (tho I removed the `when lines' test since dolist will already do nothing if lines is nil). Stefan ------------=_1409848562-22236-1 Content-Type: message/rfc822 Content-Disposition: inline Content-Transfer-Encoding: 7bit Received: (at submit) by debbugs.gnu.org; 3 Sep 2014 00:11:57 +0000 Received: from localhost ([127.0.0.1]:57211 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOyB2-0006qe-O1 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 20:11:57 -0400 Received: from eggs.gnu.org ([208.118.235.92]:32813) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1XOxxq-0006V7-40 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:18 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOxxf-0006Fi-H7 for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:12 -0400 X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org X-Spam-Level: X-Spam-Status: No, score=0.8 required=5.0 tests=BAYES_50,FREEMAIL_FROM autolearn=disabled version=3.3.2 Received: from lists.gnu.org ([2001:4830:134:3::11]:42343) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxf-0006Fe-EL for submit@debbugs.gnu.org; Tue, 02 Sep 2014 19:58:07 -0400 Received: from eggs.gnu.org ([2001:4830:134:3::10]:34534) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxa-0002Mt-Hp for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:58:07 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1XOxxV-0006F7-GS for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:58:02 -0400 Received: from mout.gmx.net ([212.227.15.18]:59730) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1XOxxV-0006Ey-72 for bug-gnu-emacs@gnu.org; Tue, 02 Sep 2014 19:57:57 -0400 Received: from W530 ([109.201.154.180]) by mail.gmx.com (mrgmx002) with ESMTPSA (Nemesis) id 0McVKy-1XgUqJ0s5o-00HbVt for ; Wed, 03 Sep 2014 01:57:55 +0200 From: Rasmus To: bug-gnu-emacs@gnu.org Subject: 24.4.50; [patch] vc-git-conflicted-files and empty git status Face: iVBORw0KGgoAAAANSUhEUgAAADAAAAAwCAAAAAByaaZbAAAAAmJLR0QA/4ePzL8AAAAJcEhZ cwAAAEgAAABIAEbJaz4AAAHPSURBVEjHjZbJlQMxCAU7AKKsuCo3UpkDaOnNPX2wn22VPqAP8hH/ flDh+FgUAUSAmqn+BgBVVDO/ACIQ1FDT1C8FQCiZVAU/cyBCKigiPpOu6sD6dDzvewb2D8fTMk4E yfrB43nfDcF0g08hAaP0a9cw3YI61v59pIyKTGAUCJgATVAmqN9mTPWFmjmThiDGOdFiG2GbKadC CVBFH8HVRrQrdACsR6VcJC0MZmZmmmaXtQUcGh3VeBtONfOq4J4GVLb09gvoBETXKzjg3J6R9La/ ZWTKpESFpDegDc9Yv86jiBMQM+YuYEcz7TSJCTijGc3FNIR5B9p0Q0DQPuN5CneABYjEUHyo0shi CTAzxlegQqJz3tz6CMSmsNwNgfITyL0d0Ew2lfPUmMe19Vtm+bZrdQWmvzfZ8lod3nWQ4d7wc5gs Q3FXYDmlR2X1kGbeZ+tsnJFK93+f9MMwno3qqdCt4MP0rkWnL2YyGnkHyndjYKyCmQB3YJbQ66mD j0BEQJrpYgpM8Q3oqWXuxlPe7ri+1NLcjeqrQqzG2BSquC933Bo2aypVmG+XoosY66t4b0CbYwup Z+z7tTvH60kgv/5r9HqJDu7rn0ARgt1zfwjk8VmXGaNCAAAAAElFTkSuQmCC Date: Wed, 03 Sep 2014 01:57:53 +0200 Message-ID: <877g1l60e6.fsf@gmx.us> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/24.4.50 (gnu/linux) MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Provags-ID: V03:K0:9Ww/3W8KkQBMYTk3IJxa7pm3kTjIHiyv4cCChJAmqsNUIw/ppdE ZzCgWiSOzVY5tE2osVjcZ6GMEhSkWnnMVjS4mLppq2620MV4xLocidzobPp0zSD8pWrTII7 bXwjrId63+vMZK1/7tcBLXAY8Tie3HXPwKxRUKHJiuYET7cPlJbKA16BrKwJRFI2ElD+Prt SJeS+7hxQkNFcXC1trtCQ== X-UI-Out-Filterresults: notjunk:1; X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x [generic] X-detected-operating-system: by eggs.gnu.org: Error: Malformed IPv6 address (bad octet value). X-Received-From: 2001:4830:134:3::11 X-Spam-Score: -5.0 (-----) X-Debbugs-Envelope-To: submit X-Mailman-Approved-At: Tue, 02 Sep 2014 20:11:55 -0400 X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: debbugs-submit-bounces@debbugs.gnu.org Sender: "Debbugs-submit" X-Spam-Score: -5.0 (-----) --=-=-= Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Hi, [I tried to send this report earlier, though it seems something went wrong. If it did already show up: sorry about the noise]. Recently, I get an error every time I open a new file in my document folder due to `vc-git-conflicted-files'. The function was introduced in revno: 117697 committer: Eric S. Raymond branch nick: trunk timestamp: Wed 2014-08-13 04:05:45 -0400 message: Integrate R=C3=BCdiger Sonderfeld's code for detecting=20 conflicted files under git. Background: My document folder is stored in a git annex direct-mode folder (see http://git-annex.branchable.com/). git annex is used for keeping folders in sync across computers, and is build on top of git. In my particular setup (direct mode) "git status" returns nil (or an empty string). However, `vc-git-conflicted-files' expects it to return a non-trivial string. The attach patch addresses this by checking that git status did in fact returned non-nil. Please let me know (preferably with wide reply) if you want me to fix the problem in some other way. I have signed papers to FSF. Thanks, Rasmus In GNU Emacs 24.4.50.1 (x86_64-unknown-linux-gnu, GTK+ Version 3.12.2) of 2014-08-25 on W530 Repository revision: dmantipov@yandex.ru-20140825070042-1o6sutsne8cexjdb Windowing system distributor `The X.Org Foundation', version 11.0.11600000 System Description: Arch Linux --=20 Er du tosset for noge' l=C3=A5rt! --=-=-= Content-Type: text/x-diff Content-Disposition: inline; filename=fix-vc-git-conflict.patch === modified file 'lisp/ChangeLog' *** lisp/ChangeLog 2014-08-25 03:16:36 +0000 --- lisp/ChangeLog 2014-08-25 23:12:30 +0000 *************** *** 1,3 **** --- 1,8 ---- + 2014-08-25 Rasmus Pank Roulund + + * vc/vc-git.el (vc-git-conflicted-files): Fix bug when git status + returns nil. + 2014-08-25 Christoph Scholtes * subr.el (remq): Fix docstring (Bug#18253). === modified file 'lisp/vc/vc-git.el' *** lisp/vc/vc-git.el 2014-08-13 08:42:33 +0000 --- lisp/vc/vc-git.el 2014-08-25 22:59:45 +0000 *************** This prompts for a branch to merge from. *** 774,790 **** "Return the list of files with conflicts in DIRECTORY." (let* ((status (vc-git--run-command-string directory "status" "--porcelain" "--")) ! (lines (split-string status "\n" 'omit-nulls)) files) ! (dolist (line lines files) ! (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" ! line) ! (let ((state (match-string 1 line)) ! (file (match-string 2 line))) ! ;; See git-status(1). ! (when (member state '("AU" "UD" "UA" ;; "DD" ! "DU" "AA" "UU")) ! (push file files))))))) (defun vc-git-resolve-when-done () "Call \"git add\" if the conflict markers have been removed." --- 774,791 ---- "Return the list of files with conflicts in DIRECTORY." (let* ((status (vc-git--run-command-string directory "status" "--porcelain" "--")) ! (lines (when status (split-string status "\n" 'omit-nulls))) files) ! (when lines ! (dolist (line lines files) ! (when (string-match "\\([ MADRCU?!][ MADRCU?!]\\) \\(.+\\)\\(?: -> \\(.+\\)\\)?" ! line) ! (let ((state (match-string 1 line)) ! (file (match-string 2 line))) ! ;; See git-status(1). ! (when (member state '("AU" "UD" "UA" ;; "DD" ! "DU" "AA" "UU")) ! (push file files)))))))) (defun vc-git-resolve-when-done () "Call \"git add\" if the conflict markers have been removed." --=-=-=-- ------------=_1409848562-22236-1--