Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

How does/will gitlab handle submodules? #58

Closed
benasher44 opened this Issue · 67 comments
@benasher44

See diaspora.git in gitlab demo vs github. There's a submodule link/pointer at the bottom on github.

@vsizov
Collaborator

gitlab not handle submodules. And will not handle in future

@vsizov vsizov closed this
@nicoulaj

Why ?

@vsizov
Collaborator

what for?

@vsizov
Collaborator

do you have example this features? Github use it?

@benasher44

A lot of the projects that I work with use git submodules. If you look at https://github.com/diaspora/diaspora, you will see the last item at the top level of the files browser is a link to another git project. That's a submodule, and github has support for it. It would be great if gitlab could have this same submodule project link feature.

Basically, the project points at another git project or submodule, and it's included in the source when you clone it (have to run some other commands to clone the submodules too). Not only does it point at another project, but it also points at a specific commit of another project. This makes it really easy to just cd into your dependency (that is a submodule) and just git pull to update your project to the latest version of that dependency.

@vsizov
Collaborator

i know what is submodules. but i do not understand what must do gitlab?

@benasher44

Could you all have a link in the file tree where the folder would be for that git project (like a symlink almost), like github? When you click the link, it would take you to that project at that commit pointed to by the parent project.

@benasher44

Even better, the way github does it is they have a link the looks like this in the file tree:

Project - commit_hash

Clicking on the project part of the link takes you to the main project tree for that submodule. Clicking on the commit_hash part of the link takes you to the project tree for that submodule but at the specified commit. Again, see https://github.com/diaspora/diaspora.

@benasher44

Is ther anyway this can be reopened? Submodules are a pretty well-used feature of git, and github supports them.

@lafka

+1 would be nice to know that a submodule is included.

If you are looking at code with dependencies to a submodule it's nice to atleast know where these dependencies comes from, instead of being met by a blank directory.

@benasher44

The current version of 'grit' has support for reading the submodule information for a repo (Grit::Submodule).

@benasher44

Are there any plans to include support for submodules in 2.1 Adelante?

@tvb
tvb commented

+1 Gitlab brakes my commit link now for a submodule part

@ldath

+1

@jan-glx

+1

@santeriv

+1

@nibua-r

+1 (I use submodules a lot)

@zzjin

+1

@helmus

+1

@fbender

+1
(very much needed at my university to keep the logic visible and to allow closed source code to be separated from open source code, which is then synced to github)

@dacay

+1

This feature is the main deciding point for me...

@diogogmt

+1
This reminds me of the incident of the gnome dev: https://bugzilla.gnome.org/show_bug.cgi?id=698544

Question:
How does/will gitlab handle submodules?
Answer:
gitlab not handle submodules. And will not handle in future
CLOSE TICKET
Question:
Why ?
Answer:
what for?

@vrutkovs

+1

@mweather

+1 This is a basic git and github feature and it's not uncommon to have projects that include submodules. Chef cookbooks use them quite often, for example.

@kod3000

+1

@mmerickel

+1, not supporting a core feature of git is pretty silly especially one as commonly used as submodules. Why is this issue still marked as closed?

@Pro

+1. Submodules are already shown as such. The only modification needed is that if you click on the link, it should open the corresponding project in gitlab.

@nkulikov

@Pro, yeah it would be perfect!

@LoicMahieu

@vsizov Would be a nice feature, no ?

@h3
h3 commented

The fact that this core git feature does not show up in the gitlab interface after 2 years is quite astounding.

Just appending the modules listed in the .gitmodules file after the directory listing.. it can't be that hard to implement!

I whish I knew Ruby better.. I'd do it myself.

@Pro what are you talking about ? I have the latest Gitlab running and a project with a submodule and it doesn't show up in the files at all.

@Pro

@h3: Look at the following screenshot:
submodule

The last entry is a submodule called 'Common'. As you can see on the right side, it is already a URL, but the address is wrong: https://git.domain.com/my-repo/tree/master/git@git.domain.com:my-common.git
it should be: https://git.domain.com/my-common

I'm using Gitlab 5.3

@sdawans
+1. Submodules are already shown as such. The only modification needed is that if you click on the link, it should open the corresponding project in gitlab.

A much better but less trivial thing would be to open the corresponding project at the particular commit referenced from the top project. I suppose it requires first the support of viewing the working tree of an arbitrary commit, as opposed to the current model where we can only view specific refs (tags/branches) of a project.

