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: Tue, 11 Apr 2017 03:07:21 +0300 Message-ID: <505388da-e642-8c98-35c0-261d09ff13e1@yandex.ru> 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 1491869298 7471 195.159.176.226 (11 Apr 2017 00:08:18 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Tue, 11 Apr 2017 00:08:18 +0000 (UTC) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.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 Tue Apr 11 02:08:09 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 1cxjLs-0001o1-SN for geb-bug-gnu-emacs@m.gmane.org; Tue, 11 Apr 2017 02:08:09 +0200 Original-Received: from localhost ([::1]:36531 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxjLy-0006Qi-PO for geb-bug-gnu-emacs@m.gmane.org; Mon, 10 Apr 2017 20:08:14 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:34675) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1cxjLr-0006Qb-DY for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2017 20:08:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1cxjLm-00007S-GL for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2017 20:08:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:43523) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1cxjLm-00007O-D7 for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2017 20:08:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1cxjLm-0007FC-1M for bug-gnu-emacs@gnu.org; Mon, 10 Apr 2017 20:08: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: Tue, 11 Apr 2017 00:08: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.149186925127805 (code B ref 26066); Tue, 11 Apr 2017 00:08:01 +0000 Original-Received: (at 26066) by debbugs.gnu.org; 11 Apr 2017 00:07:31 +0000 Original-Received: from localhost ([127.0.0.1]:41722 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxjLH-0007EP-Ir for submit@debbugs.gnu.org; Mon, 10 Apr 2017 20:07:31 -0400 Original-Received: from mail-wr0-f179.google.com ([209.85.128.179]:33637) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1cxjLF-0007ED-Ov for 26066@debbugs.gnu.org; Mon, 10 Apr 2017 20:07:30 -0400 Original-Received: by mail-wr0-f179.google.com with SMTP id l28so29183429wre.0 for <26066@debbugs.gnu.org>; Mon, 10 Apr 2017 17:07:29 -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=Oku28FYCZff8JN7a2eGSHqOE3AU4WfQ/B3hl1/tobUk=; b=GKS4K5rQbZqrTkjzkvhVrMZJeibua1cjTvPI0GoB+QWEc0+UkMlB6RqY0uNo9fO8I9 2cPPtuQk/ycVG8A/N1DDe66l+CH62eS0GvlhVneDSUAJejobTx0YQhDSdh3RG/uue+3U 4k+muWKZBTtptcVxk1zGd6DT3cwRpK9I2RzVysbat/jfGQr0rfNQ42d4rJ2iMYqlgqFj 3EghxWKeYjOf729hhMrbZkwH06t6xXda8c6EmhIXLzgAXTwpZvODGeqWuvMDozYsyYT8 peIjVxXeq4v/JXX2zAr4vlSkP7sz9gD7QA7cnf9uOI7j3xhyd+R7q/TmH1zi/OotEVSX IfBA== 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=Oku28FYCZff8JN7a2eGSHqOE3AU4WfQ/B3hl1/tobUk=; b=fd11rcvsRe4l+H/SZrtuUbgpkIfOZPJt0u6EAhQ6ggmYascex8PTY34kOrm+3L4P6O jKOy+vqZDyTdo2dV5g+PLAPpWVV1oPGYz2NVnpEdTAhnqycmDedMU2tU6u3WGNHiUdfw Yd0qEYZzfWELfPOzCBinucnYo27csanQQ8A+6N94g0OJSssCWU3kZqb4ugzEALU+PIag pGsFN/RLfwfEemcoLv5lWMNN6FqEKt2w8b+TNBO35v/QGBPYKnngVWRLDDu6hBkjwVM7 GKjKTLLiroEejgnmg2rGr5EIPaSVkRrdLVBkEkJxROwC79vxKgIRs9QoesdjxnlMD84b 9xhg== X-Gm-Message-State: AN3rC/75j6uG+cyf8rMEO1VhGTn9hwWKiNq171+7CP/88Z0JzQ/dKQGN8z84cgdrqMQY7g== X-Received: by 10.223.163.17 with SMTP id c17mr7884042wrb.186.1491869244164; Mon, 10 Apr 2017 17:07:24 -0700 (PDT) Original-Received: from [192.168.1.3] ([185.105.173.156]) by smtp.googlemail.com with ESMTPSA id h68sm211469wmd.19.2017.04.10.17.07.22 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 10 Apr 2017 17:07:23 -0700 (PDT) In-Reply-To: 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:131454 Archived-At: On 23.03.2017 04:18, Jonathan Ganc wrote: > 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. You are right. But we could set it in vc-state-refresh. > 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). That's also an option, yes. But binding it on the higher level would be better, I think. > 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. True. Some of those occurrences are most likely there just so the DIR argument is not left unused. Some have less obvious reasons. vc-git-checkin, for instance, does it to call 'git commit' from the repository root, instead of an arbitrary directory in it. I'm sure it's really necessary, though. > At the very least, the documentation for vc-git-state should note that > default-directory needs to be set. The backend-specific functions are largely internal, we don't expect clients to call them directly. If anything, the documentation can be clarified on whether an arbitrary backend's 'state' command should set default-directory, or use the current one. > 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)`. Yeah, diff-hl-dired does something like that. If all the "interesting" statuses in a directory are the same, we assign it that status. If they're mixed, we mark it as "changed".