darcs

Issue 2494 output of record with missing or not-added file

Title output of record with missing or not-added file
Priority Status resolved
Milestone Resolved in
Superseder Nosy List bfrk
Assigned To
Topics UI

Created on 2016-03-12.08:02:48 by bfrk, last changed 2017-07-31.02:13:21 by gh.

Files
File name Uploaded Type Edit Remove
issue2494-output-of-darcs.dpatch bfrk, 2016-03-16.07:27:04 application/x-darcs-patch
Messages
msg19074 (view) Author: bfrk Date: 2016-03-12.08:02:44
1. Summarise the issue (what were doing, what went wrong?)

> darcs record xx
Recording changes in "xx":
WARNING: File 'xx' does not exist!

darcs failed:  None of the files you specified exist!
> echo bla > xx
> darcs record xx
Recording changes in "xx":
No changes!
> darcs record -l xx
Recording changes in "xx":
WARNING: File 'xx' not in repository!
addfile ./xx
Shall I record this change? (1/2)  ...etc etc...

2. What behaviour were you expecting instead?

> darcs record xx
None of the files you specified exist.
> echo bla > xx
> darcs record xx
File "xx" is not in repository (use add or record -l to add it).
> darcs record -l xx
Recording changes in "xx":
addfile ./xx
Shall I record this change? (1/2)  ...etc etc...

Extended discussion:

A warning message, especially in BIG LARGE LETTERS and with exclamation
mark! as in

  WARNING: File 'xx' does not exist!

should be reserved for situations where darcs is about to do something
potentially dangerous. This is not the case when the file does not exist
nor is in the repo: the command will simply do nothing. It is important
to notify the user of this fact, but it's hardly worth mentioning the
word "warning". In the third case (record -l xx, where xx exists but is
not in the repo) the warning makes even less sense: we have been
expressly asked to look for adds!

If "xx" exists but is not in the repo, the output

  Recording changes in "xx":
  No changes!

is identical to the one you get when "xx" is in the repo but with no
pending changes. I think it is worthwhile to notify the user about the
difference. (IME it is a very common mistake to forget to add files
before recording.)

Finally, the message

  darcs failed: None of the files you specified exist!

indicates that something went wrong; I guess the exit code will indicate
failure, too, in this case; both of which are at least arguable.
msg19084 (view) Author: bfrk Date: 2016-03-16.07:27:04
I have unsuccessfully tried to send this bundle via 'darcs send'.
Although darcs said it has sent it, it doesn't appear in the tracker nor
gets forwarded to darcs-devel.

As request, I am bundling everything necessary to make the resolution
build and work (tests suceed here on my two ubuntu machines).
Attachments
msg19088 (view) Author: bfrk Date: 2016-03-16.14:35:55
Please ignore the manually attached bundle, see patch1468
msg19093 (view) Author: gh Date: 2016-03-17.23:42:57
I agree with your diagnostic and proposed solutions. I'll have a look
at your patches when I have time.
History
Date User Action Args
2016-03-12 08:02:48bfrkcreate
2016-03-16 07:27:06bfrksetfiles: + issue2494-output-of-darcs.dpatch
messages: + msg19084
2016-03-16 14:35:56bfrksetmessages: + msg19088
2016-03-17 23:42:58ghsetmessages: + msg19093
2017-07-31 02:13:21ghsetstatus: unknown -> resolved