File selection dialog should not open for Add in the most common cases
- Create three new files in the Git repo: file1, file2, file3
- Click on file1 to select it.
- Shift-click on file2 to select file1 and file2. Leave file3 unselected.
- Right-click on one of the selected files.
- Select Add.
What happens: The file selection dialog opens, showing file1 and file2, with both files checked.
Suggestion: The file selection dialog doesn't need to open at all.
TortoiseGit is a fairly chatty application. The user has to OK a lot of dialogs that pop up to confirm certain actions. That's why, for example, the autoclose option was added.
I suggest also omitting the file selection dialog before the command executes, if there is no need for the dialog to show up.
If the list of checked files is identical to the user selection, then the dialog can be omitted. This is especially true for a command like Add, which does not carry the risk of destroying data. (Revert needs a confirmation dialog because you can lose data.)
The dialog should appear if the list of checked files is somehow different from the files that are selected in Windows Explorer:
- If one of the files matches the .gitignore
- If an empty directory was selected
- If a non-empty directory was selected. (The file selection dialog currently shows all the files in the directory, but leaves them unchecked.)
The dialog should also show up if it was not launched from a list of selected files. For example, if the user right-clicks on an empty area of the Windows Explorer window, and then selects Add.
If autoclose is implemented for commands that are executed through Libgit2 (issue #2701 (closed)), then Add can now execute without opening any dialogs:
- Select some files, right-click on them, and select Add.
- No file selection pops up because it does not fall into any of the special cases.
- No status dialog pops up because autoclose is working.
- The user knows that the Add succeeded because the icon overlay changes on the selected files.
Add is one of the most common operations performed through TortoiseGit. These two changes would eliminate most of the unnecessary dialogs that are presented to the user.