forked from androidx/androidx
-
Notifications
You must be signed in to change notification settings - Fork 74
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Simplified scripts for copying to jb-main (#1407)
Now we need only to switch to the commit, and call a needed script. It creates 2 branches, which can be tested on CI, and merged with simple git merge. Branches: <img width="563" alt="image" src="https://github.com/user-attachments/assets/42fdc40c-7729-42d3-9e28-a216ed0106f1"> --------- Co-authored-by: Ivan Matkov <[email protected]>
- Loading branch information
1 parent
938597a
commit 411b73e
Showing
14 changed files
with
63 additions
and
29 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
The purposes of these scripts is to copy some subfolder to jb-main branch from "integration" or "integration-release/*". | ||
|
||
1. Checkout the commit you want to copy ("integration" or "integration-release/*") | ||
|
||
2. Merge jb-main to integration, pick "jb-main" state in a case of conflicts in other folders | ||
|
||
3. Call `./copyCompose.sh` (use another script for another folder) | ||
|
||
It creates 2 branches: | ||
- integration-copy/$hash/to-jb-main - should be merged to "jb-main". It is based on merge-base(currentCommit, jb-main) and has the copy of the subfolder from currentCommit | ||
- integration-copy/$hash/to-integration - should be merged to "integration", to avoid conflicts in future merges of jb-main. It is created as "empty" merge of "to-jb-main" to merge-base(currentCommit, integration) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'annotation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'collection' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'compose' ':(exclude)compose/material3' ':(exclude)compose/compiler' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'compose/material3' ':(exclude)compose/material3/adaptive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'compose/material3/adaptive' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'lifecycle' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'compose/material3' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'navigation' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'savedstate' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/copyToJbMain.sh 'window' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
#!/bin/bash | ||
|
||
# This script is rarely needed to be used explicitly. | ||
# Use parent scripts and see the parent Readme.md | ||
|
||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Specify folders to copy to jb-main. For example: ./copyToJbMain.sh compose ':(exclude)compose/material3'" | ||
exit 1 | ||
fi | ||
|
||
DIR=$(dirname "$0") | ||
ROOT_DIR="$(dirname "$0")/../../.." | ||
ALL_FOLDERS=${@:1} | ||
FIRST_FOLDER=$1 | ||
FIRST_FOLDER=${FIRST_FOLDER////-} # replace / by - | ||
CURRENT_COMMIT=$(git rev-parse --short @) | ||
BRANCH_TO_RESTORE_IN_THE_END=$(git branch --show-current) | ||
|
||
|
||
JB_MAIN_BRANCH=$(git config branch.jb-main.remote)/jb-main | ||
TO_JB_MAIN_BRANCH=integration-copy/$FIRST_FOLDER/$CURRENT_COMMIT/to-jb-main | ||
git checkout --quiet $(git merge-base $CURRENT_COMMIT $JB_MAIN_BRANCH) -B $TO_JB_MAIN_BRANCH | ||
( | ||
cd $ROOT_DIR; | ||
git checkout --quiet --no-overlay $CURRENT_COMMIT -- $ALL_FOLDERS; | ||
git commit --quiet -m "Copy $FIRST_FOLDER from $CURRENT_COMMIT" | ||
) | ||
echo "Created $TO_JB_MAIN_BRANCH" | ||
|
||
INTEGRATION_BRANCH=$(git config branch.integration.remote)/integration | ||
TO_INTEGRATION_BRANCH=integration-copy/$FIRST_FOLDER/$CURRENT_COMMIT/to-integration | ||
git checkout --quiet $(git merge-base $CURRENT_COMMIT $INTEGRATION_BRANCH) -B $TO_INTEGRATION_BRANCH | ||
$DIR/mergeEmpty.sh $TO_JB_MAIN_BRANCH | ||
echo "Created $TO_INTEGRATION_BRANCH" | ||
|
||
|
||
git checkout --quiet $BRANCH_TO_RESTORE_IN_THE_END |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.