Why does Github call code merge requests pull requests instead of push requests?
三叔
三叔 2017-06-20 10:05:54
0
4
1121

https://stackoverflow.com/que...

I read the explanation here, but I still feel it’s not convincing enough

My understanding is: I made some changes, and I request to push my changes to your warehouse. Then you review my code. If there is no problem, accept the merge request. This is called a push request. Wouldn't it be more appropriate? Because this operation was initiated by me. Pull is an operation initiated by the warehouse owner to my forked warehouse, so the pull request operation should be initiated by the upstream warehouse owner from me, instead of me actively asking the upstream warehouse owner to pull the code in my warehouse.

三叔
三叔

reply all (4)
黄舟

That’s right, this should be explained separately.

This pull refers to the operation of the authority subject. You submitted the code, but you do not have permission to operate the upstream repo. You need the owner of the upstream repo to review your code, and then modify your code and pull it into his repo. This is the explanation for pull.

And request refers to the action that initiates the subject. In other words, although the owner of the upstream repo has control of the repo and can pull your code changes into his own repo, he will not take the initiative to pull. Instead, you (the initiating subject) need to submit an application, that is, a request, to the owner of the upstream repo, and then the owner of the upstream repo will respond to your request, which is to perform the process of review and pull you call it.

So, the way to understand the pull request is: arequestthat notifies the upstream repo owner to pull the code (pull).

In English, request generally refers to submitting an application and requiring the other party to respond to the application. The modifier before request is the action of the respondent. Of course, it is the same in Chinese. For example, "application for joining a group", after you submit the application, you need to be allowed to join the group before you can be considered a member. Therefore, you do not take the initiative to join the group, but the reviewer adds your name to the group to be considered "joined". In the same way, in "pull request", the request is submitted by you, and pull is what the other party does.

    大家讲道理

    In another way of writing,xxx requestcan be written as "request for xxx", which should be easier to understand.

    Thesomeonein brackets represents the omitted part.

    request (someone) for push, the executor ofpushis "someone", so this "someone" is you, because it is yourpushcode. If it isrequest (someone) for pull, then the executor of thispullis the owner of the code base, so it is you who requests someone elsepull. Obviously the latter is more in line with the actual situation.

      为情所困

      You have clearly distinguished between active and passive.

      Then the actual problem is that a pull request is when you request the upstream warehouse to pull your code. And if you use push request, you force push the code to the upstream warehouse.

      Actually, push and pull here do not mean whether you did it actively or passively, but whether your code was pushed to it actively by you, or whether your code was pulled by others.

        为情所困

        If you use gitlab. Then its merge request should be much easier for you to understand

          Latest Downloads
          More>
          Web Effects
          Website Source Code
          Website Materials
          Front End Template
          About us Disclaimer Sitemap
          php.cn:Public welfare online PHP training,Help PHP learners grow quickly!