dcapwell commented on code in PR #2114:
URL: https://github.com/apache/cassandra/pull/2114#discussion_r1096382682


##########
dev-support/git-hooks/post-checkout/100-update-submodules.sh:
##########
@@ -24,35 +25,17 @@ set -o nounset
 
 bin="$(cd "$(dirname "$0")" > /dev/null; pwd)"
 
-accord_repo='https://github.com/apache/cassandra-accord.git'
-accord_branch='1230eceb077c928123e6bf848a103964fe90c9f7'
-accord_src="$bin/cassandra-accord"
-
-checkout() {
-  cd "$accord_src"
-    git checkout "$accord_branch"
-    echo "$accord_branch" > .BRANCH
-  cd -
-}
-
 _main() {
-  # have we already cloned?
-  if [[ ! -e "$accord_src" ]] || [[ $(cat "$accord_src/.REPO" || true) != 
"$accord_repo" ]]; then
-    rm -rf "$accord_src" || true
-    git clone "$accord_repo" "$accord_src"
-    echo "$accord_repo" > "$accord_src/.REPO"
-    checkout
-  fi
-  if [[ $(cat "$accord_src"/.BRANCH || true) != "$accord_branch" ]]; then
-    checkout
-  fi
-  cd "$accord_src"
-  # are there changes?
-  git pull --rebase origin "$accord_branch"
-  if [[ $(git rev-parse HEAD) != $(cat .SHA || true) ]]; then
-    ./gradlew clean install -x test
-    git rev-parse HEAD > .SHA
+  # In case the usage happens at a different layer, make sure to cd to the 
toplevel
+  local root_dir
+  root_dir="$(git rev-parse --show-toplevel)"
+  cd "$root_dir"
+
+  if [[ ! -e .gitmodules ]]; then
+    # nothing to see here, look away!
+    return 0
   fi
+  git submodule update --init --recursive

Review Comment:
   we spoke in slack, I sadly can't repo and @michaelsembwever and I have the 
same `git` version... tested different files named `accord` and didn't work..
   
   I have 1 theory based off more testing, if C* commits an accord sha but that 
sha was never pushed up, then you can hit the last line....  to help prevent 
the cases I detected I added git hooks to make sure your SHA is pushed before 
you commit.



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to