[ 
https://issues.apache.org/jira/browse/CASSANDRA-18399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17709528#comment-17709528
 ] 

Ekaterina Dimitrova commented on CASSANDRA-18399:
-------------------------------------------------

First, I want to say that my comments should be treated just as a quick 
feedback from a user perspective while testing on Mac as per request. With that 
said, it is up to you two to decide what the final outcome will be. I am sure 
it will be great.
1) Yes, I think I was not inclusive here as I am used to people having it as 
separate commit but it might be for some people it is not always the case :) 
Stand corrected 
2) Thanks, it seems I missed the bottom line dry run
3)
{quote}Can we skip (3) please. It's a whole different kettle of fish and a cans 
of worms – we're not trying to do CI for the dev here.
{quote}
{code:java}
ant artifacts
{code}
or
{code:java}
ant realclean && ant jar build-test
{code}
?
I am not sure why not
{code:java}
ant realclean && ant jar build-test{code}
This one we always do pre-commit locally.

4)
{quote}  please keep it in cassandra-builds. The build and test scripts are 
moving in-tree because they are so contextual to each branch (even if they 
themselves are for the most part branch independent).
{quote}
I understand that but my point is that if you have it directly in the cassandra 
repo you just use it and it is easier than relying on having it somewhere else. 
And we do not really change it. Again, it is up to you two to decide. This is 
my user feedback :) 
----
Back to the execution on Mac:

 
{code:java}
grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^[0-9]+\.[0-9]+/{s/.*/&\n\ * 
Save host id to system.local and flush immediately after startup 
(CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
sed: 1: "CHANGES.txt": invalid command code C
{code}
 

On Mac it seems sed -i requires suffix for the backup. An empty suffix is 
permitted so I did try:
{code:java}
grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^[0-9]+\.[0-9]+/{s/.*/&\n\ * 
Save host id to system.local and flush immediately after startup 
(CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt{code}
Then I run into below error:
{code:java}
 sed: 1: "/^[0-9]+\.[0-9]+/{s/.*/ ...": unexpected EOF (pending }'s)
{code}
 

Maybe the regex? I can take a look tomorrow again, I didn't have the time to 
investigate this one today. 

 

> Add simple helper script for commiting a change to multiple branches
> --------------------------------------------------------------------
>
>                 Key: CASSANDRA-18399
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-18399
>             Project: Cassandra
>          Issue Type: Task
>          Components: Build
>            Reporter: Jacek Lewandowski
>            Assignee: Jacek Lewandowski
>            Priority: Low
>          Time Spent: 1h 10m
>  Remaining Estimate: 0h
>
> This is just a simple additional script which committers can use to help them 
> merge commits, especially if the change applies to multiple Cassandra 
> versions.
> For example, for CASSANDRA-18153, which applies to 3.0..trunk, it generates 
> the following commands, which then can be run manually:
> {noformat}
> git fetch origin
> git fetch jacek-lewandowski
> # jacek-lewandowski/CASSANDRA-18153-3.0 -> cassandra-3.0
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-3.0
> git reset --hard origin/cassandra-3.0
> git cherry-pick e7e9b42559 # e7e9b42559 Save host id to system.local and 
> flush immediately after startup
> git cherry-pick -n 99e96a4f95 && git commit -a --amend --no-edit # 99e96a4f95 
> fixes
> git cherry-pick -n c63e3f29f1 && git commit -a --amend --no-edit # c63e3f29f1 
> DO NOT MERGE - CircleCI config
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^[0-9]+\.[0-9]+/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-3.0..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-3.0..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153-3.11 -> cassandra-3.11
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-3.11
> git reset --hard origin/cassandra-3.11
> git merge -s ours --log --no-edit cassandra-3.0
> git cherry-pick -n 79e7b90c8f && git commit -a --amend --no-edit # 79e7b90c8f 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n bdca4c384b && git commit -a --amend --no-edit # bdca4c384b 
> fixes
> git cherry-pick -n 45078e6793 && git commit -a --amend --no-edit # 45078e6793 
> DO NOT MERGE - CircleCI config
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-3.11..HEAD -- .circleci/ | git apply -R --index) 
> && git commit -a --amend --no-edit # Remove all changes in .circleci 
> directory if you need to
> git diff --name-only origin/cassandra-3.11..HEAD # print a list of all 
> changes files
> # jacek-lewandowski/CASSANDRA-18153-4.0 -> cassandra-4.0
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-4.0
> git reset --hard origin/cassandra-4.0
> git merge -s ours --log --no-edit cassandra-3.11
> git cherry-pick -n 2227c5c7af && git commit -a --amend --no-edit # 2227c5c7af 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n a71d4e3408 && git commit -a --amend --no-edit # a71d4e3408 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n 6dc53f4e97 && git commit -a --amend --no-edit # 6dc53f4e97 
> fixes
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-4.0..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-4.0..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153-4.1 -> cassandra-4.1
> # 
> --------------------------------------------------------------------------------------------------------
> git switch cassandra-4.1
> git reset --hard origin/cassandra-4.1
> git merge -s ours --log --no-edit cassandra-4.0
> git cherry-pick -n 3584d17b36 && git commit -a --amend --no-edit # 3584d17b36 
> Save host id to system.local and flush immediately after startup
> git cherry-pick -n e7b2ca37e6 && git commit -a --amend --no-edit # e7b2ca37e6 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n 85f3049e90 && git commit -a --amend --no-edit # 85f3049e90 
> fixes
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/cassandra-4.1..HEAD -- .circleci/ | git apply -R --index) && 
> git commit -a --amend --no-edit # Remove all changes in .circleci directory 
> if you need to
> git diff --name-only origin/cassandra-4.1..HEAD # print a list of all changes 
> files
> # jacek-lewandowski/CASSANDRA-18153 -> trunk
> # 
> --------------------------------------------------------------------------------------------------------
> git switch trunk
> git reset --hard origin/trunk
> git merge -s ours --log --no-edit cassandra-4.1
> git cherry-pick -n 3b9fa1653e && git commit -a --amend --no-edit # 3b9fa1653e 
> DO NOT MERGE - CircleCI config
> git cherry-pick -n e1389f6196 && git commit -a --amend --no-edit # e1389f6196 
> Save host id to system.local and flush immediately after startup
> grep 'CASSANDRA-18153' CHANGES.txt || sed -E -i '/^Merged from 3.0/{s/.*/&\n\ 
> * Save host id to system.local and flush immediately after startup 
> (CASSANDRA-18153)/;:a;n;ba}' CHANGES.txt
> git diff CHANGES.txt
> git add CHANGES.txt
> git commit --amend --no-edit
> (git diff origin/trunk..HEAD -- .circleci/ | git apply -R --index) && git 
> commit -a --amend --no-edit # Remove all changes in .circleci directory if 
> you need to
> git diff --name-only origin/trunk..HEAD # print a list of all changes files
> git push --atomic origin cassandra-3.0 cassandra-3.11 cassandra-4.0 
> cassandra-4.1 trunk -n
> {noformat}
> The generated script takes into account the following:
> - a change can span multiple commits - all of the will be properly squashed 
> (when running a script, you can comment out the commits you don't want to 
> include)
> - when commits leave .circleci directory modified, one of the last commands 
> for each branch reverts those changes
> - the script does its best to update CHANGED.txt properly, to confirm, it 
> always displays the diff for CHANGES.txt
> Note that, the script does not push anything, it just generates the script to 
> be manually run by the committer. 
> I'll appreciate if someone can run it on Mac so we know if there are some 
> fixes needed for MacOS.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to