darcs

Issue 1474 warn the user when a switch is passed in starting with equal sign

Title warn the user when a switch is passed in starting with equal sign
Priority feature Status given-up
Milestone Resolved in
Superseder Nosy List darcs-devel, dmitry.kurochkin, hoijarvi, kowey, thorkilnaur, twb
Assigned To hoijarvi
Topics UI

Created on 2009-05-31.13:46:26 by hoijarvi, last changed 2017-07-30.23:16:15 by gh.

Messages
msg7861 (view) Author: hoijarvi Date: 2009-05-31.13:46:23
In windows, try in darcs.net directory: darcs obli -i -p "Build the list of diffs"

Response is fine. Now try invalid but legitimate looking 

darcs obli -i -p="Build the list of diffs"

darcs hangs
msg7863 (view) Author: thorkilnaur Date: 2009-06-01.17:04:18
Thanks for this report. I am not entirely sure where to find the official 
description of how darcs interprets the -p option. However, simple experiments 
using "darcs --version 2.1.2 (release)" on Mac OS X indicate that darcs interprets 
"-pstring" (with no blank between the -p and the string argument) and "-p string" 
(with one or more blanks between the "-p" and the string argument) identically. 
Thus, I would expect darcs to interpret

  -p="Build the list of diffs"

the same as

  -p "=Build the list of diffs"

and so likely not finding a matching patch.

How long do you wait before concluding that darcs is hanging? I have tried

  darcs obliterate -i -pNonExistingPatch

in the darcs.net repository and have waited between 30 and 100 seconds, before 
darcs concluded "No patches selected!".

And finally, which variant of Windows are you using, please? And the darcs --
version? And where did you get your darcs binary?

Thanks a lot and best regards
Thorkil
msg7867 (view) Author: hoijarvi Date: 2009-06-02.16:43:41
OK, I think this is a very different bug than I thought it would be.

after typing darcs obli -i -p="nonexistent patch" using windows 2000, darcs
2.2.1 and darcs-1.0 format repository, in seemed to run forever. But in reality,
it was just waiting for input. As soon as I accidentally got focus to the window
and hit a key, it replied 'No patches selected!' and quit. I just tested and it
works on my 64 bit xp too. There's something odd about this, since yesterday I
tried it and it gave the message without asking for input. Maybe I was using
darcs1, since it does the right thing now. 

I have noticed that on windows before, darcs writes a prompt to user and waits
for some input, without actually showing it on screen. 

In darcs.net repository using 64 bit windows xp, darcs 2.2.1 does the same. Runs
for a while, then starts consuming 5% of CPU time while waiting for input. Hit a
key, and you're done.

So the issues here:

- obliterate on windows asks for input when it should not.

- windows version is sometimes hiding prompts. I can't reliably reproduce any
other than above. 

- trying to obliterate the first patch in darcs.net takes reliably 42 minutes of
CPU time. This is a performance problem and a usability problem. My easy
suggestion is to add progress indicator, that kicks in after an annoying amount
of time has passes. I get these "reading pristine (number)" messages all the
time, and they're helpful. If some operation, like obliterating an early patch
takes more than a minute, it would be helpful to get a little indication what is
happening. I can accept one hour running times sometimes, but I'd like to get
some indication how much longer is expected. 

- maybe also -p="asd" should warn about the equal sign. It took me a long time
to realize what I was doing wrong. 

thanks for your time.
msg8059 (view) Author: twb Date: 2009-08-10.02:19:28
The problem is that "-f=x" was expected to mean "-f x", but it
actually means "-f =x".  Probably the source of this confusion is that
GNU-style options treat "--foo=x" the same as "--foo x".

Because Darcs' behaviour is consistent with other getopt programs, I
don't think it's appropriate to document it within Darcs -- except
perhaps to simply say

    Darcs argument parsing follows the GNU getopt style.
    See <reference> for more information.

Having said that, it might be reasonable for Darcs to warn the user
when an argument starts with an =, as the OP suggested.  Implementors
should confirm that LEGITIMATE uses of a leading =s are infrequent --
we don't want to annoy users with false positives.
msg8062 (view) Author: kowey Date: 2009-08-10.08:44:59
Agreed about warning the user if we could pull it off.

I was procrastinating on this bug a little because we need to work on teasing
out some of the other stuff that Kari pointed out, maybe turning them into new
tickets.
msg8748 (view) Author: kowey Date: 2009-09-07.21:09:41
msg7867 contains several potential bugs to keep an eye on:

- obliterate on windows asks for input when it should not.
- windows version is sometimes hiding prompts. 
- trying to obliterate the first patch in darcs.net takes reliably 42 minutes of
CPU time. [perhaps issue1589 is related?]

- maybe also -p="asd" should warn about the equal sign. [this issue]

Kari: could I ask you to file separate tickets for the first three that you
pointed out?  Thanks :-)
History
Date User Action Args
2009-05-31 13:46:26hoijarvicreate
2009-06-01 17:04:24thorkilnaursetstatus: unread -> unknown
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, hoijarvi
messages: + msg7863
2009-06-02 16:43:45hoijarvisetnosy: kowey, simon, thorkilnaur, dmitry.kurochkin, hoijarvi
messages: + msg7867
2009-08-10 02:08:29twbsetpriority: bug
nosy: kowey, simon, thorkilnaur, dmitry.kurochkin, hoijarvi
2009-08-10 02:19:30twbsetnosy: + twb
messages: + msg8059
2009-08-10 02:21:02twbsetstatus: unknown -> needs-reproduction
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, hoijarvi
2009-08-10 08:45:03koweysetpriority: bug -> feature
nosy: kowey, simon, twb, thorkilnaur, dmitry.kurochkin, hoijarvi
topic: + UI
messages: + msg8062
title: one badly placed equal sign hangs darcs -> warn the user when a switch is passed in starting with equal sign
2009-08-25 17:45:28adminsetnosy: + darcs-devel, - simon
2009-08-27 14:21:44adminsetnosy: kowey, darcs-devel, twb, thorkilnaur, dmitry.kurochkin, hoijarvi
2009-09-07 21:09:44koweysetnosy: kowey, darcs-devel, twb, thorkilnaur, dmitry.kurochkin, hoijarvi
messages: + msg8748
assignedto: hoijarvi
2017-07-30 23:16:15ghsetstatus: needs-reproduction -> given-up