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 21:40:54 +0300 Message-ID: <55E89436.7050603@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> <55E84382.3030209@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 1441305744 23436 80.91.229.3 (3 Sep 2015 18:42:24 GMT) X-Complaints-To: usenet@ger.gmane.org NNTP-Posting-Date: Thu, 3 Sep 2015 18:42:24 +0000 (UTC) Cc: 21383-done@debbugs.gnu.org To: Jonathan H , Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Sep 03 20:42:13 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 1ZXZSd-0005CS-1L for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 20:42:11 +0200 Original-Received: from localhost ([::1]:51080 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXZSc-00086B-SZ for geb-bug-gnu-emacs@m.gmane.org; Thu, 03 Sep 2015 14:42:10 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:45204) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXZSZ-00081W-L1 for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 14:42:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1ZXZSU-0005k6-Mo for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 14:42:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:55696) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1ZXZSU-0005jw-JH for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 14:42:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.80) (envelope-from ) id 1ZXZSU-0001CO-58 for bug-gnu-emacs@gnu.org; Thu, 03 Sep 2015 14:42: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 18:42: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.14413056644537 (code D ref 21383); Thu, 03 Sep 2015 18:42:02 +0000 Original-Received: (at 21383-done) by debbugs.gnu.org; 3 Sep 2015 18:41:04 +0000 Original-Received: from localhost ([127.0.0.1]:47906 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXZRX-0001B7-L4 for submit@debbugs.gnu.org; Thu, 03 Sep 2015 14:41:03 -0400 Original-Received: from mail-wi0-f173.google.com ([209.85.212.173]:38788) by debbugs.gnu.org with esmtp (Exim 4.80) (envelope-from ) id 1ZXZRV-0001Ab-KV for 21383-done@debbugs.gnu.org; Thu, 03 Sep 2015 14:41:02 -0400 Original-Received: by wiclk2 with SMTP id lk2so17664943wic.1 for <21383-done@debbugs.gnu.org>; Thu, 03 Sep 2015 11:41:01 -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=GiD/DYxjIZYZJ3D3mQTf0KeIBiRBU90WnrL1gD7VEq8=; b=b/r5XtlGfBt4/sR2BBxRL1YNCYU+aGEjLlZMX+rFrqEkSIXXYPozz+WuA2EYW6srMA Bz040iNd2Axs1Jb4a/sGqYJY292L7w/sqq/eqIcuOKsA04HtPD8CcjNsAfU0c6eJiZ99 3RImWvBGmSJQy/CKwGDf4tJWNJksAtpv4XXxyEoxi4wYTVyi6cJoeXsVxWhQkraDxbrA dILWXyHFGcAZYvHEtgD8XpItoCy/oZmtxcKB0Xrn27/D0gVsJVB8OX3Mp7wWdLs2a9kq 8Mdfbe5EfBaJgSZpCeudX0dEybZDaOJ/lpanBVvYllsUGXTCW6TKFu2Bmcb5j1avYk0f 2U6w== X-Received: by 10.180.240.172 with SMTP id wb12mr17155519wic.64.1441305661002; Thu, 03 Sep 2015 11:41:01 -0700 (PDT) Original-Received: from [10.9.0.103] (nat.webazilla.com. [78.140.128.228]) by smtp.googlemail.com with ESMTPSA id m4sm39021146wjb.37.2015.09.03.11.40.59 (version=TLSv1/SSLv3 cipher=OTHER); Thu, 03 Sep 2015 11:41:00 -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:106122 Archived-At: On 09/03/2015 08:34 PM, Jonathan H wrote: > I though the new implementation of the vc-git mode line doesn't use > vc-working-revision, Please look at the definition. vc-working-revision is called once in the beginning of the function, and again through vc-default-mode-line-string. Even if we inlined the useful parts of vc-default-mode-line-string definition, calling vc-git-working-revision instead of vc-git--symbolic-ref is still inevitable in "detached" [Git] mode. > True, but you have to check that the cache is invalid somehow. If you > want to be super correct, a rev-parse is probably the fastest way. I We err on the side of speed currently, instead of correctness. The file properties are invalidated during certain operations, like saving or reverting the buffer. > suppose it would be pretty fast to check the mtime of the .git directory > inside emacs and invalidate that when it changes. Although filesystem > timestamps usually make me nervous, it's probably okay in this instance? I don't know, but it's probably not too hard to imagine a user with a terminally slow HDD. Maybe it'll be fast enough anyway, but someone will have to do a patch, and test.