Skip to content

Conversation

@amacarthur
Copy link
Contributor

This is an updated version of the previously rejected pull request: 3145.

  • "Fork" button on project page will create new project in user's namespace
  • updated to use GitLab v5 rather than 4.2, including using gitlab-shell rather than gitolite
  • improved test coverage
  • addition of table forked_project_links to track which projects are forked from where
    • this will be important to enhance merge requests to go across forked repos

amacarthur and others added 3 commits March 24, 2013 00:50
Change-Id: I5f73592261bc64bae0c97bd0f10f37197a6714a4
Change-Id: I36bbfc77c8cf895489ba78dd66fdd9d2b62ca891
@drewblessing
Copy link
Contributor

Neat idea. I hope it can make it in

@brodock
Copy link
Member

brodock commented Mar 26, 2013

👍

@kirantpatil
Copy link

Hi @amacarthur ,

Does fork repo is shared with parent repo ?

or

Has repos duplication issue taken care of ?

@dzaporozhets
Copy link
Contributor

As I mentioned in previous PR please dont do a fork with grit library. It should be handled by gitlab-shell

@amacarthur
Copy link
Contributor Author

It wasn't clear to me from previous PR that I was unable to use the Grit library. It seems that you are not using Grit in gitlab-shell at all. Is there a particular reason you are avoiding using Grit?

To clarify what I need to change:

  • add fork command to gitlab-shell which forks the repo and executes the create_hooks
  • the fork_repo method on Repository should call the fork in gitlab_shell

Is there anything else that needs addressing?

@dzaporozhets
Copy link
Contributor

@amacarthur Yeap we have gitlab-shell for managing repos. We dont use grit because its no sense to use such big library in simple git init --bare commands. Also we are going to move from grit in future - so gitlab-shell is free from any git libraries.

Yes you need to:

  1. create a fork method inside gitlab-shell. See (https://github.com/gitlabhq/gitlab-shell/blob/master/lib/gitlab_projects.rb)
  2. Use Shell class in gitlab to call gitlab-shell ( See https://github.com/gitlabhq/gitlabhq/blob/master/lib/gitlab/backend/shell.rb )
  3. Use ShellAdapter to call fork from any model/context of application (https://github.com/gitlabhq/gitlabhq/blob/master/lib/gitlab/backend/shell_adapter.rb)

@dzaporozhets
Copy link
Contributor

Feel free to ask if something is unclear

@x3ro
Copy link

x3ro commented Apr 5, 2013

👍 Does the PR also include creating a merge request from a forked repo to the original? I'd didn't immediately find it in the changes, but then again I'm not really familiar with the GitLab codebase :)

In any case, I might be able to find some free time if you need help, @amacarthur

@amacarthur
Copy link
Contributor Author

this patch does not enhance merge requests to support cross project merges. That is certainly something that I am interested in pursuing, but I don't have a firm timeframe for implementation yet. From an initial investigation, I believe the existing merge request structure should support cross-project merges without too much effort.

Perhaps you'd like to start work on expanding merge requests?

I am preparing a patch which address @randx points. This should be available very soon.

@x3ro
Copy link

x3ro commented Apr 5, 2013

I'll try to make some time to look at cross-repo merge requests then :)

@amacarthur
Copy link
Contributor Author

I have a question for you @randx. I am putting together a new pull request. I believe I have something worth submitting, but have encountered an issue I hope you can help me with.

I wrote the updated version branched off the latest stable versions of gitlab-shell and gitlabhq. All my test run clean of v5 of gitlabhq, but I have encountered errors when I attempt to update to the latest master. When using factory_girl to create a project to fork from, the project no longer has a repository attached, which causes my fork tests to fail. I am unfamiliar with factory_girl and am having some trouble debugging it to locate my problem.

I notice that there has been some refactoring around stubbed_repository and a recent addition of TestEnv, and I suspect my trouble may lie there. Originally I had a line of code that created a project like so:

create(:project, name: "Shop")

This would give me project with a repo which I could successfully fork from. Looking at the other examples to see how I should update my tests, I have tried using the following:

create(:project_with_code, name: "Shop")

but am still creating a project with no repo that I cannot fork from.

Is there something I am missing?

@amacarthur
Copy link
Contributor Author

Disregard above comment. I have solved my problem. Updated pull request coming.

@amacarthur
Copy link
Contributor Author

Closed in favour of : #3597

@kirantpatil
Copy link

@amacarthur

When can we expect "git-alternate" feature in GitLab to avoid dedup of forked repos ?

I have raised the feature request at http://feedback.gitlab.com/forums/176466-general/suggestions/4027712-save-disk-space-git-alternates-to-eleminate-re

@amacarthur
Copy link
Contributor Author

@kirantpatil

I have responded on the feedback forum thread you linked to.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Development

Successfully merging this pull request may close these issues.

6 participants