hpi-swa / Squot

Squeak Object Tracker - Version control for arbitrary objects, currently with Git storage
Other
57 stars 29 forks source link

Create new directory by default when cloning/creating a repository #326

Open LinqLover opened 3 years ago

LinqLover commented 3 years ago

I have already too many .git directories directly in some of my image folders because I somehow assumed that Squot would create a new subdirectory by itself, and I just did it again. :-( Would it be possible to always create a new directory? Or at least warn if the directory to clone into is not empty? :-)

j4yk commented 3 years ago

Cloning is currently analogous to git clone URL target-dir instead of just git clone URL (which creates a new subdirectory and guesses the name from the last part of the URL). The rationale is that you must choose a directory, so it would be strange to make it analogous to the command without a directory.

If we change the behavior to always create a directory, we lose the current "option" of setting the eventual directory directly.

TortoiseGit solves this with an intermediary clone dialog, where the target directory text field is prepopulated with a new directory, but one can still change this.

I think the proper solution would be a proper clone dialog here as well, instead of just showing a directory chooser. Anyone willing to implement one?

LinqLover commented 3 years ago

I think for the actual issue I noticed above, an extra warning message that is raised before cloning into a non-empty directory might already suffice. A better dialog, on the other hand, would also not harm, of course. :-)

j4yk commented 2 years ago

I have added the confirmation prompt if the chosen directory is not empty.