-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Description
EDITED 9/15/19
There are a couple of discussions around prompting for user input from CLI. This issue-question tries to summarize the rules around prompting.
Now, DVC asks y/n questions from the command line. We have to introduce --yes option (which is not a problem) and users should remember to use this option from their scripts all the time otherwise script stuck. This difference (script experience versus user experience) is an important issue for Unix tools.
Traditional Unix-tools do not ask questions (and do not break the scripting experience) which leads to overwriting files or aborting commands. There is an opinion that DVC should behave the same way. The backside of this - it might lead to data loss.
Examples:
- [Overwriting]
cp,tar- will overwrite files with - [Aborting]
git checkout- fails if there is a conflict - [Prompt] there are some exceptions with prompt:
unzip,apt-get. However,zipis not a traditional Unix tool, it was ported from DOS/Windows and follows Windows rules.
First, we need to decide if prompting is okay. Second, what are the set of rules for DVC for prompting, overwriting and aborting command?
The first rules summarization from @shcheklein #2497 (comment)
This is my take on abort vs prompt:
- They both give overhead when you use them in scripts. You have to use some CLI argument to force.
- If script is not written right (without
set -eux) abort is less safer choice.- If script is written right, prompt is more annoying since script hangs.
- The biggest difference for us in terms of workflow and usability comes from some long-running operations (as opposed to Git which is very fast in general). In our case it might be the case that we calculate status and/or md5 before even showing the prompt. Abort does not give a chance to continue - you have to run it second time.
Let's discuss the rules.