News for hackers. Stuff that matters.
Re:Code Review from the Command Line by davvid on Saturday September 25, 2021 @06:54PM (#28656876)
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.

Re:Code Review from the Command Line by faisalhackshah on Saturday September 25, 2021 @10:59PM (#28658070)
You can also use "git difftool <commit>...<commit>" (with 3 dots).

https://git-scm.com/docs/git-diff#Documentation/git-diff.txt...

Re:Code Review from the Command Line by sixstringtheory on Saturday September 25, 2021 @09:00PM (#28657480)
I just recently learned that there’s a --gui option for git difftool, which is nice because I use Kaleidoscope for heavy diffs (and merges too with git mergetool) but recently picked up delta [0] for quicker diffing in the terminal. Now I can have both easily.

[0]: https://github.com/dandavison/delta