GNU bug report logs - #9781
read-only prompt in vc-next-action

Previous Next

Package: emacs;

Reported by: Jan Djärv <jan.h.d <at> swipnet.se>

Date: Tue, 18 Oct 2011 06:39:02 UTC

Severity: minor

Found in version 24.0.90

Fixed in version 24.3

Done: Glenn Morris <rgm <at> gnu.org>

Bug is archived. No further changes may be made.

To add a comment to this bug, you must first unarchive it, by sending
a message to control AT debbugs.gnu.org, with unarchive 9781 in the body.
You can then email your comments to 9781 AT debbugs.gnu.org in the normal way.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Tue, 18 Oct 2011 06:39:03 GMT) Full text and rfc822 format available.

Acknowledgement sent to Jan Djärv <jan.h.d <at> swipnet.se>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Tue, 18 Oct 2011 06:39:04 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: bug-gnu-emacs <at> gnu.org
Subject: 24.0.90; VC can't commit removed files/directories.
Date: Tue, 18 Oct 2011 08:36:58 +0200
This bug report will be sent to the Bug-GNU-Emacs mailing list
and the GNU bug tracker at debbugs.gnu.org.  Please check that
the From: line contains a valid email address.  After a delay of up
to one day, you should receive an acknowledgement at that address.

Please write in English if possible, as the Emacs maintainers
usually do not have translators for other languages.

Please describe exactly what actions triggered the bug, and
the precise symptoms of the bug.  If you can, give a recipe
starting from `emacs -Q':

I'm surprised nobody has seen this.

In a bzr repository, do
% bzr rm some-file

and modify some other file.

Then in Emacs, do vc-dir on the directory where the file was.
Mark the file that is listed as removed.  Also mark the edited file.
Press v.

Expected result: I can type in a log message and commit.
Real result: A prompt in the minibuffer appears:
some-file is edited but read-only; make it writable and continue? (y/n) 

This is because in vc.el, vc-next-action there is this:

      (let ((ready-for-commit files))
	;; If files are edited but read-only, give user a chance to correct
	(dolist (file files)
	  (unless (file-writable-p file)
	    ;; Make the file+buffer read-write.
	    (unless (y-or-n-p (format "%s is edited but read-only; make it writable and continue? " file))
	      (error "Aborted"))
            ;; Maybe we somehow lost permissions on the directory.
            (condition-case nil
                (set-file-modes file (logior (file-modes file) 128))
              (error (error "Unable to make file writable")))

Files/directories that are removed are obviously not file-writable-p, so the logic is wrong.
Also, the choices in the question should be three:

1 Make writable and continue.
2 Don't make writable and continue
3 Abort

As it is now, you either exit on the "Aborted" error or if you try to continue on the "Unable to make file writable" error.

	Jan D.


If Emacs crashed, and you have the Emacs process in the gdb debugger,
please include the output from the following gdb commands:
    `bt full' and `xbacktrace'.
For information about debugging Emacs, please read the file
/Users/jhd/Applications/Emacs.app/Contents/Resources/etc/DEBUG.


In GNU Emacs 24.0.90.1 (x86_64-apple-darwin11.2.0, NS apple-appkit-1138.23)
of 2011-10-18 on zeplin
Windowing system distributor `Apple', version 10.3.1138
configured using `configure  '--verbose' '--enable-asserts' '--with-ns' '--without-x-toolkit' 'CFLAGS=-g''

Important settings:
  value of $LC_ALL: nil
  value of $LC_COLLATE: C
  value of $LC_CTYPE: nil
  value of $LC_MESSAGES: nil
  value of $LC_MONETARY: nil
  value of $LC_NUMERIC: nil
  value of $LC_TIME: nil
  value of $LANG: sv_SE.UTF-8
  value of $XMODIFIERS: nil
  locale-coding-system: utf-8-unix
  default enable-multibyte-characters: t

Major mode: Lisp Interaction

Minor modes in effect:
  desktop-save-mode: t
  delete-selection-mode: t
  icomplete-mode: t
  display-time-mode: t
  tooltip-mode: t
  mouse-wheel-mode: t
  tool-bar-mode: t
  menu-bar-mode: t
  file-name-shadow-mode: t
  global-font-lock-mode: t
  font-lock-mode: t
  auto-composition-mode: t
  auto-encryption-mode: t
  auto-compression-mode: t
  line-number-mode: t
  transient-mark-mode: t

Recent input:
<escape> x r e p o r t - e m <tab> <return>

Recent messages:
Loading /Users/jhd/lib/elisp/BAK-file.el (source)...done
Loading /Users/jhd/lib/elisp/ccsetup.el (source)...done
Loading icomplete...done
Loading desktop...done
No desktop file.
For information about GNU Emacs and the GNU system, type C-h C-a.

Load-path shadows:
None found.