@h3
h3 commented

My bad, I did not initialize the submodule properly.

I'm also using gitlab 5.3, but I'm using an external submodule (links to github) using HTTPS and the link is correct.

So I guess there can be to possibilities:

  1. Submodule linking is broken when using non HTTP repositories (most likely)
  2. Submodule is broken when using gitlab repositories (unlikely)
@zandar

+1
Same situation here. I am really missing this feature. It seems that it is almost working, but the links to the submodules are broken. Will be perfect if this will work!

My situation:
I created a group. This group consists of three projects - repositories.
First project is kind of board support package, so I am versioning it in a separate repo.
Second project is another layer and I need to hold its versions separately too.
Third project is everything else plus it uses previous two projects as submodules.

If you set all paths to repositories properly, you can clone the main project and do submodule init and update and you will get what you want. But in the GitLab web interface, you can not access the submodules and their appropriate versions from the main project, because the link is broken.

I am using ssh, did not try it with http access/paths, but I am almost sure it will not work either.

@t0mk

+1

@fjukstad

+1!

@Klobi42

+1

@bigfatbrowncat

Submodule with a relative url doesn't show up. My .gitmodules file looks like:

[submodule "blabla"]
    path = blabla
url=../blabla.git

blabla repo is next to this repo in GitLab, git handles it well, but there is no entry in GitLab files list named "blabla"

@nkulikov

It is strange decision intentionally avoid submodules because in big projects they are very useful and recommended (http://lwn.net/Articles/246381/). Yeah they have some issues but there is no "silver bullet"...

@imoldman

+1, gitlab is not a TOY!!!

@modulec

+1

@Rovanion Rovanion referenced this issue from a commit in Rovanion/gitlabhq
@axilleas axilleas Implement #58 #96 #99 9eabc93
@dosire
Owner

Should be fixed in GitLab 6.2. See working links in this public repo https://dev.gitlab.org/samples/submodules/tree/master

@christianpauli

It only works if you link the submodules via http(s). The url = git://github.com/chneukirchen/rack.git link is producing a protocol error:

The address wasn't understood
Firefox doesn't know how to open this address, because the protocol (git) isn't associated with any program

@dosire
Owner

@christianpauli Can you make a public example repo at GitLab Cloud to demonstrate?

@christianpauli

@dosire
Your own example has the issue. the rack.git submodule is linked as: git://github.com/chneukirchen/rack.git ...
https://dev.gitlab.org/samples/submodules/tree/master

I think parsing the url for the link to the repo
from: git://github.com/chneukirchen/rack.git
to: http(s)://github.com/chneukirchen/rack.git
should do the trick depending what the webserver is running (http/https)

I keep adding...sorry
I have linked submodules on my gitserver as:
git@server.com:group/repo.git
which would again result in a failure.

@dosire
Owner

@christianpauli Ah, thanks, I only tried the first two links.

I think we'll accept merge requests to rewrite the git links to http links.

@dosire
Owner

@christianpauli We can't rewrite all git links to http, some of them might not have a http repo link (for example ones stored on Gitolite). You would need to only rewrite links to the current server and know places (gitlab.com/github.com). We will not write this code. We might accept a merge request for this but it depends on how the code ends up looking.

@christianpauli

@dosire that was aimed at the current server. Thank you for the answer. And thanks you and all others for gitlab. Using it and loving it!

@dosire
Owner

@christianpauli Thanks Christian, we :heart: that you are using GitLab. I think a merge request that only modifies the url if it is aimed at the current server would be best.

@dosire
Owner

For people skimming this issue, GitLab supports viewing submodules, see https://dev.gitlab.org/samples/submodules/tree/master

@Javex

The thing missing here are git@server.com URLs, these don't get rewritten for me :-/

@dosire
Owner

@Javex Did you read #58 (comment) ?

@jhollingsworth

@dosire @Javex I have created a MR to address the questions about SSH based submodules. It can be found at https://gitlab.com/gitlab-org/gitlab-ce/merge_requests/15. Maybe this will satisfy peoples needs. I know if meets mine.

@thewholelifetolearn

@jhollingsworth It is a great MR! We are several using submodules for our projects at work and we were hopping for such a feature.
Thanks a lot

@yades

+1

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.