From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Jonathan Ganc Newsgroups: gmane.emacs.bugs Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Date: Tue, 11 Apr 2017 09:08:35 -0400 Message-ID: <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> References: <9bf82bf1-fefa-ab84-bac1-cf748ae5ccfb@gmail.com> <87efxy59wx.fsf@users.sourceforge.net> <0d87686b-c7d2-deab-ebe4-ab1c8aa4faca@yandex.ru> <29d4a5ae-0ca0-3a86-6b9a-ab616803f39e@gmail.com> <4741bddf-9765-0d94-d0cd-b94e3e4914e1@yandex.ru> <8530cd03-0158-f198-9b14-ade983e1c7f4@gmail.com> <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> NNTP-Posting-Host: blaine.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: blaine.gmane.org 1491916156 22750 195.159.176.226 (11 Apr 2017 13:09:16 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2017 13:09:16 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.8.0 To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org, Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Tue Apr 11 15:09:11 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 1cxvXj-0005qB-0l for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Apr 2017 15:09:11 +0200 Original-Received: from localhost ([::1]:39195 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxvXo-0006GR-KF for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Apr 2017 09:09:16 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:48211) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxvXd-0006FF-AG for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 09:09:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxvXa-0003hR-4y for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 09:09:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43857) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxvXa-0003hG-0i for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 09:09:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cxvXZ-0007F1-Lt for bug-gnu-emacs@gnu.org; Tue, 11 Apr 2017 09:09:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 11 Apr 2017 13:09: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.149191612427806 (code B ref 26066); Tue, 11 Apr 2017 13:09:01 +0000 Original-Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 13:08:44 +0000 Original-Received: from localhost ([127.0.0.1]:42056 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxvXI-0007EQ-97 for submit@debbugs.gnu.org; Tue, 11 Apr 2017 09:08:44 -0400 Original-Received: from mail-qk0-f195.google.com ([209.85.220.195]:36153) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxvXG-0007ED-Av for 26066@debbugs.gnu.org; Tue, 11 Apr 2017 09:08:42 -0400 Original-Received: by mail-qk0-f195.google.com with SMTP id v75so24001965qkb.3 for <26066@debbugs.gnu.org>; Tue, 11 Apr 2017 06:08:42 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=cuO/fWJYW+H6zgr/n0lPOgNTmQMCSPCE6y3ApEtX5v0=; b=qnKmbpNep+r+dW7Y/pZolY5yhKquRcerzCXEqltQyx6bPPKCAgCX+88uYrAWfRfncH nUcaz8V2/+xk97KFzb9MTNsLVzGQakczLHwPgcGefW1AVdjIKXCqwOKRfJL0tIOPrY1Y lm9OsRcYhR4xDS+0cvXzkcN4R2yYBob7l3MXFKc9TVG1/ZfKqI/SYJSBm7YOUw0tBwpt eG18XGMP55kmcL7J512hh9W6dPaAJwjHbUVWb5pEZ2agPt1TjZHw1HczynXrHo0AfwLV RLGV5tLIn7odF4zUlGMY5IwEjBKXTBOnxI/7192dIW77vVM90GMaL3jjbEso2fmX26cA ScsA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=cuO/fWJYW+H6zgr/n0lPOgNTmQMCSPCE6y3ApEtX5v0=; b=HXkLi+Wt7uPSdlaky3kKrKP4cZzJgwClgD1n92FUv/alU2URdybIUxLGfriS0ajkjN NFP8aipOI7pM0p8gpXlMG+Bc7L9g41ZYSb5cNE08dg5AAU05nRSa0NFSZlxY5e/ZishN ktBg85Yv9IjFk3mwwna33xXdGvdsFXZ/IBorfEwOaD+f1bhKtr9cloAdFQY9xaaKJww/ rMvnMT5xq3gqftMTEBDILkyXCHiJ+uiOeEr/iZzfUWUPBJ4qrzTVxyrYgkcxUfFIZxXx 7rIzE2uRB4BBUpoOFuBdCco0QQPKUDsVUNnNgtO6VJXAzuO95VzceXLYP4XEVOHXtvMc AUkw== X-Gm-Message-State: AN3rC/6Xw5wEOd8cH3QQvS0v3CLRcM9mw/aSaU0j7E3ytreBgwG//EJlSj5jWpsoUsNe5g== X-Received: by 10.55.210.1 with SMTP id f1mr16718107qkj.165.1491916116857; Tue, 11 Apr 2017 06:08:36 -0700 (PDT) Original-Received: from [192.168.1.198] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id s28sm10971877qts.65.2017.04.11.06.08.35 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Apr 2017 06:08:36 -0700 (PDT) In-Reply-To: <1a23269d-1ead-1771-1afd-e2c9c5840cb4@gmail.com> 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:131469 Archived-At: I think I've changed my mind about where/whether to bind default-directory. Since it is not universally bound by all vcs engines, it should probably be considered "backend specific", which would therefore suggest that it not be bound before the backend specific functions, e.g. vc-git-state. On the other hand, since it sometimes is necessary for correct output, I do think it should be bound in vc-git-state. On 04/10/2017 11:52 PM, Jonathan Ganc wrote: > > The binding affects the output if default-directory is not set inside > the file's repository. > > Since, in principle, the vc functions should be agnostic to the choice > of vcs, either a) vc-state documentation should state that > default-directory should be set to get generally correct responses or > b) it should be set in some function (and I agree that > vc-state-refresh makes sense). > > I think the overhead of setting the directory is rather low. In some > admittedly rudimentary benchmarks, there is almost no difference in > performance setting default-directory. > > There's also the question of how to handle default-directory. You > cannot simply do (file-name-directory file), because that fails if > FILE is given without a directory. I think the correct one is > (file-name-directory (expand-file-name file)) (which, surprisingly, is > slighly faster than (file-name-directory (concat default-directory > file)) ).