This commit is contained in:
Yanqin Jin 2020-04-29 20:21:18 -07:00
parent cf23a7cd16
commit 64b3bbf1c9
3 changed files with 2 additions and 21 deletions

View File

@ -13,7 +13,6 @@ jobs:
- name: Fetch from upstream
run: |
git remote add upstream https://github.com/facebook/rocksdb.git && git fetch upstream
git fetch origin
- name: Setup tmate session
uses: mxschmitt/action-tmate@v2
@ -23,7 +22,6 @@ jobs:
echo git status && git status
echo "git remote -v" && git remote -v
echo git branch && git branch
GIT_CURL_VERBOSE=1 GIT_TRACE=1 git merge-base origin/master HEAD
- name: Setup Python
uses: actions/setup-python@v1
@ -39,13 +37,6 @@ jobs:
with:
args: https://raw.githubusercontent.com/llvm-mirror/clang/master/tools/clang-format/clang-format-diff.py
- name: Found merge base
run: git merge-base upstream/master HEAD
- name: Check format 1
run: |
build_tools/format-diff.sh -c
- name: Check format
run: make check-format

View File

@ -1202,6 +1202,8 @@ check-buck-targets: buck-targets
@if [ -z "$(TMP)" ]; then \
exit 0; \
else \
echo "Please run 'make buck-targets' to update TARGETS file."; \
echo "Do not manually update TARGETS file."; \
exit 1; \
fi

View File

@ -102,26 +102,14 @@ if [ -z "$uncommitted_code" ]
then
# Attempt to get name of facebook/rocksdb.git remote.
[ "$FORMAT_REMOTE" ] || FORMAT_REMOTE="$(git remote -v | grep 'facebook/rocksdb.git' | head -n 1 | cut -f 1)"
echo FORMAT_REMOTE is $FORMAT_REMOTE
# Fall back on 'origin' if that fails
[ "$FORMAT_REMOTE" ] || FORMAT_REMOTE=origin
echo FORMAT_REMOTE is $FORMAT_REMOTE
# Use master branch from that remote
[ "$FORMAT_UPSTREAM" ] || FORMAT_UPSTREAM="$FORMAT_REMOTE/master"
echo FORMAT_UPSTREAM is $FORMAT_UPSTREAM
echo CLANG_FORMAT_DIFF is $CLANG_FORMAT_DIFF
if [ -f ./clang-format-diff.py ]
then
echo found file
else
echo not found
fi
# Get the common ancestor with that remote branch. Everything after that
# common ancestor would be considered the contents of a pull request, so
# should be relevant for formatting fixes.
git merge-base "$FORMAT_UPSTREAM" HEAD
FORMAT_UPSTREAM_MERGE_BASE="$(git merge-base "$FORMAT_UPSTREAM" HEAD)"
echo FORMAT_UPSTREAM_MERGE_BASE is $FORMAT_UPSTREAM_MERGE_BASE
# Get the differences
diffs=$(git diff -U0 "$FORMAT_UPSTREAM_MERGE_BASE" | $CLANG_FORMAT_DIFF -p 1)
else