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

Features/linguist #1410

Closed
wants to merge 8 commits into from
Closed

Features/linguist #1410

wants to merge 8 commits into from

Conversation

SaitoWu
Copy link
Contributor

@SaitoWu SaitoWu commented Sep 8, 2012

use github-linguist to instead of gitlab linguist.

add detect language feature.

image

Important:

post-receive need to export git_work_tree variable. that is why we can detect language.

projects added a language field. the default language is Plain Text

Next:

we can checkout gl-pages branch to a folder too. so , we can have our gitlab pages!.

@@ -9,4 +9,8 @@ do
pwd=`pwd`
reponame=`basename "$pwd" | cut -d. -f1`
env -i redis-cli rpush "resque:queue:post_receive" "{\"class\":\"PostReceive\",\"args\":[\"$reponame\",\"$oldrev\",\"$newrev\",\"$ref\",\"$GL_USER\"]}" > /dev/null 2>&1
# export GIT_WORK_TREE variable for Language detection
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

How GIT_WORK_TREE helps for the Language detection? I do not see the relation. Can you explain?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Git bare repo didn't have repo's source code in the file system.

If we have a GIT_WORK_TREE variable, the work tree will be there. just like a unbare repo.

Linguist works will unbare repo(work tree).

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

After first push detection, the /home/git/repositories will be like this.

img

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We have sattelite repo. Maybe we use it instead of patching hook

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@randx If we use satellite repo , I think we should keep the satellite repo up to date.

Satellite repo didn't pull unless it has a merge request and do merge.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yeah you right

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, I'll handle it. :-)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

one more question. Does it increase repositories size 2x? As i understand we keep bare repo and normal one

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lets chant in campfire?

@SaitoWu
Copy link
Contributor Author

SaitoWu commented Sep 9, 2012

@NARKOZ @tsigo just fixed the problem, thx for review.


# Update project's language field
update_attributes(language: detect_repo_language)

end
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's only update attributes once. Change the default branch line to just be self.default_branch = discover_default_branch, then change yours to self.language = detect_repo_language, then add a save call at the bottom.

@ghost ghost assigned dzaporozhets Sep 12, 2012
@dubcanada
Copy link
Contributor

Tried this out, issue with Resque

uninitialized constant Gitlabhq::Satellite
/home/gitlab/gitlab/app/models/project/repository_trait.rb:41:in `satellite'
/home/gitlab/gitlab/app/models/project/hooks_trait.rb:106:in `trigger_post_receive'
/home/gitlab/gitlab/app/workers/post_receive.rb:11:in `perform'

@SaitoWu
Copy link
Contributor Author

SaitoWu commented Sep 27, 2012

close this issue now, I'll send a new PR next week..

I was been busy these days.

@SaitoWu SaitoWu closed this Sep 27, 2012
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