search

Home  >  Q&A  >  body text

git - code review是什么?

新手刚入门,能否简单讲一下code review是什么东西?怎么进行code review?
谢谢

PHP中文网PHP中文网2766 days ago1280

reply all(5)I'll reply

  • 高洛峰

    高洛峰2017-05-02 09:51:24

    Code Review, refers to code review; scenario: a new person or junior engineer makes some changes, but needs to be confirmed by an experienced programmer before adding them to the main branch or feature branch; is it impossible to let an experienced programmer sit next to you and look at the code? This is such a waste of time;

    For example:
    Project A has two branches master分支和dev分支;现在公司在开发,所有人完成任务,都应该把分支合并至devbranch;

    Zhang San used his own local development environment, based on the dev分支,创建zhang_san branch; it took him three days to complete a function;

    The old programmer felt that Zhang San was a novice, so he put his changes directly into the dev branch; he asked Zhang San to apply for Merge and let him dev分支;就让张三提个Merge申请,让他Code Review ;

    So Zhang San branched his zhang_san分支提到远程服务器上,操作“New Merge Request”,发起一个Merge请求,将zhang_san合并至dev and designated the reviewer to be an old programmer;

    The old programmer found some free time to check this Merge Request and felt there was something wrong, so he made some suggestions (the suggestions will be automatically sent to the relevant email address of the relevant person);

    Zhang San later checked the suggestions made by the old programmer through his email, and branched them locally zhang_san进行了修改,并git push至远程zhang_san;

    The "Merge Request" at this time will update the latest Commit;老程序员再看这次总的改动,发现不错,挺好的,点击确认请求后,就成功将zhang_san分支上的改动合并至dev branch; [The Code Review is completed now]

    Zhang San was very happy to know through email that his branch had been merged into the development branch dev; he could delete the local zhang_san branch and the remote zhang_san Branch and keep the branch clean; you can also continue to do new development in the zhang_san branch, submit a new Merge_Request, and conduct a new round of dev很开心;可以删除这个本地zhang_san分支和远程zhang_san分支,保持分支干净;也可以继续在zhang_san分支做新的开发,提交新的Merge_Request,进行新一轮的Code Review.

    reply
    0
  • 淡淡烟草味

    淡淡烟草味2017-05-02 09:51:24

    code review is code review, you can search on Baidu, there are many articles

    reply
    0
  • phpcn_u1582

    phpcn_u15822017-05-02 09:51:24

    Others will read the code you write, and you will also read other people’s code

    The review is over and will be online again

    reply
    0
  • 过去多啦不再A梦

    过去多啦不再A梦2017-05-02 09:51:24

    Code review, generally large companies require code review. If there is a problem with the code or it does not meet the specifications, modify it correctly before going online.

    reply
    0
  • PHP中文网

    PHP中文网2017-05-02 09:51:24

    Three thousand lives lost: pitfalls in the old code

    reply
    0
  • Cancelreply