diff --git a/.github/workflows/sanity_check.yml b/.github/workflows/sanity_check.yml index 300a1e91d..821cf73ca 100644 --- a/.github/workflows/sanity_check.yml +++ b/.github/workflows/sanity_check.yml @@ -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 diff --git a/Makefile b/Makefile index aa9b97f29..35a8a85f8 100644 --- a/Makefile +++ b/Makefile @@ -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 diff --git a/build_tools/format-diff.sh b/build_tools/format-diff.sh index 1ed112c2d..00b280f73 100755 --- a/build_tools/format-diff.sh +++ b/build_tools/format-diff.sh @@ -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