unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
@ 2013-01-21 13:25 Carsten Bormann
  2013-01-22  2:02 ` Glenn Morris
  2013-01-22 18:14 ` Glenn Morris
  0 siblings, 2 replies; 17+ messages in thread
From: Carsten Bormann @ 2013-01-21 13:25 UTC (permalink / raw)
  To: 13513

Checking in with vc-next-action in OSX with SVN backend often simply
fails with an authentication error.  This is mostly unnecessary, as OSX
SVN knows how to interactively obtain authentication.

Commenting out the forced "--non-interactive" in vc-svn-comment fixes this:

 (defun vc-svn-command (buffer okstatus file-or-list &rest flags)
   "A wrapper around `vc-do-command' for use in vc-svn.el.
 The difference to vc-do-command is that this function always invokes `svn',
 and that it passes \"--non-interactive\" and `vc-svn-global-switches' to
 it before FLAGS."
   ;; Might be nice if svn defaulted to non-interactive if stdin not tty.
   ;; http://svn.haxx.se/dev/archive-2008-05/0762.shtml
   ;; http://svn.haxx.se/dev/archive-2009-04/0094.shtml
   ;; Maybe newer ones do?
!  ;; (or (member "--non-interactive"
!  ;;             (setq flags (if (stringp vc-svn-global-switches)
!  ;;                             (cons vc-svn-global-switches flags)
!  ;;                           (append vc-svn-global-switches flags))))
!  ;;     (setq flags (cons "--non-interactive" flags)))
   (apply 'vc-do-command (or buffer "*vc*") okstatus vc-svn-program file-or-list
          flags))

In GNU Emacs 24.3.50.1 (x86_64-apple-darwin, NS apple-appkit-1038.36)
 of 2013-01-02 on bob.porkrind.org
Bzr revision: 111395 eggert@cs.ucla.edu-20130102075700-2j3hllme431z6und
Windowing system distributor `Apple', version 10.3.1187
Configured using:
 `configure --host=x86_64-apple-darwin --build=i686-apple-darwin
 --with-ns'

Important settings:
  value of $LC_CTYPE: UTF-8
  locale-coding-system: nil
  default enable-multibyte-characters: t





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-21 13:25 bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX Carsten Bormann
@ 2013-01-22  2:02 ` Glenn Morris
  2013-01-22  7:06   ` Carsten Bormann
  2013-01-22 18:14 ` Glenn Morris
  1 sibling, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-22  2:02 UTC (permalink / raw)
  To: Carsten Bormann; +Cc: 13513

Carsten Bormann wrote:

> Checking in with vc-next-action in OSX with SVN backend often simply
> fails with an authentication error.  This is mostly unnecessary, as OSX
> SVN knows how to interactively obtain authentication.
>
> Commenting out the forced "--non-interactive" in vc-svn-comment fixes this:

That's not really an option; eg

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





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22  2:02 ` Glenn Morris
@ 2013-01-22  7:06   ` Carsten Bormann
  2013-01-22 14:57     ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Carsten Bormann @ 2013-01-22  7:06 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13513

On Jan 22, 2013, at 03:02, Glenn Morris <rgm@gnu.org> wrote:

> Carsten Bormann wrote:
> 
>> Checking in with vc-next-action in OSX with SVN backend often simply
>> fails with an authentication error.  This is mostly unnecessary, as OSX
>> SVN knows how to interactively obtain authentication.
>> 
>> Commenting out the forced "--non-interactive" in vc-svn-comment fixes this:
> 
> That's not really an option; eg
> 
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9993

Sure.
I understand why the change was made, it is just the wrong thing in those environments that don't have the bug being compensated for.
This is a bug report, so I didn't want to suggest one of the obvious solutions such as either of:

-- OS sensitivity;
-- a customize option;
-- a customize option that defaults to the right thing in an OS-sensitive way.

Your decision.
I just don't want to have to monkey-patch the code in eternity...

Grüße, Carsten






^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22  7:06   ` Carsten Bormann
@ 2013-01-22 14:57     ` Stefan Monnier
  2013-01-22 16:59       ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2013-01-22 14:57 UTC (permalink / raw)
  To: Carsten Bormann; +Cc: 13513

> I understand why the change was made, it is just the wrong thing in those
> environments that don't have the bug being compensated for.

I don't actually know if it depends on the environment, or if it depends
on the particular use-case, but I agree that
hardcoding --non-interactive is wrong.

We should probably make it a defcustom (as for its default, I guess we
could try to make it better if we can figure out under which kinds of
conditions the switch is needed).


        Stefan





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22 14:57     ` Stefan Monnier
@ 2013-01-22 16:59       ` Glenn Morris
  2013-01-22 19:00         ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-22 16:59 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Stefan Monnier wrote:

> [...] I agree that hardcoding --non-interactive is wrong.

> We should probably make it a defcustom

http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9993#11
Stefan Monnier wrote:

> Glenn Morris wrote:

>> Perhaps we should just add --non-interactive to vc-svn-global-switches

> That's a user var, so better leave it alone.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-21 13:25 bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX Carsten Bormann
  2013-01-22  2:02 ` Glenn Morris
