[HN Gopher] Code Review from the Command Line ___________________________________________________________________ Code Review from the Command Line Author : winkywooster Score : 64 points Date : 2021-09-25 18:48 UTC (4 hours ago) (HTM) web link (blog.jez.io) (TXT) w3m dump (blog.jez.io) | l0b0 wrote: | `git depgraph` is really interesting, but it's based on Madge[1], | which looks JS-specific. Does anyone know of something like Madge | which is cross-language, that is, resolves references between | files in Nix, Python, Java, JS, Ruby, Rust, Bash, etc? | | `git heatmap`[2] is also cool. It should be easy to implement as | an alias; this is 80% of the way there: git log | --name-status --pretty=format: | sed '/^$/d' | cut --fields=2- | | sort | uniq --count | sort --numeric-sort --reverse | head | | [1] https://github.com/jez/git-madge | | [2] https://github.com/jez/git-heatmap | pm90 wrote: | Maybe for an initial look through but most of my code reviews | involve a conversation with everyone involved. It would be | difficult to keep track of the that locally IMO. (Small | exception: IDEs like IntelliJ let you sync comments so you can | have the whole thread within your IDE) | kubanczyk wrote: | For GitHub/vscode combination, there's a plugin that let's me | see/add/edit comments locally for a pull request. No idea what | is available in vim or emacs. | frutiger wrote: | https://github.com/pwntester/octo.nvim | sweeneyrod wrote: | There is an interesting take on command-line code review from | Jane Street here https://blog.janestreet.com/putting-the-i-back- | in-ide-toward... | davvid wrote: | You can get pretty far with git builtins. | | When you're looking to review what happened on $review_branch, | you really only need to lookup where their branch begins, and | then take look at the diffs. | | Where the branch "begins" is the merge-base of your current | commit (assuming you're up to date) and the review branch tip. | review_branch=origin/branch-name branch_point=$(git | merge-base $review_branch HEAD) git difftool | $branch_point $review_branch | | One advantage is that "git difftool" has support for vimdiff and | a whole bunch of other diff tools. The upside of leveraging | difftool is that you can use all of the bulitin git diff stuff, | eg. using `-- <path>` at the end of the command to limit the diff | to just the specified paths. | | If you want to diff everything in one shot, "git difftool | -d/--dir-diff" will do that too. | [deleted] ___________________________________________________________________ (page generated 2021-09-25 23:00 UTC)