GNU bug report logs - #11605
24.1.50; vc-ediff revert annoyance

Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.

Package: emacs; Reported by: William Xu <william.xwl@HIDDEN>; Keywords: patch confirmed; dated Sat, 2 Jun 2012 04:34:02 UTC; Maintainer for emacs is bug-gnu-emacs@HIDDEN.

Message received at 11605 <at> debbugs.gnu.org:


Received: (at 11605) by debbugs.gnu.org; 24 Feb 2016 06:34:20 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Wed Feb 24 01:34:20 2016
Received: from localhost ([127.0.0.1]:42363 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.84)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1aYT1g-0002GX-7h
	for submit <at> debbugs.gnu.org; Wed, 24 Feb 2016 01:34:20 -0500
Received: from hermes.netfonds.no ([80.91.224.195]:40965)
 by debbugs.gnu.org with esmtp (Exim 4.84)
 (envelope-from <larsi@HIDDEN>) id 1aYT1e-0002GP-Sw
 for 11605 <at> debbugs.gnu.org; Wed, 24 Feb 2016 01:34:19 -0500
Received: from cpe-60-225-211-161.nsw.bigpond.net.au ([60.225.211.161]
 helo=mouse)
 by hermes.netfonds.no with esmtpsa (TLS1.0:RSA_AES_128_CBC_SHA1:16)
 (Exim 4.72) (envelope-from <larsi@HIDDEN>)
 id 1aYT1B-0003Oz-17; Wed, 24 Feb 2016 07:33:49 +0100
