Skip to content

Hard coded remote names #141

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
jayvdb opened this issue Mar 13, 2017 · 2 comments
Closed

Hard coded remote names #141

jayvdb opened this issue Mar 13, 2017 · 2 comments
Assignees
Milestone

Comments

@jayvdb
Copy link
Collaborator

jayvdb commented Mar 13, 2017

I've only started playing, and it seems like the remote 'gitlab' is special, and everything else is ignored. I suspect the same occurs for github and others.

This means git-repo cant be immediately used in a git clone of a gitlab repo that was cloned using git clone, as that will use the remote name origin.

It would be nice if git-repo handled a missing gitlab remote by looking for another suitable remote that points to gitlab, with a sensible strategy that works in most cases.

The most obvious fallback is to look to see if origin is a gitlab repo, and use that.

Then looking at all remotes, and see if there is only one that points to gitlab, then that should be the default used.

git-repo could then create a gitlab remote if it needs to avoid expensive calls again, so the gitlab remote becomes more of a cached default remote, rather than the only one that works.

@guyzmo
Copy link
Owner

guyzmo commented Apr 30, 2017

That would be an amazing nice to have feature, indeed! And I'm totally open for getting a PR to get something doing that implemented.

I believe that could be done with a command like:

% git lab add
I found several remotes pointing to gitlab.com:
[1] origin: [email protected]:foo/bar
[2] other: https://gitlab.com:bar/foo
[3] yayay: [email protected]:bleh/blih
Please chose which remote shall the gitlab one point to: _

because I'd rather avoid doing it automagically whenever you call any command (when I call git lab request ls I don't expect anything to get mutated), but rather have the command fail:

% git lab request ls
Failure: repository not configured.
Hint: there's at least one existing remote pointing to gitlab.com, to make it work, type git lab add!

And anyway, until it's done, you can easily add the gitlab remote when it's missing with:

% git lab add user/repo

Currently, I first want to get the basic features well covered, and the existing one to work well.
So I'm not scheduling it into a milestone.

@guyzmo
Copy link
Owner

guyzmo commented May 4, 2017

I've pushed git lab add and git lab upstream in the devel branch. It will be in 1.10 🙌

@guyzmo guyzmo added ready and removed help wanted labels May 4, 2017
@guyzmo guyzmo self-assigned this May 4, 2017
@guyzmo guyzmo added this to the 1.10 milestone May 4, 2017
@guyzmo guyzmo closed this as completed May 5, 2017
@guyzmo guyzmo removed the ready label May 5, 2017
guyzmo added a commit that referenced this issue May 8, 2017
First anniversary release 🎂

This release marks the first anniversary
and 10th release of git-repo 🎉

Now git-repo supports 6 git services:

  github, gitlab, bitbucket,
  gogs, gitea and gitbucket

It supports the following commands:

  clone, fork, create, delete,
  add, open, ls, request, gist

And it's becoming relatively stable
(keep sending bug reports 🙏)

♥ Contributors

Thanks to @kounoike for the gitbucket support 🙌

Now there are three contributors promoted to collaborators:

* @kounoike, @pyhedgehog and @Crazybus

🚧 Features

* When add has no parameters, add default remote #100 #141
* When add has 'upstream' parameter, add the upstream remote #99 #141
* Use default branch instead of hardcoded 'master' #91
* Refactor and complete bitbucket support #43 #11 #80 #14 #89 #90 #79
* Loosen versions of dependencies #133
* Report if the service is already setup #136
* Adds GitBucket support #142 #144
* Adds support for ssh:// URL #148

🚒 Bugfixes

* fix various crashes #152
* fix gitlab clone crash #129
* fix request create command #147 #127
* fix request fetch command #138 #131
* fix wizard crash #149
* fix mishandling of renamed gitlab project urls #137

📝 Documentation

* documentation #145

Signed-off-by: Guyzmo <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants