darcs

Issue 1946 nicer error message when "darcs changes" in not-a-repo

Title nicer error message when "darcs changes" in not-a-repo
Priority feature Status given-up
Milestone 2.8.0 Resolved in
Superseder Nosy List dmitry.kurochkin, jaredj, mndrix, zooko
Assigned To
Topics ProbablyEasy, UI

Created on 2010-09-03.22:05:38 by zooko, last changed 2017-07-31.00:37:06 by gh.

Messages
msg12451 (view) Author: zooko Date: 2010-09-03.22:05:37
Some users are complaining to me about one of my tools emitting
scary-looking warnings:

http://tahoe-lafs.org/pipermail/tahoe-dev/2010-September/005131.html

Part of the problem is that darcs emits the following ugly-looking
message when you run "darcs changes" in a directory with no _darcs
subdirectory:


darcs failed:  Not a repository: . (./_darcs/inventory: openBinaryFile:
does not exist (No such file or directory))

Compare to what darcs emits if you run "darcs query repo" in the same
directory:

darcs failed:  Unable to "darcs query repo" here.

You need to be in a repository directory to run this command.


To close this ticket, make "darcs changes" emit a message similar to the
one "darcs query" emits, saying that you need to be in a repository
directory to run this command.

(Note: I have now changed my tool so that it doesn't execute "darcs
changes" at all if an exploratory "darcs query repo" doesn't first
return exit code 0, thus prevent my users from seeing this error
message, but it would still be nice to tidy this up.)
msg12455 (view) Author: kowey Date: 2010-09-04.07:22:15
We should try to fix this sooner rather than later.  

I suspect the problem is that darcs changes accepts --repo=URL (so you
can do something like darcs changes
--repo=http://repos.mornfall.net/hashed-storage) so it's not literally
true that you need to be in a repository to run this command.

So one view you could take is that we should use just the prerequisites
mechanism (implementor: copy from other commands), but with a phrasing
appropriate for --repo.  What's a good phrasing?

Another view is that the prerequisite checker should fire two different
error messages depending on whether --repo is used or not.  If repo is
not used (the more common case), it could say something like "You need
to either be in a repository or use the --repo flag to run this
command", and something else if --repo is supplied.  Keep in mind that
--repo accepts both filepaths and URLs
History
Date User Action Args
2010-09-03 22:05:38zookocreate
2010-09-04 07:22:17koweysetstatus: unknown -> needs-implementation
topic: + ProbablyEasy, UI
nosy: + jaredj
messages: + msg12455
priority: feature
milestone: 2.8.0
2012-03-02 22:05:37mndrixsetnosy: + mndrix
2017-07-31 00:37:06ghsetstatus: needs-implementation -> given-up