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#21383: Static revisions in vc-working-revision Date: Thu, 3 Sep 2015 15:56:34 +0300 Message-ID: <55E84382.3030209@yandex.ru> References: <55E41499.5030501@yandex.ru> <55E5094A.3010108@yandex.ru> <55E59487.1050804@yandex.ru> <55E5CA42.1080005@yandex.ru> <55E5DF1A.9010902@yandex.ru> <55E6D426.10105@yandex.ru> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: ger.gmane.org 1441285046 14121 80.91.229.3 (3 Sep 2015 12:57:26 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2015 12:57:26 +0000 (UTC) Cc: 21383-done@debbugs.gnu.org To: Jonathan H Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 14:57:12 2015 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 1ZXU4l-0008TU-LK for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 14:57:11 +0200 Original-Received: from localhost ([::1]:47827 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXU4k-0000S9-2o for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 08:57:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:59185) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXU4g-0000S1-0t for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 08:57:06 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXU4c-00044H-RR for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 08:57:05 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55145) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXU4c-000443-Nn for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 08:57:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXU4c-0000iE-6m for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 08:57: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: Thu, 03 Sep 2015 12:57:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 21383 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 21383-done@debbugs.gnu.org id=D21383.14412850062717 (code D ref 21383); Thu, 03 Sep 2015 12:57:02 +0000 Original-Received: (at 21383-done) by debbugs.gnu.org; 3 Sep 2015 12:56:46 +0000 Original-Received: from localhost ([127.0.0.1]:47355 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXU4L-0000hk-Gh for submit@debbugs.gnu.org; Thu, 03 Sep 2015 08:56:45 -0400 Original-Received: from mail-wi0-f176.google.com ([209.85.212.176]:36415) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXU4H-0000hW-8G for 21383-done@debbugs.gnu.org; Thu, 03 Sep 2015 08:56:42 -0400 Original-Received: by wibz8 with SMTP id z8so97980984wib.1 for <21383-done@debbugs.gnu.org>; Thu, 03 Sep 2015 05:56:40 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=sender:subject:to:references:cc:from:message-id:date:user-agent :mime-version:in-reply-to:content-type:content-transfer-encoding; bh=KLYEKAXXlIQQwfzbt3OWZWMw4JfFgGjNeIHJDRTSTjs=; b=hBvWt19TxeAwdhWfYBvQ/teXtdv622IMzHIjKYqgk8y3iROZvFl5YfDPPerY2s6/8R ZfBarAIEpM/e/eA0zetk8wxXHu7WCf55L2nm+yHiwExdMCFVm34/qg/MwOFey9s89NZC oAg+0iYIK2wLMrg4+uQmAD87vKlJ6SJmD50Of2ww3v5JuTvYRJ1tyK6LtR3sFeolXuXN i0XPHtK1tnXhFdGCgL/udwQMjfSmjWCc5TFbYdRPBAcTCSBzLQs/PTC8PNenCawMa5u5 qSFJrE/LjYp7HoAaxIAz6Unnui2XrTLiRi7TkckhMtbbXFHi6fW52K1WCh4Ijd93rPBk +new== X-Received: by 10.194.7.106 with SMTP id i10mr26845020wja.86.1441285000538; Thu, 03 Sep 2015 05:56:40 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id fz5sm8894524wic.18.2015.09.03.05.56.39 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Sep 2015 05:56:39 -0700 (PDT) User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:40.0) Gecko/20100101 Thunderbird/40.0 In-Reply-To: X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.15 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 3.x 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-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Xref: news.gmane.org gmane.emacs.bugs:106106 Archived-At: On 09/03/2015 01:44 AM, Jonathan H wrote: > I'm using (vc-working-revision buffer-file-name (vc-responsible-backend > buffer-file-name)) to determine the current working revision. > > As far as I can tell, vc-working-revision will cache the current working > revision in a file property, but it doesn't know when to invalidate the > cache, so the results can be stale. Yes, invalidation of those properties could use some improvement. But if you're just worried about up-to-date results returned to your functions, you could remove the property before calling `vc-working-revision'. > In fact, in the specific case of > git, you probably can't get any faster than a rev-parse anyway, I wonder if that's true. Caching in a property is obviously fast, and process calls are necessarily an order of magnitude slower (and slower still on certain platforms). Maybe you should write a patch and test it on Windows (or have someone else do it), and see whether the mode-line updates don't become perceptibly slower. > I have a sneaking suspicion that git isn't the only backend where this > can happen. Probably. On the other hand, there are known backends where calling the backend program *is* slow. Such as Bazaar or (most likely) CVS.