-
Notifications
You must be signed in to change notification settings - Fork 74
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Simplified scripts for copying to jb-main #1407
Changes from 3 commits
400ae53
34e8fe9
ab5c88b
9744df1
2c25c29
afb92d9
4faab27
4757e32
c3fc8d6
8d3ef1b
19a2add
f125688
c448c2a
8b5cd03
b765c7a
4608f74
16b584f
78674a0
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
The purposes of these scripts is to merge some subfolder to jb-main branch from other branch (usually it is "integration" or "integration-release/something"). | ||
|
||
The HEAD should be on the commit which you want to merge. | ||
|
||
It creates 2 branches: | ||
- integration-snap/$hash/to-jb-main - should be merged to jb-main. It is created from the merging currentCommit to merge-base(currentCommit, jb-main) | ||
- integration-snap/$hash/to-integration - should be merged to integration, to avoid conflicts in future merges of jb-main. It is createad as "empty" merge of "to-jb-main" to merge-base(currentCommit, integration) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
#!/bin/bash | ||
|
||
## !!! Be careful using this script separately from the main scripts in the parent folder | ||
## | ||
## This script set the state of a subfolder to the state in some commit, creating a merge commit. | ||
## Warning!!! Snapping subfolders breaks the base commit and future merges of the destination branch. To fix it, merge the destination branch back to the source branch, discarding all changes. | ||
|
||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Specify the snapping commit and the subfolders. For example: ./snapSubfolder.sh androidx/compose-ui/1.6.0-alpha02 compose ':(exclude)compose/material3'" | ||
exit 1 | ||
fi | ||
|
||
if [ -z "$2" ]; then | ||
echo "Specify the snapping commit and the subfolders. For example: ./snapSubfolder.sh androidx/compose-ui/1.6.0-alpha02 compose ':(exclude)compose/material3'" | ||
exit 1 | ||
fi | ||
|
||
COMMIT=$1 | ||
FIRST_FOLDER=$2 | ||
ALL_FOLDERS=${@:2} | ||
|
||
ROOT_DIR="$(dirname "$0")/../../.." | ||
|
||
( | ||
cd $ROOT_DIR; | ||
git checkout --no-overlay $COMMIT -- $ALL_FOLDERS; | ||
NEW_COMMIT=$(git commit-tree -p HEAD -p $COMMIT -m"Snap $COMMIT, subfolder $FIRST_FOLDER" $(git write-tree)); | ||
git reset --hard $NEW_COMMIT; | ||
) |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
if [ -z "$1" ]; then | ||
echo "Specify the snapping subfolder. For example: ./snapToJbMain.sh androidx/compose-ui/1.6.0-alpha02 compose ':(exclude)compose/material3'" | ||
exit 1 | ||
fi | ||
|
||
DIR=$(dirname "$0") | ||
ALL_FOLDERS=${@:1} | ||
CURRENT_COMMIT=$(git rev-parse --short @) | ||
BRANCH_TO_RESTORE_IN_THE_END=$(git branch --show-current) | ||
|
||
|
||
TO_JB_MAIN_BRANCH=integration-snap/$CURRENT_COMMIT/to-jb-main | ||
git checkout --quiet $(git merge-base $CURRENT_COMMIT origin/jb-main) -B $TO_JB_MAIN_BRANCH | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Doesn't work for my case: remote can have not "origin" name There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. removed. local branches should be up-to-date to this point anyway. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Actually, I am wrong, all work can be done in "integration" without updating "jb-main". Fixed reading the associated remote. |
||
$DIR/snapSubfolder.sh $CURRENT_COMMIT $ALL_FOLDERS | ||
echo "Created $TO_JB_MAIN_BRANCH" | ||
|
||
TO_INTEGRATION_BRANCH=integration-snap/$CURRENT_COMMIT/to-integration | ||
git checkout --quiet $(git merge-base $CURRENT_COMMIT origin/integration) -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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/annotation' | ||
igordmn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/collection' | ||
igordmn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose' ':(exclude)compose/material3' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/material3' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/lifecycle' | ||
igordmn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/material3' |
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/navigation' | ||
igordmn marked this conversation as resolved.
Show resolved
Hide resolved
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
$(dirname "$0")/impl/snapToJbMain.sh 'compose/savedstate' | ||
igordmn marked this conversation as resolved.
Show resolved
Hide resolved
|
This file was deleted.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description for args is not clear. What is branch? Out? In? Is it possible to specify hash? What is folder? What should be current git branch?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This shouldn't be used explicitly. Added a comment to look the parent scripts/readme