From: Lars Ingebrigtsen <larsi@HIDDEN>
To: William Xu <william.xwl@HIDDEN>
Subject: Re: bug#11605: 24.1.50; vc-ediff revert annoyance
References: <CACzMC-AyMUwxot1UPP-a8WhCURvjHrH_9nqkPEZhknzMhygZSg@HIDDEN>
Date: Wed, 24 Feb 2016 17:33:44 +1100
In-Reply-To: <CACzMC-AyMUwxot1UPP-a8WhCURvjHrH_9nqkPEZhknzMhygZSg@HIDDEN>
 (William Xu's message of "Sat, 2 Jun 2012 12:31:10 +0800")
Message-ID: <87twkybos7.fsf@HIDDEN>
User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1.50 (gnu/linux)
MIME-Version: 1.0
Content-Type: text/plain
X-MailScanner-ID: 1aYT1B-0003Oz-17
X-Netfonds-MailScanner: Found to be clean
X-Netfonds-MailScanner-From: larsi@HIDDEN
MailScanner-NULL-Check: 1456900432.28124@OBIBVpdNjrMn+MrORa2sKw
X-Spam-Status: No
X-Spam-Score: 0.0 (/)
X-Debbugs-Envelope-To: 11605
Cc: 11605 <at> debbugs.gnu.org
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.18
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <https://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <https://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit/>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <https://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>, 
 <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
Sender: "Debbugs-submit" <debbugs-submit-bounces <at> debbugs.gnu.org>
X-Spam-Score: 0.0 (/)

William Xu <william.xwl@HIDDEN> writes:

>   1. emacs -Q
>   2. visit a version controlled file, say `foo'.
>   3. M-x vc-ediff, run it couple of times.
>
> You will see this annoying message many times:
>
>   File foo.~master~ changed on disk.  Reread from disk? (yes or no)

I can confirm that this bug is still present in the Emacs trunk.

> The reason is the ~master~ file is checked out everytime we run
> vc-ediff, and after ediff session, the ~master~ buffer is always left
> there, hence, when running vc-ediff multiple times it constantly asks
> you whether you want to revert.  Why not let it revert automatically?
>
> How about this patch?

[...]

I think the patch sounds reasonable, but the vc machinery is something
with which I'm not overly familiar.

Could somebody take a peek at this patch?

> From d2af0f4dcc81b39d9360135244d6870388a264a3 Mon Sep 17 00:00:00 2001
> From: William Xu <william.xwl@HIDDEN>
> Date: Sat, 2 Jun 2012 12:16:45 +0800
> Subject: [PATCH] (vc-find-revision): Auto revert file revision buffer
>  quietly.
>
> ---
>  lisp/vc/vc.el |    6 ++++--
>  1 files changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/lisp/vc/vc.el b/lisp/vc/vc.el
> index 87e4e1c..bd337d0 100644
> --- a/lisp/vc/vc.el
> +++ b/lisp/vc/vc.el
> @@ -1815,11 +1815,13 @@ Use BACKEND as the VC backend if specified."
>  		(delete-file filename))))
>  	  (vc-mode-line file))
>  	(message "Checking out %s...done" filename)))
> -    (let ((result-buf (find-file-noselect filename)))
> +    (let ((result-buf (or (get-file-buffer filename)
> +                          (find-file-noselect filename))))
>        (with-current-buffer result-buf
>  	;; Set the parent buffer so that things like
>  	;; C-x v g, C-x v l, ... etc work.
> -	(set (make-local-variable 'vc-parent-buffer) filebuf))
> +	(set (make-local-variable 'vc-parent-buffer) filebuf)
> +        (revert-buffer nil t))
>        result-buf)))
>  
>  ;; Header-insertion code

-- 
(domestic pets only, the antidote for overdose, milk.)
   bloggy blog: http://lars.ingebrigtsen.no




Information forwarded to bug-gnu-emacs@HIDDEN:
bug#11605; Package emacs. Full text available.
Added tag(s) confirmed. Request was from Lars Ingebrigtsen <larsi@HIDDEN> to control <at> debbugs.gnu.org. Full text available.

Message received at submit <at> debbugs.gnu.org:


Received: (at submit) by debbugs.gnu.org; 2 Jun 2012 04:33:10 +0000
From debbugs-submit-bounces <at> debbugs.gnu.org Sat Jun 02 00:33:09 2012
Received: from localhost ([127.0.0.1]:53723 helo=debbugs.gnu.org)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <debbugs-submit-bounces <at> debbugs.gnu.org>)
	id 1Sag1V-0006ix-Jh
	for submit <at> debbugs.gnu.org; Sat, 02 Jun 2012 00:33:09 -0400
Received: from eggs.gnu.org ([208.118.235.92]:49493)
	by debbugs.gnu.org with esmtp (Exim 4.72)
	(envelope-from <william.xwl@HIDDEN>) id 1Sag1T-0006ic-96
	for submit <at> debbugs.gnu.org; Sat, 02 Jun 2012 00:33:07 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <william.xwl@HIDDEN>) id 1Safzh-0001l1-0S
	for submit <at> debbugs.gnu.org; Sat, 02 Jun 2012 00:31:18 -0400
X-Spam-Checker-Version: SpamAssassin 3.3.2 (2011-06-06) on eggs.gnu.org
X-Spam-Level: 
X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00,FREEMAIL_FROM,
	RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=unavailable version=3.3.2
Received: from lists.gnu.org ([208.118.235.17]:46589)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <william.xwl@HIDDEN>) id 1Safzg-0001ku-Qv
	for submit <at> debbugs.gnu.org; Sat, 02 Jun 2012 00:31:16 -0400
Received: from eggs.gnu.org ([208.118.235.92]:53438)
	by lists.gnu.org with esmtp (Exim 4.71)
	(envelope-from <william.xwl@HIDDEN>) id 1Safzf-0006na-9v
	for bug-gnu-emacs@HIDDEN; Sat, 02 Jun 2012 00:31:16 -0400
Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71)
	(envelope-from <william.xwl@HIDDEN>) id 1Safzd-0001kb-DR
	for bug-gnu-emacs@HIDDEN; Sat, 02 Jun 2012 00:31:14 -0400
Received: from mail-vb0-f41.google.com ([209.85.212.41]:38371)
	by eggs.gnu.org with esmtp (Exim 4.71)
	(envelope-from <william.xwl@HIDDEN>) id 1Safzd-0001kD-6p
	for bug-gnu-emacs@HIDDEN; Sat, 02 Jun 2012 00:31:13 -0400
Received: by vbbey12 with SMTP id ey12so2021313vbb.0
	for <bug-gnu-emacs@HIDDEN>; Fri, 01 Jun 2012 21:31:10 -0700 (PDT)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113;
	h=mime-version:date:message-id:subject:from:to:content-type;
	bh=XzB6nrulGGmn4/ODNiJ6Cut8Bl1+g3VoB2PVcWD1myc=;
	b=UOQ8jzf54LQu+w2GJSTCeCGXzd6ctWDO6i3/uRDoEayvA66rUuiCQSRK4nms7slACH
	wWiWUbMonU5OBEzhDC/0HzXGIHleGhQuh9dkyFVpE+eMnPgIyg/Ec61tJj6v2E5r3DRk
	e+VAMfzBa9chEMHF7xsDodvdrZfw9T2gMwdyvHSC9MpVdgNbzUx0V7LzDBuKs7EWfcBo
	J5hE1GhLUwq6gwsk1p5a8xNmjtZzEwxbbEl+ZUGLBb72en3AlpLr0rTmi+tFOZHdrf2U
	QVpgvRITLfffqnzz6uxr11/Mg80uFuZOxo78nAhc4w81JuKTCKqsaTc8Azdirfc/L0Pa
	tGgA==
MIME-Version: 1.0
Received: by 10.220.115.135 with SMTP id i7mr5038584vcq.29.1338611470776; Fri,
	01 Jun 2012 21:31:10 -0700 (PDT)
Received: by 10.52.69.139 with HTTP; Fri, 1 Jun 2012 21:31:10 -0700 (PDT)
Date: Sat, 2 Jun 2012 12:31:10 +0800
Message-ID: <CACzMC-AyMUwxot1UPP-a8WhCURvjHrH_9nqkPEZhknzMhygZSg@HIDDEN>
Subject: 24.1.50; vc-ediff revert annoyance
From: William Xu <william.xwl@HIDDEN>
To: bug-gnu-emacs@HIDDEN
Content-Type: multipart/mixed; boundary=f46d043d67ef353afd04c175c546
X-detected-operating-system: by eggs.gnu.org: Genre and OS details not
	recognized.
X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3)
X-Received-From: 208.118.235.17
X-Spam-Score: -6.1 (------)
X-Debbugs-Envelope-To: submit
X-BeenThere: debbugs-submit <at> debbugs.gnu.org
X-Mailman-Version: 2.1.13
Precedence: list
List-Id: <debbugs-submit.debbugs.gnu.org>
List-Unsubscribe: <http://debbugs.gnu.org/cgi-bin/mailman/options/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=unsubscribe>
List-Archive: <http://debbugs.gnu.org/cgi-bin/mailman/private/debbugs-submit>
List-Post: <mailto:debbugs-submit <at> debbugs.gnu.org>
List-Help: <mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=help>
List-Subscribe: <http://debbugs.gnu.org/cgi-bin/mailman/listinfo/debbugs-submit>,
	<mailto:debbugs-submit-request <at> debbugs.gnu.org?subject=subscribe>
Sender: debbugs-submit-bounces <at> debbugs.gnu.org
Errors-To: debbugs-submit-bounces <at> debbugs.gnu.org
X-Spam-Score: -6.1 (------)

--f46d043d67ef353afd04c175c546
Content-Type: text/plain; charset=UTF-8

Steps to reproduce:

  1. emacs -Q
  2. visit a version controlled file, say `foo'.
  3. M-x vc-ediff, run it couple of times.

You will see this annoying message many times:

  File foo.~master~ changed on disk.  Reread from disk? (yes or no)

The reason is the ~master~ file is checked out everytime we run
vc-ediff, and after ediff session, the ~master~ buffer is always left
there, hence, when running vc-ediff multiple times it constantly asks
you whether you want to revert.  Why not let it revert automatically?

How about this patch?

-- 
William

http://xwl.appspot.com

--f46d043d67ef353afd04c175c546
Content-Type: application/octet-stream; 
	name="0001-vc-find-revision-Auto-revert-file-revision-buffer-qu.patch"
Content-Disposition: attachment; 
	filename="0001-vc-find-revision-Auto-revert-file-revision-buffer-qu.patch"
Content-Transfer-Encoding: base64
X-Attachment-Id: f_h2y6p6uq0

RnJvbSBkMmFmMGY0ZGNjODFiMzlkOTM2MDEzNTI0NGQ2ODcwMzg4YTI2NGEzIE1vbiBTZXAgMTcg
MDA6MDA6MDAgMjAwMQpGcm9tOiBXaWxsaWFtIFh1IDx3aWxsaWFtLnh3bEBnbWFpbC5jb20+CkRh
dGU6IFNhdCwgMiBKdW4gMjAxMiAxMjoxNjo0NSArMDgwMApTdWJqZWN0OiBbUEFUQ0hdICh2Yy1m
aW5kLXJldmlzaW9uKTogQXV0byByZXZlcnQgZmlsZSByZXZpc2lvbiBidWZmZXIK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QtYnVmZmVy
IG5pbCB0KSkKICAgICAgIHJlc3VsdC1idWYpKSkKIAogOzsgSGVhZGVyLWluc2VydGlvbiBjb2Rl
Ci0tIAoxLjcuOC4yCgo=
--f46d043d67ef353afd04c175c546--




Acknowledgement sent to William Xu <william.xwl@HIDDEN>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs@HIDDEN. Full text available.
Report forwarded to bug-gnu-emacs@HIDDEN:
bug#11605; Package emacs. Full text available.
Please note: This is a static page, with minimal formatting, updated once a day.
Click here to see this page with the latest information and nicer formatting.
Last modified: Wed, 24 Feb 2016 06:45:01 UTC

GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997 nCipher Corporation Ltd, 1994-97 Ian Jackson.