code icon indicating copy to clipboard operation
code copied to clipboard

Clone remote repository.

Open jeremypw opened this issue 8 months ago • 11 comments

  • Add clone action and associated menuitem
  • Put "Clone" menuitem in ProjectChooser menu
  • Move "Open Project" menuitem into ProjectChooser menu
  • Use dialog to get remote uri and local target (partially validated)
  • Persist default remote and local projects folder entries
  • Show spinner while cloning is ongoing, do not block UI
  • If cloning fails show error dialog giving opportunity to amend and retry
  • On success, open the new project folder but do not make it active (similar to "Open Project" action)

Screenshot from 2025-06-05 12 26 58 Screenshot from 2025-06-05 12 28 23 Screenshot from 2025-06-05 12 29 28

jeremypw avatar Apr 03 '25 17:04 jeremypw

@danirabbit Thanks for the detailed review! I'll get working on your comments. Regarding the dialog, I was trying to reduce the amount of typing required to specify the remote URL especially if you are cloning an elementary repository. I too usually copy paste the URL from github because I use the terminal command git clone .. anyway. I was trying to make the UI easier by only having to type the name of the project for the default situation but if it confuses then maybe I should just have one entry for the URL? I'll rethink the dialog.

jeremypw avatar May 28 '25 09:05 jeremypw

@danirabbit I've addressed most of your comments now. I've left moving the "Clone" button else where for a separate PR to be merged into this one if considered superior. I think it should be possible to handle SSH cloning but I'll leave that until the UI is right. What do you think about having dropdowns for choosing common remote hosts etc?

jeremypw avatar May 28 '25 17:05 jeremypw

@jeremypw I'm not a fan of the dropdown idea tbh. It feels like trying to be too clever and seems more restrictive and then I have to delete parts of my copied string from the web interface and figure out where the pieces go. It sounds painful to me :/

danirabbit avatar May 28 '25 18:05 danirabbit

I think it would be clearer and easier to just have one entry for repository URL instead of trying to split it up into three entries. That seems to against the way code hosts present the URLs for cloning and makes it 3 steps to enter the remote URL instead of one paste step

danirabbit avatar May 28 '25 18:05 danirabbit

@danirabbit I think we are imagining different workflows. By the time one has navigated to a webpage and copied the URL it is probably just as quick to type git clone into a terminal and paste the URL there. I am trying to ease my own workflow which is mostly cloning projects from the same host/users (usually https://github.com/elementary/) so I am trying to remove the need to copy-paste from the web browser or type long URLs. Ideally it should be possible to get a list of available projects to clone from a given host/user but I am not sure how to do that atm.

However, if you prefer I can just use an entry where you can paste or type an entire URL instead at least for now. If there are feature requests for something else then it can be enhanced later.

I agree that for downloading random projects from random places splitting the source URL entry into host, user and name does not help.

jeremypw avatar May 28 '25 19:05 jeremypw

Gotta go now - will continue tomorrow ...

jeremypw avatar May 28 '25 20:05 jeremypw

GNOME Builder has something like that: obraz

You can see suggested GNOME projects to clone on the start page. But also there is a clone repository page:

obraz

stsdc avatar May 29 '25 14:05 stsdc

@stsdc Thanks - this is something to work towards. Probably we'll just produce the simplest minimal functionality in this PR and then we can iterate. Be interesting to know whether the suggested repos are generated live or whether they are hard-coded.

jeremypw avatar May 29 '25 14:05 jeremypw

Removed from potential branches for v8.0.0 as I do not want to hold that up too much and this needs some design thought. I'll try to produce v8.1 next month.

jeremypw avatar May 29 '25 15:05 jeremypw

I am trying to ease my own workflow which is mostly cloning projects from the same host/users

@jeremypw I hear what you're saying and that makes sense. What do you think about if we saved that host/org portion of the URL after the first time someone clones a branch? I think that might be a good compromise between assuming that folks are primarily cloning elementary repos and also trying to save time when you're cloning lots of repos from the same org.

So for example:

  1. We start with a single empty url entry
  2. someone clones for example "https://github.com/elementary/files.git"
  3. The next time they open the clone dialog, the url entry is now pre-filled with "https://github.com/elementary/"

danirabbit avatar May 30 '25 01:05 danirabbit

@danirabbit I've added cloning error handling and persisting the remote and projects folder entries.

jeremypw avatar Jun 05 '25 11:06 jeremypw

@danirabbit Thanks for the thorough review. Hopefully most of the essential issues are fixed now. The "cloning in progress" page is minimal but can be improved before the next release hopefully. I am still unsure whether it is correct to focus the "Cancel" button rather than the URI entry on opening. I have reinstated the "activates-default" behaviour although there is a small risk of starting to clone into the wrong folder if the intention is to clone into a non-default location.

jeremypw avatar Jun 24 '25 09:06 jeremypw

There doesn't seem to be a way of cancelling an ongoing cloning process afaict.

jeremypw avatar Jun 24 '25 09:06 jeremypw

I have a PR demonstrating use of Ggit.RemoveCallbacks to give more detailed info during cloning here #1608, but needs design work and I don't want to hold this PR.

jeremypw avatar Jun 24 '25 13:06 jeremypw