How Github implemented its Pull Request feature [closed]
Asked Answered
P

1

5

I have question about GitHub — how they implemented Pull Request feature. Git SCM itself has git-request-pull commands. According to this answer GitHub can use git-request-pull and git-format-patch to do this.

How they implemented this feature? And what about Gitorious and Gitlab? How they did the same?

Pincer answered 11/7, 2013 at 11:5 Comment(1)
IIRC, they are open-source. Why don't you just check it for yourself? Or ask "them" directly, I mean, whoever seems to be roughly-recently contributing to that part of Git?Triboelectricity
C
7

They store the name of the branch from which you want to pull and generate diffs using git diff ^target-branch pull-head. When you accept the pull request, they simply run git merge pull-base.

They do not use git request-pull. There is even a discussion where Linus Torwalds insults them for it :)

Caecilian answered 11/7, 2013 at 11:10 Comment(5)
You made my day by this link! Thanx alot!Pincer
What about Gitorious and Gitlab?Pincer
I have little experience with those, but I am pretty sure they do the same.Caecilian
but with the diff, how can you know there will be merge conflicts or not?Analiese
You need to run git merge to find out if there are merge conflicts. I'd assume that's also very close to what they do.Caecilian

© 2022 - 2024 — McMap. All rights reserved.