From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Dmitry Gutov Newsgroups: gmane.emacs.bugs Subject: bug#11757: Acknowledgement (24.1.50; vc-git calls `process-file' too many times) Date: Mon, 02 Jul 2012 16:42:28 +0400 Message-ID: <4FF19734.7090700@yandex.ru> References: <4FE2832A.1030308@yandex.ru> <4FE994E8.9020605@yandex.ru> <87zk7qs21q.fsf@gmx.de> <4FEBAAAA.3030102@yandex.ru> <87d34igrie.fsf@gmx.de> <4FEDD2A0.3010300@yandex.ru> <878vf66pgw.fsf@gmx.de> <4FEDDFD8.1010407@yandex.ru> <87wr2pgoiy.fsf@gmx.de> <4FEEF763.2060806@yandex.ru> <878vf5544d.fsf@gmx.de> <4FEF3A87.6000904@yandex.ru> <874nps63ki.fsf@gmx.de> <4FEF500A.9060103@yandex.ru> <87pq8f4xbv.fsf@gmx.de> <4FF062D7.7050402@yandex.ru> <878vf2sf7q.fsf@gmx.de> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Trace: dough.gmane.org 1341233028 10420 80.91.229.3 (2 Jul 2012 12:43:48 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Mon, 2 Jul 2012 12:43:48 +0000 (UTC) Cc: 11757@debbugs.gnu.org To: Michael Albinus Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Mon Jul 02 14:43:47 2012 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by plane.gmane.org with esmtp (Exim 4.69) (envelope-from ) id 1Slfyi-00056i-VW for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2012 14:43:45 +0200 Original-Received: from localhost ([::1]:49536 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Slfyh-0008WF-N1 for geb-bug-gnu-emacs@m.gmane.org; Mon, 02 Jul 2012 08:43:43 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:41005) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Slfyf-0008Ve-1u for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 08:43:42 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SlfyT-00034H-MC for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 08:43:40 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:60251) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SlfyT-00033y-AG for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 08:43:29 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Slg2t-0001iK-6Q for bug-gnu-emacs@gnu.org; Mon, 02 Jul 2012 08:48:03 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Dmitry Gutov Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 02 Jul 2012 12:48:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11757 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11757-submit@debbugs.gnu.org id=B11757.13412332346525 (code B ref 11757); Mon, 02 Jul 2012 12:48:02 +0000 Original-Received: (at 11757) by debbugs.gnu.org; 2 Jul 2012 12:47:14 +0000 Original-Received: from localhost ([127.0.0.1]:41564 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Slg24-0001h9-8P for submit@debbugs.gnu.org; Mon, 02 Jul 2012 08:47:13 -0400 Original-Received: from forward2.mail.yandex.net ([77.88.46.7]:46831) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Slg1x-0001gt-KF for 11757@debbugs.gnu.org; Mon, 02 Jul 2012 08:47:09 -0400 Original-Received: from smtp4.mail.yandex.net (smtp4.mail.yandex.net [77.88.46.104]) by forward2.mail.yandex.net (Yandex) with ESMTP id CF11612A1261; Mon, 2 Jul 2012 16:42:28 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341232948; bh=b9p09jPYWmaQZePHmvpxJmvCZp5zrm5UITjCv5/qw+s=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=D0m2WHvmGrwz91RKh1lOmsBRfAo4y6+45oucxRZKPxISrKQCUM6fGTuXi4kEx9q3o ww0w8WPt1wSFp1UCX2IqBEn9xh/WMmndZygnD1qMWgY4dnHAqQodTxQcQ26WhFKjW9 2vgcjDGZnW10e1JGVqcor/NG+m8ZXQrbpU2ZfOBo= Original-Received: from smtp4.mail.yandex.net (localhost [127.0.0.1]) by smtp4.mail.yandex.net (Yandex) with ESMTP id ACF655C0570; Mon, 2 Jul 2012 16:42:28 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp4.mail.yandex.net (nwsmtp/Yandex) with ESMTP id gSK8g1Bs-gSKu8BTh; Mon, 2 Jul 2012 16:42:28 +0400 X-Yandex-Rcpt-Suid: michael.albinus@gmx.de X-Yandex-Rcpt-Suid: 11757@debbugs.gnu.org DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341232948; bh=b9p09jPYWmaQZePHmvpxJmvCZp5zrm5UITjCv5/qw+s=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=c+VR5uI7kV88ilp+iSs/F0Udr07xKhdUnH4oXAIKI+VkbYACrRO0QGP3WAXWSFZoG L1zOAtudGgY3TqQ0fupZYbL74eaowT87Ee7aEFTWB9Eq5j5c61RGegHJeEAUTA6oKs mGuWnQxYDNVub3PXq4r2+2uisaXDJTikkMMQhxoY= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: <878vf2sf7q.fsf@gmx.de> X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.13 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 2) X-Received-From: 140.186.70.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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:61487 Archived-At: On 02.07.2012 13:08, Michael Albinus wrote: > Dmitry Gutov writes: > >>> Likely, the best option is to call (vc-registered file) after clearing >>> the file cache. This recomputes the 'vc-backend property as well, what >>> we want. >> >> Have you tried this? (vc-backend file) gets called just a bit later, >> in `vc-after-save`, and it calls `vc-registered' in turn, but since >> the file is no longer registered with Git, it returns nil, and the >> mode-line is not updated. > > Well, I've played with it. Scenario: I believe both scenarios below would work just as well with my original patch. > - Have a git-controlled file on disk > - Load it in Emacs. > - Remove it on disk, outside Emacs. > - Save it from Emacs > > In vc-before-save, the file cache is cleared 'cause the file doesn't > exist any longer. As you said, vc-backend is called afterwards, > recomputing some of the properties. The file shows the correct modeline, > "Git:master". If you just removed it on disk, without committing the change, doing (vc-state-refresh) would correctly recompute its status as 'removed even without calling (vc-registered). That's not the status we have a problem with ('unregistered is). > 2nd scenario: > > - Switch to another branch ("git checkout test") > - Remove the file on disk, outside Emacs. > - Save it from Emacs > > And now the modeline shows "Git:test", as expected. Was the file absent in the branch test after checkout? If not, this case is no different from the first. Basically, we need a scenario in which `vc-next-action' will need to call `vc-git-register' on a file that recently has been considered 'up-to-date. >> So from this standpoint, saving and restoring 'vc-backend value around >> clearing props in `vc-before-save' might indeed be the best solution. > > I believe, we even don't need this. The current code DTRT, and clearing > the properties happens only when the file has been removed. I believe we can either not call 'vc-git-registered' from `vc-git-state' at all (caching 'vc-registered is not needed in this case), or we should fix some scenario which benefits from us doing that. The logic is rather complicated there, so I might easily be missing some examples. If so, please tell. -- Dmitry