From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.ciao.gmane.io!not-for-mail From: Juri Linkov Newsgroups: gmane.emacs.bugs Subject: bug#34949: 27.0.50; Docstring of `vc-deduce-fileset' incomplete Date: Wed, 19 Feb 2020 01:36:49 +0200 Organization: LINKOV.NET Message-ID: <87imk35uy6.fsf@mail.linkov.net> References: <877e5dzgnb.fsf@gnus.org> <932cfe15-5e8b-1bf4-5b81-9d0f2a513dea@yandex.ru> <87a77hqp6m.fsf@mail.linkov.net> <87zhdghjca.fsf@mail.linkov.net> <5d2163b9-4bf4-e072-ef9e-0fc1550a2108@yandex.ru> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="ciao.gmane.io:159.69.161.202"; logging-data="95812"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (x86_64-pc-linux-gnu) Cc: Lars Ingebrigtsen , 34949@debbugs.gnu.org To: Dmitry Gutov Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Wed Feb 19 00:38:13 2020 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1j4CRQ-000Oln-VX for geb-bug-gnu-emacs@m.gmane-mx.org; Wed, 19 Feb 2020 00:38:13 +0100 Original-Received: from localhost ([::1]:43264 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4CRP-0002V8-Mk for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 Feb 2020 18:38:11 -0500 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:59626) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1j4CRI-0002Ux-2N for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 18:38:05 -0500 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1j4CRG-0004Dv-AX for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 18:38:04 -0500 Original-Received: from debbugs.gnu.org ([209.51.188.43]:35497) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1j4CRG-0004Dj-3E for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 18:38:02 -0500 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1j4CRF-0008Ev-Vd for bug-gnu-emacs@gnu.org; Tue, 18 Feb 2020 18:38:01 -0500 X-Loop: help-debbugs@gnu.org Resent-From: Juri Linkov Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 Feb 2020 23:38:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 34949 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: confirmed Original-Received: via spool by 34949-submit@debbugs.gnu.org id=B34949.158206904931631 (code B ref 34949); Tue, 18 Feb 2020 23:38:01 +0000 Original-Received: (at 34949) by debbugs.gnu.org; 18 Feb 2020 23:37:29 +0000 Original-Received: from localhost ([127.0.0.1]:41470 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4CQj-0008E7-FT for submit@debbugs.gnu.org; Tue, 18 Feb 2020 18:37:29 -0500 Original-Received: from caracal.birch.relay.mailchannels.net ([23.83.209.30]:30606) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1j4CQh-0008Dy-ID for 34949@debbugs.gnu.org; Tue, 18 Feb 2020 18:37:28 -0500 X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 25FCF3421DD; Tue, 18 Feb 2020 23:37:26 +0000 (UTC) Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (100-96-38-98.trex.outbound.svc.cluster.local [100.96.38.98]) (Authenticated sender: dreamhost) by relay.mailchannels.net (Postfix) with ESMTPA id AD8523421C6; Tue, 18 Feb 2020 23:37:25 +0000 (UTC) X-Sender-Id: dreamhost|x-authsender|jurta@jurta.org Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com ([TEMPUNAVAIL]. [64.90.62.162]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.18.5); Tue, 18 Feb 2020 23:37:26 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: dreamhost|x-authsender|jurta@jurta.org X-MailChannels-Auth-Id: dreamhost X-Continue-Celery: 1cb8519901caa0f3_1582069045950_2566544044 X-MC-Loop-Signature: 1582069045950:1918878449 X-MC-Ingress-Time: 1582069045950 Original-Received: from pdx1-sub0-mail-a86.g.dreamhost.com (localhost [127.0.0.1]) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTP id 2D4717EF8A; Tue, 18 Feb 2020 15:37:20 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=linkov.net; h=from:to:cc :subject:references:date:in-reply-to:message-id:mime-version :content-type:content-transfer-encoding; s=linkov.net; bh=XAMOLB KTkKr0JURe+6IEGWhD8Nw=; b=m3yColhIjjS4jODsmfpgWQJugzuU3zh9I6v721 RHkLeZQxOJLMpb6GEfXd11x4BEiGFJeLwPmB3t57cR/dxIMkb6vWAzQtjJMDvh2C ZcoRBwVQnzTmwFe5lqbhNbtcbcerJiwY8w+vPnkPyI+PBSjjl6eUOhaZaQGpEcQs 4c1bI= Original-Received: from localhost.linkov.net (m91-129-103-27.cust.tele2.ee [91.129.103.27]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) (Authenticated sender: jurta@jurta.org) by pdx1-sub0-mail-a86.g.dreamhost.com (Postfix) with ESMTPSA id 651E87EF6E; Tue, 18 Feb 2020 15:37:16 -0800 (PST) X-DH-BACKEND: pdx1-sub0-mail-a86 In-Reply-To: <5d2163b9-4bf4-e072-ef9e-0fc1550a2108@yandex.ru> (Dmitry Gutov's message of "Wed, 19 Feb 2020 00:27:12 +0200") X-VR-OUT-STATUS: OK X-VR-OUT-SCORE: -100 X-VR-OUT-SPAMCAUSE: gggruggvucftvghtrhhoucdtuddrgedugedrjeelgddutdcutefuodetggdotefrodftvfcurfhrohhfihhlvgemucggtfgfnhhsuhgsshgtrhhisggvpdfftffgtefojffquffvnecuuegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenucfjughrpefhvffuohhfffgjkfgfgggtgfesthekredttderjeenucfhrhhomheplfhurhhiucfnihhnkhhovhcuoehjuhhriheslhhinhhkohhvrdhnvghtqeenucfkphepledurdduvdelrddutdefrddvjeenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhhouggvpehsmhhtphdphhgvlhhopehlohgtrghlhhhoshhtrdhlihhnkhhovhdrnhgvthdpihhnvghtpeeluddruddvledruddtfedrvdejpdhrvghtuhhrnhdqphgrthhhpefluhhrihcunfhinhhkohhvuceojhhurhhisehlihhnkhhovhdrnhgvtheqpdhmrghilhhfrhhomhepjhhurhhisehlihhnkhhovhdrnhgvthdpnhhrtghpthhtohepughguhhtohhvseihrghnuggvgidrrhhu 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: 209.51.188.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-mx.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.io gmane.emacs.bugs:176230 Archived-At: >> So I implemented this in vc-dired-deduce-fileset whose basic >> algorithm was taken from vc-dir-deduce-fileset. >> Now with this patch state changing VC operations are supported on mark= ed >> _files_ in dired. > > TBH, I'm not sure this is a win (we have VC-Dir for a reason), Often I need to quickly commit one or a few marked files in the same Dired directory without needlessly starting VC-Dir - this is when such feature comes handy. Even it's possible to mark files in several subdirectories inserted in the same Dired buffer. > but if you really want to be able to do that in Dired, why not. Please > feel free to install this. Installed to master. >> However, the need for the OBSERVER arg still remains because this patc= h >> doesn't support state changing VC operations on marked _directories_ i= n dired. >> It raises the error in this case: >> State changing VC operations on directories not supported in >> `dired-mode' >> State changing VC operations could be supported on directories as well= , >> but there are several possibilities to choose from, and I can't decide= : >> 1. On a marked directory get a state from all its files >> (probably this variant makes no sense) >> 2. On a marked directory get only files with a "modified" state >> (i.e. edited/added/removed) > > You can check out what diff-hl-dired does in this regard (and it does u= se > the dir-status-files command), though you would need to do something el= se > than its merging logic. Thanks, I use diff-hl-dired, but not realized it relies on dir-status-fil= es. Maybe dir-status-files could be simplified, so that it wouldn't require a special buffer to be current, and could be called in any buffer, but this simplification is not much needed. > That still leaves the downside (compared to VC-Dir) of being unable to > select individual files in subdirectories, but that's not fixable, I gu= ess. When calling the already supported =E2=80=98C-x v =3D=E2=80=99 (vc-diff) = on a subdirectory in Dired, it operates on all modified files, so it makes sense to commit exactly the same files whose diffs are displayed in the *vc-diff* buffer. The same way we could add a new command to commit all modified files in the repository. When =E2=80=98C-x v D=E2=80=99 (vc-root-diff) display= s the *vc-diff* buffer with all modifications, a new command like =E2=80=98C-x = v V=E2=80=99 could commit all of them. >> But the latter is not easy to implement because the needed functionali= ty >> is missing in VC, because the only VC method that is suitable for this= is >> 'dir-status-files' to get VC files from a directory but it's too tight= ly >> integrated with vc-dir and can't be easily separated, i.e. there is >> no easy way to do something like: >> (with-temp-buffer >> (vc-call-backend >> (vc-responsible-backend default-directory) 'dir-status-files def= ault-directory nil >> (lambda (entries &optional more-to-come) >> (message "! %S" entries)))) > > I think the only possible problem here is that lambda is invoked > asynchronously. But we can sleep while waiting for it. Would it be possible to call dir-status-files synchronously?