Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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.



You can also use "git difftool <commit>...<commit>" (with 3 dots).

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


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




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: