Skip to content
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

Match branches with their remote in the config #21

Open
victornoel opened this issue Aug 28, 2015 · 3 comments
Open

Match branches with their remote in the config #21

victornoel opened this issue Aug 28, 2015 · 3 comments
Milestone

Comments

@victornoel
Copy link

Hi,

I have a repository with many branches and each of them points to a different remote.
But I don't know why, gws tries to match them to origin… for example I get one with a message as follow:
andreptb : No remote branch origin/andreptb

But in my git config I have:
[branch "andreptb"]
remote = andreptb
merge = refs/heads/master

with andreptb declared as a remote.

@StreakyCobra
Copy link
Owner

Hi,

At the beginning gws was using only two remotes names: origin and upstream, this was hard-coded inside the script. An issue (#12) was opened about this, and now it's possible to define per-repository custom remotes names inside the .projects.gws file. These informations are only used to allow gws to set remotes when recreating the workspace on a new place/machine/etc.

gws is still looking at origin for displaying the status because... I haven't thought about this special case 😄

What seems possible is:

  • Make gws to look at the configured remote when checking for the status

What seems difficult/impossible without big changes:

  • To restore association between branches and remotes when recreating a workspace.

So if there is a way to get the configured remote for a given branch, I can use this information when checking for branches statuses. But you will still have to re-associate branches with their remotes when you recreate the workspace somewhere.

@victornoel
Copy link
Author

I understand better where this comes from: easily setting up local clones.

I think that at least, it would make sense to use the configured remote for each branch to check their status, I don't see why anybody would be expecting something else. That's your first point, and in a way, the original subject of my request.

As for the second point, I didn't even think about it ^^ So yes, I guess you can't do so much… well, I'm not sure it is something extremely needed (to have gws autocreating local branches and associating them to remotes) since after cloning, you usually create branches yourself when the need arises, and then you would associate them to remotes by hand too, it would make sense to do so.

@StreakyCobra
Copy link
Owner

I think that at least, it would make sense to use the configured remote for each branch to check their status, I don't see why anybody would be expecting something else.

Agreed, I'll investigate on this (when I'll have time 😓 )

I'm not sure it is something extremely needed (to have gws autocreating local branches and associating them to remotes) since after cloning, you usually create branches yourself when the need arises, and then you would associate them to remotes by hand too, it would make sense to do so.

I share your point of view. It is be possible to do it, but it would make everything (code, syntaxes, etc.) more complex. gws aims to stay simple :)

@emlun emlun modified the milestone: Clean backlog Aug 11, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants