Last active
October 7, 2021 22:24
-
-
Save victoriadrake/36933cb50053469903a0c0e68ccb24e1 to your computer and use it in GitHub Desktop.
Code Review Aliases for Git
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
[alias] | |
# Adapted from https://blog.jez.io/cli-code-review/ | |
# List files which have changed since BASE | |
# Set BASE in shell configuration or before the command | |
files = !git diff --name-only $(git merge-base HEAD \"$BASE\") | |
# With stat for interactive use | |
stat = !git diff --stat $(git merge-base HEAD \"$BASE\") | |
# Put heatmap on your path: | |
# https://github.com/jez/git-heatmap/blob/master/git-heatmap | |
heatmap = git-heatmap | |
# Open all files changed since BASE in Vim tabs | |
# Then, run fugitive's :Gdiff in each tab, and finally | |
# tell vim-gitgutter to show +/- for changes since BASE | |
review = !vim -p $(git files) +\"tabdo Gdiff $BASE\" +\"let g:gitgutter_diff_base = '$BASE'\" | |
# Same as the above, except specify names of files as arguments, | |
# instead of opening all files: | |
# git reviewone foo.js bar.js | |
reviewone = !vim -p +\"tabdo Gdiff $BASE\" +\"let g:gitgutter_diff_base = '$BASE'\" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment