From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#26066: 26.0.50; vc-git-status gives wrong result Date: Mon, 1 May 2017 04:57:33 +0300 Message-ID: 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> <30d8b181-d869-de24-9c86-cc1dc6ec461b@gmail.com> <6ea0d89d-1a24-30fe-dd9a-26a0157a4eae@yandex.ru> <01922284-4265-6510-feee-dcc7301787ad@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 1493603894 7225 195.159.176.226 (1 May 2017 01:58:14 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Mon, 1 May 2017 01:58:14 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:53.0) Gecko/20100101 Thunderbird/53.0 To: Jonathan Ganc , 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 Mon May 01 03:58:10 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 1d50bI-0001mN-Fl for geb-bug-gnu-emacs@m.gmane.org; Mon, 01 May 2017 03:58:08 +0200 Original-Received: from localhost ([::1]:46507 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d50bO-0004gE-AV for geb-bug-gnu-emacs@m.gmane.org; Sun, 30 Apr 2017 21:58:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50433) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1d50bF-0004g6-TY for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2017 21:58:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1d50bC-0006Nq-O4 for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2017 21:58:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:50127) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1d50bC-0006Ng-IU for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2017 21:58:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1d50bC-0001RA-Bj for bug-gnu-emacs@gnu.org; Sun, 30 Apr 2017 21:58:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 01 May 2017 01:58:02 +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: patch Original-Received: via spool by 26066-submit@debbugs.gnu.org id=B26066.14936038635499 (code B ref 26066); Mon, 01 May 2017 01:58:02 +0000 Original-Received: (at 26066) by debbugs.gnu.org; 1 May 2017 01:57:43 +0000 Original-Received: from localhost ([127.0.0.1]:48326 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50at-0001Qd-4o for submit@debbugs.gnu.org; Sun, 30 Apr 2017 21:57:43 -0400 Original-Received: from mail-wr0-f196.google.com ([209.85.128.196]:35615) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1d50ar-0001QQ-A8 for 26066@debbugs.gnu.org; Sun, 30 Apr 2017 21:57:41 -0400 Original-Received: by mail-wr0-f196.google.com with SMTP id g12so12745094wrg.2 for <26066@debbugs.gnu.org>; Sun, 30 Apr 2017 18:57:41 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:subject:to:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=Szf+N6KDVAK7RNO8w0r2Iosk1f92/jc+2Z6gcyvnQk8=; b=gwtCvCbVK8S2zl2ME4/r7FBBixjIqdlcavWboLsF0T0fBpWDgDuYez1CDRtBlzwHkB cRb3wy2jZlG7v2bpmei/ByR/T4HjJmeO2ePl/DFXTclcrsIPHWul13CxWIVFprlGMhiH SW86gqxSF1a/TthJzVEjnkbkm+vzGDEzPHAUZ+HVjTvDduxgPpPA7kruFMmZELKtvitQ GdrmUvU/drIJGxTs1dw9OkIhzgOd6Jls8GPM215t1OG65CJYpDjxA3V2Uv16l2/fYqwY JONuI9raSkdfrqmCD8tLYCVOov2AAWGuxtkMqhw3/o+5gb/IZNN6zDP9jkQinmsnCjER FCFQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:subject:to:references:from:message-id :date:user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Szf+N6KDVAK7RNO8w0r2Iosk1f92/jc+2Z6gcyvnQk8=; b=DJMac39gro93T+Yj2brCbKndQkTaaA+WeDuPkNGa2vjJT/hNxg1+0T2BXQvUJaZBIX 8qsqwKjgaLkmd/uMk8IQRPagRaqUOMP9XumUHD5cAHIWXYA592ELs6eLo0O5jB9m9KGK z62AR0QpLBCwLKqwrnApUoS5IQIaxhJm7gCTwT6gpDEQ+ZHej+0cYiOQEbpOLDDQotty BiuTfCl14Q9EO71bH1395xf2b1K38JnlHToBZ1IENfmiZTbjoAo7Y/hcQuC3xAvRUMaK ocPmJDVjZo3dDwo1e8yG6z1wevk8+9uAo156DdnzANWaAHAPkd3Rfc2k/bK1u10hY5uh 7Urw== X-Gm-Message-State: AN3rC/5nEAJP1uCVSPT7R246fGE3hMGBcBdQnzW74OquA18QGL62sgeX SEfj8Ekc0aX7/A== X-Received: by 10.223.139.146 with SMTP id o18mr8594722wra.146.1493603855636; Sun, 30 Apr 2017 18:57:35 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id 39sm14045331wru.50.2017.04.30.18.57.34 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 30 Apr 2017 18:57:35 -0700 (PDT) In-Reply-To: <01922284-4265-6510-feee-dcc7301787ad@gmail.com> Content-Language: en-US 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:132146 Archived-At: On 14.04.2017 3:42, Jonathan Ganc wrote: > First, I'm sorry for this delayed response. I've had a busy few days > (and I needed to think about the issue)! I'm sorry about the delay as well. > I'm fine with decoupling the question about default-directory from the > patch for git status. I have attached a patch that does not bind > default-directory. (And I now have turned in the assignment paperwork to > the FSF!). Thanks! That part is applied now. >> If vc-git supports calling vc-git-state from outside of the >> repository, but not some other commands, or if vc-git-state does but >> some other backends' vc-xx-state does not, this will increase >> inconsistency and make it harder for the programmers to write >> VCS-agnostic code, which is one of the main goals of VC. > > But being vcs-agnostic is more for people who use vc-state or > vc-state-refresh, rather than people actually writing the vc-specific > functions, no? The vc-specific functions are supposed to conform to the common interface. To be as indistinguishable as feasible. > If this bug is unchanged, people using vc-state have to > ask themselves: "if the backend is git, I have to bind default-directory > but if it's not, I don't." That is inconsistent with vc agnosticism. If that was only the Git backend's problem, I might have agreed. However, not all other backends bind default-directory. Bzr doesn't, as one example. Hg and SVN seem to do that, though. If you have a chance to experiment with some other popular ones, please do. But what about the problems like "I don't have to bind default-directory when calling vc-state, but I still have to do that when calling other backend commands"? > That's a valid question and a valid point. But I actually think that > adding the binding in vc-git-state furthers the goal of systematically > answering them. Since we'll have to hunt down every other command that needs it (or, worse, wait for bug reports and thus spread that effort across several Emacs releases), I'm not so sure it would be a great step. > I doubt we'll be able to find, at one time, people with > knowledge of more than 4 or 5 of the vc's (e.g. I know only git) who > have the time to address this issue. I think we only have 4-5 backends which correspond to reasonably popular version control systems. The rest can simply follow their example. > What we can do instead, though, is > to encourage people to properly write the backend specific functions. How? > The fact that I can't argue in general that an arbitrary vc > system needs default-directory set suggests to me that one should leave > it to the vc system to decide. For example, I could imagine a backend > that wants the current directory to be the root directory of the > repository, rather than the directory containing the file. Such backend (I'm not aware of any, though) could still rebind default-directory inside its function.