diff options
author | Teddy Wing | 2019-06-17 20:05:47 +0200 |
---|---|---|
committer | Teddy Wing | 2019-06-17 20:05:47 +0200 |
commit | 42215fe2bbefba19308bd879f6507123d53d1fe1 (patch) | |
tree | 8d0a6fe8d3de61fbb7b29ddaa40aa309a3ccf39b /code-review-difftool | |
parent | 87b53c3468625eab072dbd80e983eb3b364d4a10 (diff) | |
download | code-review-42215fe2bbefba19308bd879f6507123d53d1fe1.tar.bz2 |
get_merge_base(): Change default base to `master...`
Add the range filter to try to remove commits that we don't care about.
Still not sure if this will work in all cases, as sometimes `..` seemed
to give me the right collection of files and sometimes `...` did.
code-review-difftool:
Pass the merge base without range dots (`..` or `...`) to Vim Fugitive,
as it doesn't accept revisions with ranges. Not sure what to do if I get
a range with two revision names yet, though.
Turns on Bash's `extglob` in order to use `?(...)` to include both
patterns in the expansion.
Diffstat (limited to 'code-review-difftool')
-rwxr-xr-x | code-review-difftool | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/code-review-difftool b/code-review-difftool index b6c6b8e..7976d92 100755 --- a/code-review-difftool +++ b/code-review-difftool @@ -21,6 +21,16 @@ SCRIPT="$(dirname "$0")" source "$SCRIPT/code-review-database" +# shopt -s extglob +# echo "${y%%?(..|...)}" +# shopt -u extglob + + review_base="$(get_merge_base)" -vim -c "tabdo Gdiff $review_base" -p $(code-review changed-files) +# Remove dot ranges at the end of a revision as Fugitive doesn't support them. +shopt -s extglob +review_base_without_dots="${review_base%%?(..|...)}" +shopt -u extglob + +vim -c "tabdo Gdiff $review_base_without_dots" -p $(code-review changed-files) |