This is an automated email from the ASF dual-hosted git repository.
dcapwell pushed a commit to branch cep-15-accord
in repository https://gitbox.apache.org/repos/asf/cassandra.git
The following commit(s) were added to refs/heads/cep-15-accord by this push:
new 5f6b1d7934 Switched away from https endpoints for git submodules in
favor of relative paths during development
5f6b1d7934 is described below
commit 5f6b1d7934845a47b31effcc8029cfa01fa8ed12
Author: David Capwell <[email protected]>
AuthorDate: Wed Feb 22 09:32:03 2023 -0800
Switched away from https endpoints for git submodules in favor of relative
paths during development
patch by David Capwell; reviewed by Caleb Rackliffe, Michael Semb Wever for
CASSANDRA-18204
---
.build/sh/change-submodule.sh | 5 +++++
.build/sh/development-switch.sh | 40 ++--------------------------------------
CONTRIBUTING.md | 2 --
3 files changed, 7 insertions(+), 40 deletions(-)
diff --git a/.build/sh/change-submodule.sh b/.build/sh/change-submodule.sh
index d8b1d8d5d9..6ab2d3795a 100755
--- a/.build/sh/change-submodule.sh
+++ b/.build/sh/change-submodule.sh
@@ -23,6 +23,11 @@ set -o nounset
_usage() {
cat <<EOF
Usage: $(basename $0) [submodule path] [git repo URL] [git branch]
+
+Examples:
+
+Switch to branch "immutable-state"
+ .build/sh/change-submodule.sh modules/accord ../cassandra-accord.git
immutable-state
EOF
exit 1
}
diff --git a/.build/sh/development-switch.sh b/.build/sh/development-switch.sh
index 9e66a95cd4..e377d5b9aa 100755
--- a/.build/sh/development-switch.sh
+++ b/.build/sh/development-switch.sh
@@ -30,7 +30,6 @@ _usage() {
Usage: $(basename $0) (options)* (submodule)*
Options:
- --github-user Github user/org where the fork exists; defaults to $USER
--jira JIRA used for development, will checkout if not done yet
-h|--help This help page
EOF
@@ -41,45 +40,15 @@ _is_main_branch() {
local -r name="$1"
[[ "$name" == cassandra-* ]] && return 0
[[ "$name" == "trunk" ]] && return 0
+ [[ "$name" == "cep-15-accord" ]] && return 0
return 1
}
-_get_gh_user() {
- # was the GitHub user set?
- local gh_user
- gh_user="$(git config --get 'cassandra.github.user' || true)"
- if [[ ! -z "${gh_user:-}" ]]; then
- echo "${gh_user}"
- return 0
- fi
-
- # can it be inferred from remote?
- local current_branch
- current_branch="$(git rev-parse --abbrev-ref HEAD)"
- local url
- url="$(git config --local --get branch."${current_branch}".url || true)"
- local inferred_name="$USER"
- if [[ ! -z "${url:-}" ]]; then
- inferred_name="$(echo "$url" | awk -F/ '{print $(NF-1)}' | awk -F: '{print
$NF}')"
- fi
- echo "What is the github user/org used? Inferred ${inferred_name}, enter
new name or empty to accept:" 1>&2
- read user_input
- if [[ ! -z "${user_input:-}" ]]; then
- gh_user="${user_input}"
- else
- gh_user="${inferred_name}"
- fi
- git config --local 'cassandra.github.user' "$gh_user"
- echo "${gh_user}"
-}
-
_main() {
local home
home="$(git rev-parse --show-toplevel)"
cd "$home"
- local gh_user
- gh_user="$(_get_gh_user)"
local branch
branch="$(git rev-parse --abbrev-ref HEAD)"
# loop over args, executing as in order of execution
@@ -88,10 +57,6 @@ _main() {
-h|--help)
_usage
;;
- --github-user)
- gh_user="$2"
- shift 2
- ;;
--jira)
if [[ "$2" != "$branch" ]]; then
git checkout -b "$2"
@@ -138,8 +103,7 @@ _main() {
local name
for path in "${to_change[@]}"; do
name="$(basename "$path")"
- # why use https rather than git@? This is to make sure CI works, as CI
will fail to clone with git@
- git submodule set-url "${path}"
"https://github.com/${gh_user}/cassandra-${name}.git"
+ git submodule set-url "${path}" "../cassandra-${name}.git"
git submodule set-branch --branch "${branch}" "${path}"
cd "$path"
submodule_branch="$(git rev-parse --abbrev-ref HEAD)"
diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md
index 8021b4eda0..044615a571 100644
--- a/CONTRIBUTING.md
+++ b/CONTRIBUTING.md
@@ -46,8 +46,6 @@ $ (cd modules/accord ; git commit -am 'Saving progress')
$ .build/sh/bump-accord.sh
```
-During this step you may be asked for github credentials, github removed
password auth for `https` endpoints in 2021 so you will need to generate a auth
token to support pushing, this can be done by going to
https://github.com/settings/tokens/new and creating a token with the "repo"
scope.
-
## Commit and Merge Process
Due to the nature of submodules, the changes to the submodules must be
committed and pushed before the changes to Apache Cassandra; these are
different repositories so git's `--atomic` does not prevent conflicts from
concurrent merges; the basic process is as follows:
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]