@ 2013-01-22 18:14 ` Glenn Morris
  2013-01-22 22:09   ` Carsten Bormann
  1 sibling, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-22 18:14 UTC (permalink / raw)
  To: Carsten Bormann; +Cc: 13513

Carsten Bormann wrote:

> Checking in with vc-next-action in OSX with SVN backend often simply
> fails with an authentication error.  This is mostly unnecessary, as OSX
> SVN knows how to interactively obtain authentication.
>
> Commenting out the forced "--non-interactive" in vc-svn-comment fixes this:

Could you explain how this works? Does it pop up a dialogue box or
something? How does it communicate the results back to Emacs?
What happens if you are running with `emacs -nw'?
What happens if you vc-update from Emacs and there are conflicts, and
svn tries to drop you into interactive conflict resolution
(http://debbugs.gnu.org/4280)?





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22 16:59       ` Glenn Morris
@ 2013-01-22 19:00         ` Stefan Monnier
  2013-01-23  8:41           ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2013-01-22 19:00 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Carsten Bormann, 13513

>> [...] I agree that hardcoding --non-interactive is wrong.
>> We should probably make it a defcustom
> http://debbugs.gnu.org/cgi/bugreport.cgi?bug=9993#11
>>> Perhaps we should just add --non-interactive to vc-svn-global-switches
>> That's a user var, so better leave it alone.

Oh, indeed, we could also just use vc-svn-global-switches rather than
introducing a new var.  But as noted, changing such user var's default
is likely not to work for all users.

If the default should be "don't use --non-interactive", then we can just
drop the hardcoded --non-interactive and tell people to adjust their
vc-svn-global-switches if they want to pass --non-interactive.

So, could someone explain to me when --non-interactive is needed?
The report seemed to be for w32, does that mean that it's only ever needed
for w32, or is it also sometimes needed under GNU/Linux?


        Stefan





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22 18:14 ` Glenn Morris
@ 2013-01-22 22:09   ` Carsten Bormann
  0 siblings, 0 replies; 17+ messages in thread
From: Carsten Bormann @ 2013-01-22 22:09 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13513

[-- Attachment #1: Type: text/plain, Size: 1126 bytes --]

>> Commenting out the forced "--non-interactive" in vc-svn-comment fixes this:
> 
> Could you explain how this works? Does it pop up a dialogue box or
> something? How does it communicate the results back to Emacs?

Well, svn keeps it all to itself.
It looks like the screenshot below (this is just an example; it could be asking for a keychain password).

> What happens if you are running with `emacs -nw'?

Exactly the same.
Again, it's svn that prompts, not Emacs.