Features:
(shadow sort gnus-util mail-extr message format-spec rfc822 mml mml-sec
mm-decode mm-bodies mm-encode mail-parse rfc2231 rfc2047 rfc2045
ietf-drums mm-util mail-prsvr mailabbrev mail-utils gmm-utils mailheader
emacsbug desktop cus-start cus-load msb delsel advice help-fns
advice-preload icomplete cc-mode cc-fonts easymenu cc-guess cc-menus
cc-cmds cc-styles cc-align cc-engine cc-vars cc-defs regexp-opt time
time-date tooltip ediff-hook vc-hooks lisp-float-type mwheel ns-win
tool-bar dnd fontset image fringe lisp-mode register page menu-bar
rfn-eshadow timer select scroll-bar mouse jit-lock font-lock syntax
facemenu font-core frame cham georgian utf-8-lang misc-lang vietnamese
tibetan thai tai-viet lao korean japanese hebrew greek romanian slovak
czech european ethiopic indian cyrillic chinese case-table epa-hook
jka-cmpr-hook help simple abbrev minibuffer loaddefs button faces
cus-face files text-properties overlay sha1 md5 base64 format env
code-pages mule custom widget hashtable-print-readable backquote
make-network-process ns multi-tty emacs)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Tue, 18 Oct 2011 07:01:02 GMT) Full text and rfc822 format available.

Message #8 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 9781 <at> debbugs.gnu.org
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Tue, 18 Oct 2011 02:59:05 -0400
Jan Djärv wrote:

> I'm surprised nobody has seen this.

It is a long-known issue that vc-dir does not handle removed files
totally correctly, though I haven't seen the particular symptoms you
describe.

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=3214




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Wed, 19 Oct 2011 07:03:01 GMT) Full text and rfc822 format available.

Message #11 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Dan Nicolaescu <dann <at> gnu.org>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>, 9781 <at> debbugs.gnu.org
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Wed, 19 Oct 2011 03:01:01 -0400
Glenn Morris <rgm <at> gnu.org> writes:

> Jan Djärv wrote:
>
>> I'm surprised nobody has seen this.
>
> It is a long-known issue that vc-dir does not handle removed files
> totally correctly,

The problem is in the vc-bzr backend.

vc-bzr-status should return nil when called for a file that has been
removed.  It does not.

Also it looks like there's a disconnect between 
bzr help status
[snip]
 unknown
      Not versioned and not matching an ignore pattern.


and the actual output:

bzr status NON_EXISTENT_FILE
nonexistent:
  NON_EXISTENT_FILE
bzr: ERROR: Path(s) do not exist: NON_EXISTENT_FILE
Exit 3





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Thu, 20 Oct 2011 21:07:02 GMT) Full text and rfc822 format available.

Message #14 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 9781 <at> debbugs.gnu.org
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Thu, 20 Oct 2011 17:05:21 -0400
Jan Djärv wrote:

> In a bzr repository, do
> % bzr rm some-file
>
> and modify some other file.
>
> Then in Emacs, do vc-dir on the directory where the file was.
> Mark the file that is listed as removed.  Also mark the edited file.
> Press v.
>
> Expected result: I can type in a log message and commit.
> Real result: A prompt in the minibuffer appears:
> some-file is edited but read-only; make it writable and continue? (y/n) 

Fixed. Now you will be able to commit (and then get bug#3214).

Actually the problem only happens with removed directories (because
file-writable-p also returns non-nil if a file can be created).
Recipe:

mkdir /tmp/foo
cd /tmp/foo
bzr init
mkdir subdir
touch file subdir/subfile
bzr add
bzr commit -m "c1"
bzr remove subdir
echo 1 >> file
emacs -Q
M-x vc-dir RET
M
v

> Also, the choices in the question should be three:
>
> 1 Make writable and continue.
> 2 Don't make writable and continue
> 3 Abort

Isn't ctrl-g good enough for aborting, rather than introducing a 3-state
question?





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Thu, 20 Oct 2011 21:12:02 GMT) Full text and rfc822 format available.

Message #17 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: 9781 <at> debbugs.gnu.org
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Thu, 20 Oct 2011 17:09:54 -0400
Glenn Morris wrote:

>> 1 Make writable and continue.
>> 2 Don't make writable and continue
>> 3 Abort
>
> Isn't ctrl-g good enough for aborting, rather than introducing a 3-state
> question?

Ignore that, I misunderstood option 2.
"Don't make writable, but continue committing anyway."
(Will that cause an error with whatever VCS this issue is still relevant for?)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Fri, 21 Oct 2011 09:16:02 GMT) Full text and rfc822 format available.

Message #20 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Glenn Morris <rgm <at> gnu.org>
Cc: "9781 <at> debbugs.gnu.org" <9781 <at> debbugs.gnu.org>
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Fri, 21 Oct 2011 11:13:58 +0200
[Message part 1 (text/plain, inline)]
Hello.


