From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!not-for-mail From: Jonathan Kamens Newsgroups: gmane.emacs.bugs Subject: bug#11490: vc-next-action overwrites changes in non-checked-out RCS file Date: Wed, 16 May 2012 21:17:34 -0400 Message-ID: <4FB451AE.60508@kamens.us> References: <4FB40003.3050502@kamens.us> NNTP-Posting-Host: plane.gmane.org Mime-Version: 1.0 Content-Type: multipart/alternative; boundary="------------060409000703030501020402" X-Trace: dough.gmane.org 1337217538 17235 80.91.229.3 (17 May 2012 01:18:58 GMT) X-Complaints-To: usenet@dough.gmane.org NNTP-Posting-Date: Thu, 17 May 2012 01:18:58 +0000 (UTC) Cc: 11490@debbugs.gnu.org To: Glenn Morris Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu May 17 03:18:57 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 1SUpMn-00032U-JO for geb-bug-gnu-emacs@m.gmane.org; Thu, 17 May 2012 03:18:57 +0200 Original-Received: from localhost ([::1]:37063 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUpMm-0004J6-Qf for geb-bug-gnu-emacs@m.gmane.org; Wed, 16 May 2012 21:18:56 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:42582) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUpMi-0004Ij-LD for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 21:18:54 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1SUpMg-0006Hz-U8 for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 21:18:52 -0400 Original-Received: from debbugs.gnu.org ([140.186.70.43]:48758) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1SUpMg-0006Hf-NJ for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 21:18:50 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.72) (envelope-from ) id 1SUpMr-00037R-Vs for bug-gnu-emacs@gnu.org; Wed, 16 May 2012 21:19:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Jonathan Kamens Original-Sender: debbugs-submit-bounces@debbugs.gnu.org Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 17 May 2012 01:19:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 11490 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: Original-Received: via spool by 11490-submit@debbugs.gnu.org id=B11490.133721749211919 (code B ref 11490); Thu, 17 May 2012 01:19:01 +0000 Original-Received: (at 11490) by debbugs.gnu.org; 17 May 2012 01:18:12 +0000 Original-Received: from localhost ([127.0.0.1]:58301 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUpM3-00036B-Sh for submit@debbugs.gnu.org; Wed, 16 May 2012 21:18:12 -0400 Original-Received: from jik3.kamens.brookline.ma.us ([128.177.28.63]:41482) by debbugs.gnu.org with esmtp (Exim 4.72) (envelope-from ) id 1SUpLj-00035T-BJ for 11490@debbugs.gnu.org; Wed, 16 May 2012 21:18:10 -0400 Original-Received: from jik2.kamens.brookline.ma.us (jik2-openvpn [10.100.65.34]) (authenticated bits=0) by jik3.kamens.brookline.ma.us (8.13.8/8.13.8) with ESMTP id q4H1HYvM005940 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO); Wed, 16 May 2012 21:17:37 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:15.0) Gecko/15.0 Thunderbird/15.0a1 In-Reply-To: X-Scanned-By: MIMEDefang 2.73 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:60095 Archived-At: This is a multi-part message in MIME format. --------------060409000703030501020402 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Try it without making the file writable. This happens, e.g., if a file is edited as root by a user using vim, which doesn't care whether it's writable or not, since it's root doing the editing, and then by a user using Emacs, which /does/ care because it detects VC and thus makes the file read-only in Emacs. The user's first impulse will be to type C-x v v, which will overwrite the previous editor's changes. The problem goes away when vc-mistrust-permissions is set to true. I would argue that C-x v v should always check the status of a file with vc-mistrust-permissions set to true (or the logical equivalent) before overwriting its contents and potentially losing data. jik --------------060409000703030501020402 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Try it without making the file writable.

This happens, e.g., if a file is edited as root by a user using vim, which doesn't care whether it's writable or not, since it's root doing the editing, and then by a user using Emacs, which does care because it detects VC and thus makes the file read-only in Emacs. The user's first impulse will be to type C-x v v, which will overwrite the previous editor's changes.

The problem goes away when vc-mistrust-permissions is set to true.

I would argue that C-x v v should always check the status of a file with vc-mistrust-permissions set to true (or the logical equivalent) before overwriting its contents and potentially losing data.

  jik

--------------060409000703030501020402--