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: Wed, 22 Mar 2017 22:18:25 -0400 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> 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 1490235557 18090 195.159.176.226 (23 Mar 2017 02:19:17 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 23 Mar 2017 02:19:17 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 To: Dmitry Gutov , npostavs@users.sourceforge.net, 26066@debbugs.gnu.org Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Mar 23 03:19:13 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 1cqsLB-0003hG-M8 for geb-bug-gnu-emacs@m.gmane.org; Thu, 23 Mar 2017 03:19:05 +0100 Original-Received: from localhost ([::1]:54015 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqsLH-000398-Qa for geb-bug-gnu-emacs@m.gmane.org; Wed, 22 Mar 2017 22:19:11 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:54888) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cqsLB-000392-HA for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 22:19:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cqsL8-000833-Ar for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 22:19:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41772) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cqsL8-00082y-6w for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 22:19:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cqsL8-0002QL-1P for bug-gnu-emacs@gnu.org; Wed, 22 Mar 2017 22:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Ganc Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 23 Mar 2017 02:19: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.14902355159281 (code B ref 26066); Thu, 23 Mar 2017 02:19:01 +0000 Original-Received: (at 26066) by debbugs.gnu.org; 23 Mar 2017 02:18:35 +0000 Original-Received: from localhost ([127.0.0.1]:39971 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqsKg-0002Pd-VM for submit@debbugs.gnu.org; Wed, 22 Mar 2017 22:18:35 -0400 Original-Received: from mail-qk0-f194.google.com ([209.85.220.194]:35140) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cqsKf-0002PR-65 for 26066@debbugs.gnu.org; Wed, 22 Mar 2017 22:18:33 -0400 Original-Received: by mail-qk0-f194.google.com with SMTP id o135so28480938qke.2 for <26066@debbugs.gnu.org>; Wed, 22 Mar 2017 19:18:33 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:subject:to:references:message-id:date:user-agent:mime-version :in-reply-to:content-transfer-encoding; bh=babLhV8iCh4Ba7QSYoGavZ9oxtyVMDKtoG9ZtoB5PRk=; b=vG19Oa86rPUZzOT57POoNX7yIOgl0EBG5sk+jnPZuTJem4dFkExbSj0Ou2cN4iaH3M f3aZq31c4ZIAPnIlrsHry95KD//Djkhkk+6VaAsLZKCxo/hh08zyagT1xpJJW/vuK6pk swbq4Rv/lmpy7i1RB7Wh8tm+opAPp1TcID8Q5sU0w46dkFCOXvOvk7yPDjUxqYpHsUK/ 9tFvvd6Y/bZqbG0ZpD9+DZp0BVQVWbhI/zZn/SP0QnMaes9gC2MCYZeeEH1zoXIY9RRh 7/Bvim5zl/VnSSJJi2wlowGii0+7ip3yd1Z/IWj49hI+NRHhG0mPHReCqPGEuK9z0gt7 Zjqw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:subject:to:references:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=babLhV8iCh4Ba7QSYoGavZ9oxtyVMDKtoG9ZtoB5PRk=; b=KFuWukX7WXCSVWj7tqz/HZ46vJ4mbhqGBD5p/ygGAnjYuf8gLTtH1RHdafsam+ug/w MrtPiFpBkxwLCJXZihge41pt4gMH7Jf7I9MukcRMJ2hUmwLQsk0DAsnaIWvjCVo8mxqj RzaxiYC7IOIwpXeeXPa6oePNDSXYclHBE2L0depXBKKwnWj/jXTPdfiJKQ1Or4+LL/OL /+eIo2TRpJvZFzML7PLMyirziFxoCHl/68ccWZBg4HaHvwK3wG/30VKFAtiWPIvNz6xO Tjuwig1dIeKMxOWzjGAsejDxNqWckocBaiCmxloLLoNc5PNG6MfahYLR/vBuovMmJ/6I icog== X-Gm-Message-State: AFeK/H1p7x+QWWcXamKVosaI/0cMQjjK6/aG+PX1GGZ7UHZN5hC7XkNXNYNuHG5o4TSSpQ== X-Received: by 10.55.12.67 with SMTP id 64mr73857qkm.291.1490235507605; Wed, 22 Mar 2017 19:18:27 -0700 (PDT) Original-Received: from [192.168.1.200] (static-98-118-34-152.bstnma.fios.verizon.net. [98.118.34.152]) by smtp.gmail.com with ESMTPSA id o91sm2296296qte.42.2017.03.22.19.18.26 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 22 Mar 2017 19:18:26 -0700 (PDT) In-Reply-To: <022c0e0a-e039-24ef-66ff-82bcedbacd93@yandex.ru> 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:130830 Archived-At: Hi, Thanks for both responses. >> 3. It would be nice to be able to show mutiple directory trees at >> once in Neotree, though this is not as important. > > If it's unable to show the non-current projects, how is the bug > triggered? default-directory would have to be outside of the project. I'm not actually sure why it is causing me problems. I just tried using Neotree and encountered this problem. I didn't try anything special besides opening the window. I'm not sure how/why Neotree sets default-directory. I need to look into this. > The problem might have gone unnoticed until now because file's status > is cached, and because it can only be apparent if several projects are > opened at the same time. > > While the problem is fairly obvious, a proper fix would most likely > touch other backends and commands, to the point that the > default-directory binding might have to be done inside vc-call-backend. Yeah, I'm not really sure what the workflow should be; I'm just getting started with the vc functions in emacs. One issue, though, is that default-directory can only be set for functions that identify a filename, because we need to have a directory to set things to. For this reason, I don't know that one could generally set default-directory in vc-call-backend. It could make sense to set default-directory for vc-git--run-command-string (although to get vc-git-state to work, one would still need to set it for vc-git--empty-db-p). It's worth nothing there seems to be inconsistency within vc-git. Some commands like vc-git-checkin, vc-git-next-revision, do set default-directory to the directory of the input file; other comands like vc-git-merge-branch seem to do the opposite and assume the root is already given by default-directory. At the very least, the documentation for vc-git-state should note that default-directory needs to be set. > > There is a very simple workaround on the caller's side, though: bind > default-directory inside the Neotree code, to the respective project > root (or just the file's parent directory). That will be necessary > anyway for it to work in the released Emacs versions. > That may be the best answer. I am not so familiar with the Neotree code but it should be doable. >> 2. I would like to be able to color directories as well as files. I >> don't know if that is something that would have a component in >> vc-git.el / vc-....el or would go entirely in some package (e.g. >> Neotree) > > This differs from one version control system to another, but Git > doesn't actually track directories. So the notion of "directory > status" is poorly defined. But see the previously mentioned > diff-hl-dired-mode. > You're right, in principle, but atom handles it by coloring directories based on if they have modified files within. I don't know if there is a "canonical" way to do this, although one idea would be to return a list of all file status in the directory, e.g. `(up-to-date modified ignored)`. I started looking through diff-hl. It looks like it has a bunch of neat and useful features, though I admit I was a bit confused by the workflow.