How can I review the code using GitHub?

GitHub has an excellent mechanism for discussing commits and request requests. However, if I created a repo and I would like someone to comment on all the code in my repo , what is a good way to do this?

  • Entries exist, but only code windows are displayed at a time, so do I need to create commits that span every line of all files of interest?
  • If so, my best option is to touch each file by adding a space at the end of each line? (Ugh). I can create this commit in a branch and then issue a transfer request to my own repo from this branch so as not to pollute the master.
    • for x in <files of interest>; do sed "s/\$/ /g" $x > $x.new; mv $x.new $x; done

Here's a related question about commenting without commits .

Update:

With inspiration from @VonC, I used the following process, which, in my opinion, is the simplest and best, since it does not interfere with the master branch or requires additional efforts from my reviewers.

1. In my local clone of my repo, I created a branch called code_review.

 git checkout -b code_review 

2. In this thread, I deleted all the files that I wanted to view, committed this change and clicked.

 git rm -rf * git commit -am "files to be code reviewed" git push origin code_review -u 

3. In Github, from the main branch, I issued a pull request for the code_review branch. It was an option from the main screen for this project.

4. Finally, I sent my reviewers a link to this stretch request so they can comment on my code line by line. Be sure to tell them to click on the “files changed” tab for inline commenting.

+26
comments github code-review
Jan 23 '13 at 12:00
source share
2 answers

Update 2016: at GitHub Universe 2016 , GitHub introduced advanced reviews

our first step is now available on all pull-reviews requests. In addition to comments on specific lines of code, reviews allow you to formally “approve” or “request changes” to request requests. You can also leave a review review and delete, edit or lay out comments before sending.

https://cloud.githubusercontent.com/assets/3477155/18469521/7fb32732-7976- 11e6-80cf-f2ab37688768.gif




If you change the default branch of your Github review to an empty branch, the colleague managing the fork should be able to fulfill the request to migrate to your Github registry, which will show the full code.

+8
Jan 23 '13 at 12:45
source share

Github does not support the feature you need.

I think this is not the best way, but you can create a new repo and copy all the files in this repo and transfer everything at once, and then others can write comments. This solution will solve your problem.

I also write this answer for Comment line in Github without a commit issue

+6
Jan 23 '13 at 12:07 on
source share



All Articles