Bug 315592 - Clone wizard: Add button to change remote name from the default "origin" to hostname
Summary: Clone wizard: Add button to change remote name from the default "origin" to h...
Status: NEW
Alias: None
Product: EGit
Classification: Technology
Component: UI (show other bugs)
Version: 0.11   Edit
Hardware: All All
: P3 enhancement (vote)
Target Milestone: ---   Edit
Assignee: Project Inbox CLA
QA Contact:
URL:
Whiteboard:
Keywords: bugday, helpwanted
Depends on:
Blocks:
 
Reported: 2010-06-03 10:00 EDT by Alex Blewitt CLA
Modified: 2015-03-22 20:03 EDT (History)
6 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alex Blewitt CLA 2010-06-03 10:00:25 EDT
Build Identifier: 0.8.1

In the clone git source dialog, the cloned repository always defaults to origin.

I propose that we externalise this feature on the Source Git Repository dialog, so that a value other than 'origin' can be chosen. For example, when I'm working on a set of projects, I will name the remote based on the site that I've cloned from rather than 'origin'; in EGit's case, I'll call it 'eclipse.org' and have a copy at 'github.com'. That makes it much easier to remember where I've come from (and where it's going to).

For compatibility with git, having it as 'origin' might be a sensible value, but we could give a preference to default it to the host name of the url.

Reproducible: Always
Comment 1 Benjamin Muskalla CLA 2010-08-03 12:48:13 EDT
Alex, as far as I can see you can do this by specifing the remote name in the clone wizard. Is that the feature you're asking for? If yes, I think we can close this one.
Comment 2 Marc-André Laperle CLA 2010-08-17 00:58:39 EDT
(In reply to comment #0)
> but we could give a preference to default it to the host name of the url.

I would like that. Maybe just a push button or a check box that would change the field's text in the dialog?
Comment 3 Alex Blewitt CLA 2011-02-11 12:53:58 EST
This enhancement still applies to 0.11.
Comment 4 Mykola Nikishov CLA 2012-03-03 11:12:12 EST
[Batch change] Remove passed Target Milestones

If anyone on CC list is going to fix/implement this, feel free to assign a new, post-1.3/2.0, target milestone.
Comment 5 Rajagopal Somasundaram CLA 2015-03-09 08:19:13 EDT
Hi All,

I like to work on this enhancement and require some more information as well.

If the git url is https://git.eclipse.org/c/, then the hostname that needs to be "eclipse.org"

If the git url is like "https://github.com/zurb/joyride" then what should be taken as the remote name?
Whether it should be the project name or the hostname( in this case it will be "github.com")

Cheers,
Raj
Comment 6 Alex Blewitt CLA 2015-03-09 12:11:29 EDT
You really need to use the hostname (GitHub) and not the project name, since the project name could be in multiple remotes and/or known as different Git repository

https://github.com/eclipse/cdt/
https://git.eclipse.org/c/cdt/org.eclipse.cdt.git/
Comment 7 Rajagopal Somasundaram CLA 2015-03-10 03:59:05 EDT
Thanks Alex!!!

Will proceed with by dev accordingly

Cheers,Raj
Comment 8 Rajagopal Somasundaram CLA 2015-03-13 07:37:31 EDT
Hi Alex,
I have done the changes and pushed the patch in Gerrit for code review and below is the URL for the same.

https://git.eclipse.org/r/#/c/43783/

Please review the code and functionality


Cheers,
Raj
Comment 9 Max Rydahl Andersen CLA 2015-03-22 04:18:15 EDT
neither host nor projectname is a good name in context of github.

Here its the username that makes sense.

It is much easier if the *actual* origin (i.e. the main repo) is referred to as origin and its peoples (or gerrit) forks that are referred to by a name.

This is what things like the hub cli does and it makes things so much easier to deal with. You always know which is the true origin, and then everything else is referenced as having a unique user name.

Thus I would suggest that at least if the url being cloned from is github then take the username/organization name as the second alternative.
Comment 10 Alex Blewitt CLA 2015-03-22 06:42:47 EDT
As a counterpoint, I have the same username in bit bucket as well as github so that would be useless for my use case. The point of raising this bug is in a multi-hosted world it's useful to track which distinct host(s) the repository is associated with. 

If you have multiple repositories on github I can see the benefit of having different user ids but this is largely irrelevant in the case of cloning which is a single repository operation and doesn't affect subsequent remote repositories that you might push to.
Comment 11 Max Rydahl Andersen CLA 2015-03-22 14:48:06 EDT
yeah, these improvements doesn't really help if only done for clone, should also be possible when adding remotes.
Comment 12 Max Rydahl Andersen CLA 2015-03-22 14:49:34 EDT
actually just realized I never used git to do what corresponds to "git remote add" ...where is that feature actually ? 

I only see UI that wants me to mess around with refs which when using the CLI is not exposed by default at all.
Comment 13 Alex Blewitt CLA 2015-03-22 16:13:25 EDT
I suggest moving the discussion of a different feature/enhancement request to its own bug. This is about cloning a new repository only.
Comment 14 Matthias Sohn CLA 2015-03-22 20:03:11 EDT
(In reply to Max Rydahl Andersen from comment #12)
> actually just realized I never used git to do what corresponds to "git
> remote add" ...where is that feature actually ? 

select "Remotes" in "Repositories View" and click "Create Remote..."