From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: npostavs@users.sourceforge.net Newsgroups: gmane.emacs.bugs Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Date: Wed, 15 Mar 2017 20:42:54 -0400 Message-ID: <87efxy59wx.fsf@users.sourceforge.net> References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: multipart/mixed; boundary="=-=-=" X-Trace: blaine.gmane.org 1489624931 25666 195.159.176.226 (16 Mar 2017 00:42:11 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 16 Mar 2017 00:42:11 +0000 (UTC) Cc: Jonathan Ganc To: 26066@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 16 01:42:07 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJUV-0006Iv-Jd for geb-bug-gnu-emacs@m.gmane.org; Thu, 16 Mar 2017 01:42:07 +0100 Original-Received: from localhost ([::1]:40136 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coJUb-0002KD-KZ for geb-bug-gnu-emacs@m.gmane.org; Wed, 15 Mar 2017 20:42:13 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45509) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1coJUV-0002K5-BK for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 20:42:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1coJUQ-0003HR-Ek for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 20:42:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:59503) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1coJUQ-0003HI-AM for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 20:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1coJUP-0005MH-Uk for bug-gnu-emacs@gnu.org; Wed, 15 Mar 2017 20:42:01 -0400 X-Loop: help-debbugs@gnu.org In-Reply-To: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> Resent-From: npostavs@users.sourceforge.net Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 16 Mar 2017 00:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 26066 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.148962490420568 (code B ref 26066); Thu, 16 Mar 2017 00:42:01 +0000 Original-Received: (at 26066) by debbugs.gnu.org; 16 Mar 2017 00:41:44 +0000 Original-Received: from localhost ([127.0.0.1]:57702 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJU7-0005Lg-Tx for submit@debbugs.gnu.org; Wed, 15 Mar 2017 20:41:44 -0400 Original-Received: from mail-it0-f52.google.com ([209.85.214.52]:37341) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1coJU6-0005LT-Gk for 26066@debbugs.gnu.org; Wed, 15 Mar 2017 20:41:42 -0400 Original-Received: by mail-it0-f52.google.com with SMTP id g138so30736890itb.0 for <26066@debbugs.gnu.org>; Wed, 15 Mar 2017 17:41:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:from:to:cc:subject:date:message-id:mime-version; bh=gkFzTfWvWnbuYK/4HsI2iRT410Cr6McQj3QWl+PI3aE=; b=a9EcluGpL6Jo/N7V5f7ku6ZQrkndqh7/NMM6FHl8QRyVO5FpzMK1ECNAOEjksUqtIH 6eFkDUxj9CdKAjXtuEhkmjdMJCUij9krkLwI4lKIbPHstXEmZIV2fQQoJZ2C8YPL6Kvm qKeLId934pq1JnZjAU7bAU3PlWdR9SqwlrybmioWyosMcKUzv/+U0XJxkDNniicDzpvR sMsoxifnWSyYnZkgO0SyRzeE3mmgLUTk+SYtP4aW1NKnRC7R9K+nPggME+Wj0Yig0Ra4 qUwP9I8c06zbcovF24MfIQu1mWYAGkBzEx9U+xgxITpYKGHWTQvvvFpI7STKm+yXHXQm wnCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:from:to:cc:subject:date:message-id :mime-version; bh=gkFzTfWvWnbuYK/4HsI2iRT410Cr6McQj3QWl+PI3aE=; b=W+RFrqPpjkdg0vPCVjv5eomMC+NMH4Js1iVaPjwfT69nhaqCDCgTr0b05NXuZc5cME yn0zhpac73efyJDiCkrZAbILIqcvaBk45BvwW8vbYwemIpIplTi5ZCCstaV5XUWOoNyn oV3AEg8dENWbYfcH3/V8ddsBKXgG/1sV2luOf9tvOkaOWlPrHy4TmY4MZYVCPBG7IkCl mI5A0nSC8SAgj5408JiJ1YvLCeujFY7u2rgIGRdLgpksISvta4d5fHh5YNVY6riAlG4L taiyZubWNy/pzBPGXRH25aHAKIVo+wnCzUS9PH3KGO9TxsnF6iEe7I0JL/sfHL/hoc/K uYMQ== X-Gm-Message-State: AFeK/H333d04D7VXhXh8Y44zUddnmW/0NthTbjVp6qtSdU5kH+NzK92/m0mfl92iMAyAlQ== X-Received: by 10.36.212.129 with SMTP id x123mr7521975itg.103.1489624896791; Wed, 15 Mar 2017 17:41:36 -0700 (PDT) Original-Received: from zony ([45.2.7.65]) by smtp.googlemail.com with ESMTPSA id f196sm299226itc.2.2017.03.15.17.41.35 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 15 Mar 2017 17:41:35 -0700 (PDT) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:130632 Archived-At: --=-=-= Content-Type: text/plain [Please use Reply All to keep 26066@debbugs.gnu.org on Cc] --=-=-= Content-Type: message/rfc822 Content-Disposition: inline Subject: Re: bug#26066: 26.0.50; vc-git-status gives wrong result To: npostavs@users.sourceforge.net References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87y3w855vj.fsf@users.sourceforge.net> From: Jonathan Ganc Message-ID: <6fb773c4-5f05-1965-8fb1-a425cefbfddd@gmail.com> Date: Tue, 14 Mar 2017 20:25:57 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 In-Reply-To: <87y3w855vj.fsf@users.sourceforge.net> X-Spam-Score: -1.1 (-) X-Spam-Report: Spam Filtering performed by mx.sourceforge.net. See http://spamassassin.org/tag/ for more details. -1.5 SPF_CHECK_PASS SPF reports sender host as permitted sender for sender-domain 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider (jonganc[at]gmail.com) -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at http://www.dnswl.org/, no trust [209.85.220.171 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.5 RCVD_IN_SORBS_SPAM RBL: SORBS: sender is a spam source [209.85.220.171 listed in dnsbl.sorbs.net] X-Headers-End: 1cnwlQ-0001HR-Bi MIME-Version: 1.0 Content-Type: text/plain The actual problem is with the function vc-git--empty-db-p, which acts in the directory default-directory (implicitly, through vc-git--call and then process-file). Thus, I think replacing (in vc-git-state) (vc-git--empty-db-p) with (let ((default-directory (file-name-directory file))) (vc-git--empty-db-p)) should resolve the issue without side effect. As an aside, is there a reason that vc-git-status does not use "git status -z --porcelain --ignored"? It seems more natural/straightfoward and it would also deal with ignored and removed files. It could also work with directories, which the current function doesn't. --=-=-= Content-Type: text/plain Let-binding default-directory sounds okay. Regarding 'status -z --porcelain', I think it might not have been available at the time te code was written. I'm not sure how far back we need to maintain compatibility. --=-=-=--