20 okt 2011 kl. 23:05 skrev Glenn Morris <rgm <at> gnu.org>:

> 
> Fixed. Now you will be able to commit (and then get bug#3214).
> 
> Actually the problem only happens with removed directories (because
> file-writable-p also returns non-nil if a file can be created).

I was indeed removing a directory.

> 
> 
>> Also, the choices in the question should be three:
>> 
>> 1 Make writable and continue.
>> 2 Don't make writable and continue
>> 3 Abort
> 
> Isn't ctrl-g good enough for aborting, rather than introducing a 3-state
> question?

I wanted 2, that option was not available. Only 1 and 3 could be choosen.  Ctrl-g also does 3.

   Jan D.

[Message part 2 (text/html, inline)]

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Fri, 21 Oct 2011 09:18:01 GMT) Full text and rfc822 format available.

Message #23 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Jan Djärv <jan.h.d <at> swipnet.se>
To: Glenn Morris <rgm <at> gnu.org>
Cc: "9781 <at> debbugs.gnu.org" <9781 <at> debbugs.gnu.org>
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Fri, 21 Oct 2011 11:15:58 +0200
Hi.


20 okt 2011 kl. 23:09 skrev Glenn Morris <rgm <at> gnu.org>:

> Glenn Morris wrote:
> 
>>> 1 Make writable and continue.
>>> 2 Don't make writable and continue
>>> 3 Abort
>> 
>> Isn't ctrl-g good enough for aborting, rather than introducing a 3-state
>> question?
> 
> Ignore that, I misunderstood option 2.
> "Don't make writable, but continue committing anyway."

Too late :-)

> (Will that cause an error with whatever VCS this issue is still relevant for?)

I guess we have to check all backends individually. 

    Jan D.





Changed bug title to 'read-only prompt in vc-next-action' from '24.0.90; VC can't commit removed files/directories.' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 21 Oct 2011 16:19:01 GMT) Full text and rfc822 format available.

Severity set to 'minor' from 'normal' Request was from Glenn Morris <rgm <at> gnu.org> to control <at> debbugs.gnu.org. (Fri, 21 Oct 2011 16:19:02 GMT) Full text and rfc822 format available.

Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Sat, 29 Oct 2011 18:35:01 GMT) Full text and rfc822 format available.

Message #30 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: Jan Djärv <jan.h.d <at> swipnet.se>
Cc: "9781 <at> debbugs.gnu.org" <9781 <at> debbugs.gnu.org>
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Sat, 29 Oct 2011 14:32:23 -0400
Jan Djärv wrote:

> I guess we have to check all backends individually. 

I checked CVS, SVN and bzr; all have no problems committing read-only
files. So this whole "is the file read-only" check should simply be
skipped for those backends IMO. (I suspect only RCS is going to care
about read-onlyness.)




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#9781; Package emacs. (Sat, 29 Oct 2011 19:49:01 GMT) Full text and rfc822 format available.

Message #33 received at 9781 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Monnier <monnier <at> iro.umontreal.ca>
To: Glenn Morris <rgm <at> gnu.org>
Cc: Jan Djärv <jan.h.d <at> swipnet.se>,
	"9781 <at> debbugs.gnu.org" <9781 <at> debbugs.gnu.org>
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Sat, 29 Oct 2011 15:46:14 -0400
> skipped for those backends IMO. (I suspect only RCS is going to care
> about read-onlyness.)

Indeed.  OR maybe SCCS as well, but everything else should pay little
attention to read-only-ness (at most it will record it in the
repository).


        Stefan




Reply sent to Glenn Morris <rgm <at> gnu.org>:
You have taken responsibility. (Thu, 27 Sep 2012 07:02:02 GMT) Full text and rfc822 format available.

Notification sent to Jan Djärv <jan.h.d <at> swipnet.se>:
bug acknowledged by developer. (Thu, 27 Sep 2012 07:02:02 GMT) Full text and rfc822 format available.

Message #38 received at 9781-done <at> debbugs.gnu.org (full text, mbox):

From: Glenn Morris <rgm <at> gnu.org>
To: 9781-done <at> debbugs.gnu.org
Subject: Re: bug#9781: 24.0.90; VC can't commit removed files/directories.
Date: Thu, 27 Sep 2012 03:01:32 -0400
Version: 24.3

I restricted the toggle-read-only business to RCS and SCCS (the latter
might not even need it either).




bug archived. Request was from Debbugs Internal Request <help-debbugs <at> gnu.org> to internal_control <at> debbugs.gnu.org. (Thu, 25 Oct 2012 11:24:03 GMT) Full text and rfc822 format available.

This bug report was last modified 11 years and 158 days ago.

Previous Next


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