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: Sun, 01 Jul 2012 03:38:15 +0400 Message-ID: <4FEF8DE7.8010103@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> 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 1341099525 14470 80.91.229.3 (30 Jun 2012 23:38:45 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Sat, 30 Jun 2012 23:38:45 +0000 (UTC) Cc: 11757@debbugs.gnu.org, Michael Albinus To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Sun Jul 01 01:38:44 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 1Sl7FU-0001Js-Cq for geb-bug-gnu-emacs@m.gmane.org; Sun, 01 Jul 2012 01:38:44 +0200 Original-Received: from localhost ([::1]:45851 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl7FU-0000WE-B4 for geb-bug-gnu-emacs@m.gmane.org; Sat, 30 Jun 2012 19:38:44 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:60793) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl7FP-0000Rq-8a for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2012 19:38:40 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1Sl7FN-0004Yt-De for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2012 19:38:38 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:58315) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1Sl7FN-0004YZ-3U for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2012 19:38:37 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1Sl7Jd-0006It-N6 for bug-gnu-emacs@gnu.org; Sat, 30 Jun 2012 19:43:01 -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: Sat, 30 Jun 2012 23:43:01 +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.134109976724210 (code B ref 11757); Sat, 30 Jun 2012 23:43:01 +0000 Original-Received: (at 11757) by debbugs.gnu.org; 30 Jun 2012 23:42:47 +0000 Original-Received: from localhost ([127.0.0.1]:39628 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7JP-0006IR-C3 for submit@debbugs.gnu.org; Sat, 30 Jun 2012 19:42:47 -0400 Original-Received: from forward13.mail.yandex.net ([95.108.130.120]:56095) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1Sl7JK-0006I7-FV for 11757@debbugs.gnu.org; Sat, 30 Jun 2012 19:42:44 -0400 Original-Received: from smtp11.mail.yandex.net (smtp11.mail.yandex.net [95.108.130.67]) by forward13.mail.yandex.net (Yandex) with ESMTP id 38D7C140F2F; Sun, 1 Jul 2012 03:38:15 +0400 (MSK) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yandex.ru; s=mail; t=1341099495; bh=Sp1PHgqyYvTkh8pt2IksxrJxOVvabxoO9gJTc33jHNw=; h=Message-ID:Date:From:MIME-Version:To:CC:Subject:References: In-Reply-To:Content-Type:Content-Transfer-Encoding; b=sAqGbOJ/ct6OcFppX5AaFIwnGzaS1GkmBMI+qX+R69JRUMnGqvPoqYuMCLazO4qKa Qe/TNLTY8B7z8r4mGI78nKGGNElljFHs0iwgPIk1D+c64QKzWnF3rTEqoucEEAvhKz xYA4QMskCb4/1TED7b5rLaDI/AkIRf/mcsO+L3tc= Original-Received: from smtp11.mail.yandex.net (localhost [127.0.0.1]) by smtp11.mail.yandex.net (Yandex) with ESMTP id 07B8A7E04BB; Sun, 1 Jul 2012 03:38:14 +0400 (MSK) Original-Received: from 98-87.nwlink.spb.ru (98-87.nwlink.spb.ru [178.252.98.87]) by smtp11.mail.yandex.net (nwsmtp/Yandex) with ESMTP id cEViMRjd-cEVunbl1; Sun, 1 Jul 2012 03:38:14 +0400 X-Yandex-Rcpt-Suid: monnier@iro.umontreal.ca 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=1341099494; bh=Sp1PHgqyYvTkh8pt2IksxrJxOVvabxoO9gJTc33jHNw=; h=Message-ID:Date:From:User-Agent:MIME-Version:To:CC:Subject: References:In-Reply-To:Content-Type:Content-Transfer-Encoding; b=g7+erdFukc6UxYbHmJYVdIi8Ec+ez3jWQdMtg16cAO46MuEP04invbbLZZO40R1BE BZDZBhCy1ajEIc+xnxBbcjt/h45FKzVeWj5ZXwDDiFgBAhuVfI65P2Zs7Z2gcfYyzg UWKwVnHInl9H9X5KvPgdMeFeviXBL30zaFr2Oil8= User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:13.0) Gecko/20120614 Thunderbird/13.0.1 In-Reply-To: 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:61452 Archived-At: On 01.07.2012 3:01, Stefan Monnier wrote: >> This won't happen in following cases: >> 1) We switch to revision when the opened file is the same. >> 2) It doesn't exist there. >> 3) We just delete it from disk from outside of Emacs. >> So the file isn't changed, and you see no warning or update, even after you >> write it to disk from Emacs again. > > While that is suboptimal, VC's state is often suboptimal like that. > The only cases where VC's state is (or at least really should) > up-to-date is: > - when it was changed by an explicit VC action. > - when we need to know the state in order to make an important decision. > Updating the state in other circumstances is good, but not necessary. > Improving VC so that the first case is more frequent would actually > be preferable. AFAIK, the second case with `vc-git-registered' only occurs in `vc-next-action', where it can call `vc-register' if appropriate. For that to happen, in `vc-deduce-fileset' either (vc-backend buffer-file-name) should return nil, or (vc-state ...) - 'unregistered. So, in all variations on the theme "file unchanged, but not in git index anymore" this won't be true, neither with my original patch, nor with the currently installed code. Invalidating property 'git-registered in `vc-deduce-fileset' might fix that, but having it know about Git backend is probably not good at all, and AFAIK most other backends just detect all states with a single process call, including 'unregistered (so they don't call their -registered function from -state function). -- Dmitry