GitHub: how to review code in a new file with more than 1500 lines

In the project I'm working on, we have the main branch of the function, which is approaching merging into the main branch. There are many commits that should not be considered separately, so I created a PR for the branch and looked at the diff file https://github.com/haskell/cabal/pull/2952/files

However, there are several new files that exceed the default GitHub limit of 1,500 lines. I can click to view the file, but then the GitHub comment interface is no longer available.

So the question is, how do I add a CR file to GitHub, where the file contains more than 1500 lines?

+5
source share
1 answer

I would argue that you avoid striving for a specific GitHub solution. Instead, you can review the code using traditional tools. The most reliable is the git command line. Send the remote branch to the local computer, and then:

> git log -p -n 1 COMMIT_ID -- INTERESTING_FILE(s) 

Example:

 > git log -p -n 1 abcdef -- foo.txt bar.txt 
  • -p to get the patch
  • -n 1 for single commit
  • -- to start the file list
  • COMMIT_ID can also be a tag name, branch name, and anything you like to target your commits.

On many systems, you can scroll up / down using the less pagination tool; often out of the box.

And more convenient options on the manual pages: https://www.kernel.org/pub/software/scm/git/docs/git-log.html


As an alternative, I believe that GUI tools like [ gitk ] will be able to handle all of these buffering / scrolling. You will get maximum productivity when working at the local level. Although this can be obtained using Remote Desktop and / or Remote x, there is often too much lag when all this is transmitted over a network connection.

Note. I don't use gitk often, so I cannot be 100% sure of its ability to handle very large files. Please let me know if this is not an option in the comments.

0
source

Source: https://habr.com/ru/post/1238446/


All Articles