aboutsummaryrefslogtreecommitdiffstats
path: root/code-review-difftool
diff options
context:
space:
mode:
authorTeddy Wing2019-06-10 02:21:02 +0200
committerTeddy Wing2019-06-10 02:21:02 +0200
commit8398cee3460e1f6343d41323e851e99d8a0ed315 (patch)
tree6fdf0779d0f10c348732c8e35bbe295b6eee0e79 /code-review-difftool
parent21534162124501f0410ee31cd31130aa3b92a9f3 (diff)
downloadcode-review-8398cee3460e1f6343d41323e851e99d8a0ed315.tar.bz2
Use `get_merge_base` across scripts
Replace `$ARGS` system from before with the merge base value taken from the database. This makes the merge base consistent across `code-review` tools/subcommands.
Diffstat (limited to 'code-review-difftool')
-rwxr-xr-xcode-review-difftool10
1 files changed, 5 insertions, 5 deletions
diff --git a/code-review-difftool b/code-review-difftool
index 54376c4..1d3dcb8 100755
--- a/code-review-difftool
+++ b/code-review-difftool
@@ -1,12 +1,12 @@
#!/usr/bin/env bash
-REVIEW_BASE=master..
+SCRIPT="$(dirname "$0")"
+source "$SCRIPT/code-review-database"
-if [ $# -gt 1 ]; then
- REVIEW_BASE="$1"
-fi
+
+review_base="$(get_merge_base)"
# TODO: Use `code-review-changed-files` instead of `git diff --name-only`
# TODO: Can't replace single dots as those could be part of a branch name
# vim -c 'tabdo Gdiff ${REVIEW_BASE/./}' -p $(git diff --name-only "$REVIEW_BASE")
-vim -c 'tabdo Gdiff origin/master' -p $(git diff --name-only origin/master)
+vim -c "tabdo Gdiff $review_base" -p $(git diff --name-only $review_base)