You are viewing a plain text version of this content. The canonical link for it is here.
Posted to pr@cassandra.apache.org by "michaelsembwever (via GitHub)" <gi...@apache.org> on 2023/02/03 01:02:19 UTC

[GitHub] [cassandra] michaelsembwever commented on a diff in pull request #2114: CASSANDRA-18204: CEP-15: (C*) Add git submodule for Accord

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


##########
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:
   this is failing for me, on my initial switch to the branch i'm getting.
   ```
   ❯ git sw accord-submodules
   Updating files: 100% (3001/3001), done.
   Switched to branch 'accord-submodules'
   Your branch is up to date with 'dcapwell/accord-submodules'.
   Cloning into '/Users/mick/src/apache/cassandra/accord'...
   fatal: transport 'file' not allowed
   fatal: Fetched in submodule path 'accord', but it did not contain fa73c60fd132b817fe594e8e42bdd1329628b626. Direct fetching of that commit failed.
   ```
   
   if i first do
   ```
   ❯ git config --global protocol.file.allow always
   ```
   then the first fatal message is removed, but it still does not work… 



-- 
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: pr-unsubscribe@cassandra.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: pr-unsubscribe@cassandra.apache.org
For additional commands, e-mail: pr-help@cassandra.apache.org