> What happens if you vc-update from Emacs and there are conflicts, and
> svn tries to drop you into interactive conflict resolution
> (http://debbugs.gnu.org/4280)?

Well, first svn (again) prompts via GUI for access, and then I see (in Emacs):

Updating 'x':
Conflict discovered in '/Users/cabo/Documents/uni/lehre/isec12/ueb/x'.
Select: (p) postpone, (df) diff-full, (e) edit,
        (mc) mine-conflict, (tc) theirs-conflict,
        (s) show all options: svn: E070014: Can't read stdin: End of file found

If you want this to fail less, this should apparently have a --accept (and not a --non-interactive).

Grüße, Carsten

[-- Attachment #2.1: Type: text/html, Size: 1910 bytes --]

[-- Attachment #2.2: PastedGraphic-1.png --]
[-- Type: image/png, Size: 60774 bytes --]

^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-22 19:00         ` Stefan Monnier
@ 2013-01-23  8:41           ` Glenn Morris
  2013-01-23  8:46             ` Glenn Morris
                               ` (2 more replies)
  0 siblings, 3 replies; 17+ messages in thread
From: Glenn Morris @ 2013-01-23  8:41 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Stefan Monnier wrote:

> So, could someone explain to me when --non-interactive is needed?
> The report seemed to be for w32, does that mean that it's only ever needed
> for w32, or is it also sometimes needed under GNU/Linux?

IIUC on GNU/Linux:

Semi-recent svn default to using gnome-keyring to store encrypted
passwords for svn servers that need them. So suppose you are working in
a svn checkout of a remote repository that needs a password. You've
previously stored the password encrypted on your local disk.

Now you type any command that needs to contact the server (eg svn status
-u, or svn update). If at the command-line, you get a prompt:

  Password for 'login' GNOME keyring: 

You enter your normal user password, it decrypts the stored svn password
and everything then works.


If you call the same svn commands from Emacs VC prior to 24.1, it hangs
forever with no indication of what's going on (bug#9993). Using
--non-interactive makes it abort instantly with a meaningful error
message.

The OP says that on Mac OS X, the equivalent password prompt pops up as
a GUI dialogue box rather than a command-line prompt. Maybe there is
some way to make svn do that on GNU/Linux too, but I don't see it. (If
you go through the auth step in the shell prior to launching Emacs, then
update etc works from Emacs too without need any prompt; presumably the
decrypted svn password is cached for the rest of the session). (Note
also that bug#7152 is about needing non-interactive on Mac OS X. Maybe
it depends how you configure it?)


There is a relate issue of what happens if you manage to do an update
and it brings in conflicts. By default, this drops you into interactive
conflict resolution (bug#4280, 7152). As the OP says, this could perhaps
also be avoided using --accept=postpone rather than --non-interactive.


So in summary as far as we knew till now, all platforms needed
--non-interactive to avoid Emacs waiting forever for svn to respond,
with no indication as to what was going on.

IIUC, future svn will/may default to non-interactive in the Emacs case:
http://svn.haxx.se/dev/archive-2012-12/0432.shtml





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-23  8:41           ` Glenn Morris
@ 2013-01-23  8:46             ` Glenn Morris
  2013-01-23 21:53             ` Carsten Bormann
  2013-01-30 16:42             ` Stefan Monnier
  2 siblings, 0 replies; 17+ messages in thread
From: Glenn Morris @ 2013-01-23  8:46 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Glenn Morris wrote:

> If you call the same svn commands from Emacs VC prior to 24.1, it hangs
> forever with no indication of what's going on (bug#9993). Using
> --non-interactive makes it abort instantly with a meaningful error
> message.

PS this then prompts you to drop back to the shell and do the auth from
outside Emacs. Which presumably works for the OP too, so it's a loss of
convenience rather than a complete loss of functionality?

Agreed that the non-interactive bit should probably be an option (on by
default) though.






^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-23  8:41           ` Glenn Morris
  2013-01-23  8:46             ` Glenn Morris
@ 2013-01-23 21:53             ` Carsten Bormann
  2013-01-30 16:42             ` Stefan Monnier
  2 siblings, 0 replies; 17+ messages in thread
From: Carsten Bormann @ 2013-01-23 21:53 UTC (permalink / raw)
  To: Glenn Morris; +Cc: 13513

On Jan 23, 2013, at 09:41, Glenn Morris <rgm@gnu.org> wrote:

> IIUC, future svn will/may default to non-interactive in the Emacs case:
> http://svn.haxx.se/dev/archive-2012-12/0432.shtml

That is of course the right solution (if and when it is done right).
All we are trying to do here is work around svn's bugs in a reasonably elegant way.

> So in summary as far as we knew till now, all platforms needed
> --non-interactive to avoid Emacs waiting forever for svn to respond,
> with no indication as to what was going on.

I don't know that at all.
What is the OSX case where you get an endless wait without --non-interactive?
(You may need an --accept for update, to make that do something meaningful.
But --non-interactive is too big a hammer.)

Grüße, Carsten






^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-23  8:41           ` Glenn Morris
  2013-01-23  8:46             ` Glenn Morris
  2013-01-23 21:53             ` Carsten Bormann
@ 2013-01-30 16:42             ` Stefan Monnier
  2013-01-30 17:02               ` Glenn Morris
  2 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2013-01-30 16:42 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Carsten Bormann, 13513

>> So, could someone explain to me when --non-interactive is needed?
>> The report seemed to be for w32, does that mean that it's only ever needed
>> for w32, or is it also sometimes needed under GNU/Linux?
> IIUC on GNU/Linux:
> Semi-recent svn default to using gnome-keyring to store encrypted
> passwords for svn servers that need them. So suppose you are working in
> a svn checkout of a remote repository that needs a password.  You've
> previously stored the password encrypted on your local disk.
> Now you type any command that needs to contact the server (eg svn status
> -u, or svn update). If at the command-line, you get a prompt:
>   Password for 'login' GNOME keyring:
> You enter your normal user password, it decrypts the stored svn password
> and everything then works.

But if DISPLAY is set, gnome-keyring should prompt you via an X11 dialog
box, AFAIK.

> If you call the same svn commands from Emacs VC prior to 24.1, it hangs
> forever with no indication of what's going on (bug#9993).  Using
> --non-interactive makes it abort instantly with a meaningful error
> message.

So I think the right way to go about it is to not use --non-interactive,
but add a process filter in vc-svn.el to detect such situations (and
then do something like query the password and send it to svn, or emit
an error).


        Stefan





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-30 16:42             ` Stefan Monnier
@ 2013-01-30 17:02               ` Glenn Morris
  2013-01-30 20:58                 ` Stefan Monnier
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-30 17:02 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Stefan Monnier wrote:

> But if DISPLAY is set, gnome-keyring should prompt you via an X11 dialog
> box, AFAIK.

It's never done that for me.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-30 17:02               ` Glenn Morris
@ 2013-01-30 20:58                 ` Stefan Monnier
  2013-01-30 21:07                   ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Stefan Monnier @ 2013-01-30 20:58 UTC (permalink / raw)
  To: Glenn Morris; +Cc: Carsten Bormann, 13513

>> But if DISPLAY is set, gnome-keyring should prompt you via an X11 dialog
>> box, AFAIK.
> It's never done that for me.

Not sure if it's gnome-keyring that does it, but at least I get such
a dialog when accessing gpg-encrypted files.  IIRC whether it works or
not (for gpg) depends also on the desktop I use (i.e. seems to depend
on some other daemons, maybe connected via dbus).


        Stefan





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-30 20:58                 ` Stefan Monnier
@ 2013-01-30 21:07                   ` Glenn Morris
  2013-01-30 21:10                     ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-30 21:07 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Stefan Monnier wrote:

> Not sure if it's gnome-keyring that does it, but at least I get such
> a dialog when accessing gpg-encrypted files.  IIRC whether it works or
> not (for gpg) depends also on the desktop I use (i.e. seems to depend
> on some other daemons, maybe connected via dbus).

That's gpg-pinetry.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-30 21:07                   ` Glenn Morris
@ 2013-01-30 21:10                     ` Glenn Morris
  2013-02-11  1:08                       ` Glenn Morris
  0 siblings, 1 reply; 17+ messages in thread
From: Glenn Morris @ 2013-01-30 21:10 UTC (permalink / raw)
  To: Stefan Monnier; +Cc: Carsten Bormann, 13513

Glenn Morris wrote:

> That's gpg-pinetry.

Or pinentry-gtk or something like that.





^ permalink raw reply	[flat|nested] 17+ messages in thread

* bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX
  2013-01-30 21:10                     ` Glenn Morris
@ 2013-02-11  1:08                       ` Glenn Morris
  0 siblings, 0 replies; 17+ messages in thread
From: Glenn Morris @ 2013-02-11  1:08 UTC (permalink / raw)
  To: 13513-done

Version: 24.4

I moved the --non-interactive to vc-svn-global-switches, and made it
default to off for Darwin.





^ permalink raw reply	[flat|nested] 17+ messages in thread

end of thread, other threads:[~2013-02-11  1:08 UTC | newest]

Thread overview: 17+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-01-21 13:25 bug#13513: 24.3.50; Going "--non-interactive" is the wrong thing for SVN on OSX Carsten Bormann
2013-01-22  2:02 ` Glenn Morris
2013-01-22  7:06   ` Carsten Bormann
2013-01-22 14:57     ` Stefan Monnier
2013-01-22 16:59       ` Glenn Morris
2013-01-22 19:00         ` Stefan Monnier
2013-01-23  8:41           ` Glenn Morris
2013-01-23  8:46             ` Glenn Morris
2013-01-23 21:53             ` Carsten Bormann
2013-01-30 16:42             ` Stefan Monnier
2013-01-30 17:02               ` Glenn Morris
2013-01-30 20:58                 ` Stefan Monnier
2013-01-30 21:07                   ` Glenn Morris
2013-01-30 21:10                     ` Glenn Morris
2013-02-11  1:08                       ` Glenn Morris
2013-01-22 18:14 ` Glenn Morris
2013-01-22 22:09   ` Carsten Bormann

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).