[darcs-devel] [issue2494] output of record with missing or not-added file

Ben Franksen bugs at darcs.net
Sat Mar 12 08:02:48 UTC 2016


New submission from Ben Franksen <benjamin.franksen at helmholtz-berlin.de>:

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.

----------
messages: 19074
nosy: bf
status: unknown
title: output of record with missing or not-added file
topic: UI

__________________________________
Darcs bug tracker <bugs at darcs.net>
<http://bugs.darcs.net/issue2494>
__________________________________


More information about the darcs-devel mailing list