Files: Clone Repository with Ctrl + V (Git)

Created on 30 Apr 2020  ·  6Comments  ·  Source: elementary/files

Prerequisites

  • [x] I have searched open and closed issues for duplicates.

Feature

If I paste in Files (Ctrl + V) and there is a valid Git URL in the clipboard (an URL ending with .git, ), it would be awesome if Files would clone the repository to the current folder.

Use Case

During my work I use a few different IDE's and Editors. Because each of these work a bit differently to setup a new project, I often find myself firing up the console, navigate to my development root directory and execute a simple git clone URL with an URL copied to clipboard before from GitHub/GitLab/etc.

As we have a Git integration in Files now, it would be awesome if we can simply clone a project by pasting it to a directory.

Needs Design

Most helpful comment

This could be tricky at the moment as the git code is a plugin and plugins do not (presently) have a hook for pasted files. May be able to add a context menu item though.

All 6 comments

This could be tricky at the moment as the git code is a plugin and plugins do not (presently) have a hook for pasted files. May be able to add a context menu item though.

Adding a context menu item feels like more than half way there. So even though a shortcut would be nice, I guess its not a must.

Some further thoughts the clone action integration might consider:

  1. It should show some sort of progress dialog (similar to when a file gets copied) - otherwise the user might not notice what happens in case of large repositories, for which it takes quite a while to clone them
  2. Show any potential error occured during the clone process in a user facing alert dialog (network error, permission error, Git is not installed, ...)

If the shortcuts for plugins stuff I did for the Sushi plugin could get merged then it should be possible to assign a shortcut to cloning.

I agree about giving some indication of progress and errors. There is also a question of whether we should support clone options and which (which would presumably require a dialog before the actual cloning).

not sure about cloning options, I don't think thats necessary. In fact, I wasn't even aware there are any options up to this point to be honest 😅️

Showing a progress bar is problematic as I do not think the relevant information and signals are available for Ggit library. May be able to provide a spinner though.

Even a spinner and cancel button do not work easily - the clone_repository function is not asynchronous and cannot be interrupted. So for the moment I am just showing an InfoBar.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

harveycabaguio picture harveycabaguio  ·  3Comments

danrabbit picture danrabbit  ·  3Comments

rodrigoaraujolima92 picture rodrigoaraujolima92  ·  5Comments

a-tokarev picture a-tokarev  ·  4Comments

Gabriel-p picture Gabriel-p  ·  6Comments