如何在github上查看整个代码库? [英] How do I review an entire codebase on github?

查看:91
本文介绍了如何在github上查看整个代码库?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在GitHub上的git repo的单个分支中查看所有代码.(我是一名教授,并且代码是学生论文的一部分.)任何单个提交都只会影响代码的一小部分.我该如何进行审核,使我可以对任何提交中的所有代码进行逐行注释?

我相信这个问题与

I would like to review all of the code in a single branch of a git repo on GitHub. (I am a professor, and the code is part of a student's thesis.) Any single commit affects only a small portion of the code. How can I perform a review that allows me to make per-line comments on all of the code from any commit?

I believe this question is related to How can I make a github PR requesting review of entire files?, which was never answered.

解决方案

Navigate to the repo, then select the branch (for example) with the dropdown:

Then after the switch you can choose to Compare or Pull request which will display again at the top of the repo file list - in both you can compare, but PR option can open a "ticket" for merging - the request to pull from a branch.

Or you can click on the commits link:

Then simply open the commit (if you check from Compare or Pull request and within the diff itself you can hover over specific lines. Once the cursor hovers a + sign appears. You can comment and the author will get a notification via email.

Note: while reviewing the whole codebase is possible through commits, make sure you know what state you're reviewing because the commit comment won't simply disappear as if in a Pull request. It'll stay there, so you'll need to somehow make a note that it's resolved (unless GitHub added a new feature I'm not aware of) and check again e.g. in master branch whether the part of the file has been resolved.

It's quite a cumbersome process though, so it'll be okay probably just for smaller sections of the codebase or for school projects as it doesn't scale well due to the comments remaining in place and required manual task of checking whether the review comments have been taken into consideration / implemented.

For scaling you can use perhaps a more intrusive, but more scalable technique such as creating a new empty repo (or a new branch, then while :;do git reset HEAD~ --hard;done up to initial commit) and adding relevant file(s) grouped by a feature they represent (and hopefully a test, because it'll definitely break the codebase for a while) and then start opening PRs for each, review, let GitHub remove the comments and merge when the code is of a sufficient quality. Still though, it's a workaround when trying to treat git as a simple folder structure, which it is not - rather a graph/tree.

Alternatively you can create a task list for your student/colleague/peer where s/he can mark the tasks as completed or open a completely new issue with relevant lines referenced by a permalink.

这篇关于如何在github上查看整个代码库?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