[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-18399:
---

I am not telling to close this. All I am saying is that I am most probably not 
going to use it and all I am asking is to do it in such a way that how I am 
doing it will not be changed. That seems to be the case.

If there is a general consensus / majority which wants it well ... sure. 

I think it would be appropriate to send this to ML to gather some opinions to 
see if there is enough people who are going to use to so it makes sense to add 
it. I want to avoid situation when two / three people are going to use that but 
virtually nobody else. Right now the primary users of this seem to be yourself, 
David and Josh? Who else? Is that enough to merge it? 

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

By the time you want to push changes, they should be already rebased so no 
merge conflicts should surprise you. 

I'm not going to force it, obviously everything can be done manually. I found 
it annoying to do that by hand when merging multi-version PRs as I needed to 
repeat my work with slight differences for base version, non-trunk and trunk. 
Commit template can be pasted or provided by git; reviewer names can be copy 
pasted from Jira manually - that is also true - the script aims to make it 
faster and less error-prone. 

Will close this ticket and submit it to my own repo.

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-18399:
---

Good to know. Anyway, is it really that tiresome for people to update 
changes.txt by hand and enumerate authors in the commit message? I would never 
think it is such a hassle we need to have scripts for that ... from my 
perspective the biggest chunk of work is merging up if some conflict happens 
and I found my way to deal with that.

> 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
> # 
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

One thing - it does not execute anything - it generates commands and put them 
into a script which you can edit, copy / paste, whatever.

On the other hand, apart from many people having their own scripts, the final 
result should be more or less the same - a single commit in the branch for the 
oldest version and then proper forward merges + appropriate updates in 
CHANGES.txt + a commit message matching the template.

Even if you don't want to do run the script this prepares, one can use the 
tools provided here which does:
- commit message generation - you can edit it, but it fills  the reviewers for 
example
- update CHANGES.txt
- verify branches history - say branch for version N must include all commits 
from version N-1 + merge commit from N-1 to N


> 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 
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Stefan Miklosovic (Jira)


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

Stefan Miklosovic commented on CASSANDRA-18399:
---

For the record I am not running any merging scripts either. I have my customly 
tailored way how I merge up and if this is merged my workflow would not change 
because of that. While I understand that somebody may have a different view on 
this, however until everybody agrees this is necessary and we are going to use 
it I am reluctant to merge that and impose my workflow on others (even done in 
a good faith and if the solution is opt-in). Everybody's workflow is different 
and I am cool with having my scripts locally / .gitignored ... 

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Berenguer Blasi (Jira)


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

Berenguer Blasi commented on CASSANDRA-18399:
-

Uuuugh scary. Yeah I saw this ticket but I'm unfortunately on the other side of 
the fence. I do _not_ want to use a script, I want to run it manually, I want 
to type the commands, I want to see the output, OCD about matching SHAs... I 
want to do it manually :shrug:

> 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
> # 
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

[~Bereng] maybe you would like to give it a try when merging the next ticket - 
note that it does not push anything, so you can safely run it.


> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-09-25 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

Now the script also does the following:
- fetches the assignee name from the Jira ticket
- fetches the reviewers list from the Jira ticket
- generates a commit message with the commonly used pattern:

{noformat}
first commit title

first commit body

other commit titles and bodies

Patch by ; reviewed by  
for CASSANDRA-XYZ
{noformat}

it opens the editor allowing the user to edit the message and use the message 
title for updating CHANGES.txt if requested.


> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-05-05 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

Ok, so since it does not change anything and does not force anyone to use it, 
can we merge it into cassandra-builds [~mck]?

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-05-04 Thread David Capwell (Jira)


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

David Capwell commented on CASSANDRA-18399:
---

Thanks [~jmckenzie] for the ping... I just saw this (improved my filters to 
better see @s)...

Cool to see this work, and would be great for me to get rid of my own commit 
scripts... [~yifanc]/[~jonmeredith]/[~maedhroz] as I know you all use my 
script...

I sadly don't have time to review and help with this work, but this is what I 
have myself, so merging with this work over time is desirable for me

{code}
[dcapwell ~/src/github/apache/cassandra-commit-scripts] (master) $ ls -1
README.md
ci-test
ci-test-loop
circleci-approval.awk
circleci-enable.py
circleci-fix-parallelism.awk
circleci-verify.py
cleanup-remotes-and-branches.sh
commit-message.sh
dtest-jars.sh
env.sh.template
functions.sh
generate-empty-commit.sh
git-apply-branch
git-apply-commit
git-apply-pr
higher
jira-assignee.sh
jira-authors.sh
jira-issue.sh
jira-reviewers.sh
jira-summary.sh
merge-commit.sh
multibranch-commit.sh
notes
oss-author-lookup.py
oss-diff.sh
oss-pr-ci.sh
template-start-commit-of-mine.sh
template-start-commit.sh
trigger-jenkins-build
update-jvm-upgrade-test-branches.awk
use-python-dtest-repo.sh
{code}

The main thing I have people would care about are

{code}
multibranch-commit.sh -- commit script that knows how to merge cross multiple 
branches and repos, it enforces best practices (as defined by me)
circleci-enable.py -- script to manipulate circle ci to make it faster and run 
what we care about (by default enables all tests and makes sure _repeat is 
enabled... but you can filter for only the domain you care for)
{code}

Glad to see this work and looking forward to it evolving over time!

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-11 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

I think, I have finished.

There is one main entry script {{prepare_merge_commands.py}}. Just run in the 
cassandra repo dir (making sure the worktree is clean, the script will fail 
otherwise):
{noformat}
python3 ~/path-to-cassandra-builds/dev/scripts/prepare_merge_commands.py 
../merge.script
{noformat}

The only argument is the script file to generate (use ../ so that the script is 
not generated in the repo directory as it would make it dirty, appropriate 
checks are included).

The script will guide you through all the steps, for example:

{noformat}
jlewandowski@deauville:~/dev/apache/cassandra$ python3 
~/dev/cassandra-builds/CASSANDRA-18399/dev/scripts/prepare_merge_commands.py
Remote repositories:

JeetKunDoug
apache
jacek-lewandowski
jtgrabowski
origin

Enter the name of the remote repository that points to the upstream Apache 
Cassandra [default: origin]: 
g...@github.com:apache/cassandra.git
Enter the name of the remote repository that points to the upstream feature 
branch [default: origin]: jacek-lewandowski
g...@github.com:jacek-lewandowski/cassandra.git
Enter the ticket number: 9

Fetching from origin
Fetching from jacek-lewandowski
Found the following release branches:
1.0: cassandra-1.0
1.1: cassandra-1.1
1.2: cassandra-1.2
2.0: cassandra-2.0
2.1: cassandra-2.1
2.2: cassandra-2.2
3.0: cassandra-3.0
3.11: cassandra-3.11
4.0: cassandra-4.0
4.1: cassandra-4.1
trunk: trunk

.*refs/heads/(CASSANDRA\-9((\d+)\.(\d+))?.*)$
Found the following feature branches:
4.0: CASSANDRA-9-4.0
4.1: CASSANDRA-9-4.1
trunk: CASSANDRA-9

Enter the oldest release version to merge into [default: 4.0]: 
Enter the name of the feature branch to merge into cassandra-4.0 or type 'none' 
if there is no feature branch for this release [default: CASSANDRA-9-4.0]: 
Enter the name of the feature branch to merge into cassandra-4.1 or type 'none' 
if there is no feature branch for this release [default: CASSANDRA-9-4.1]: 
Enter the name of the feature branch to merge into trunk or type 'none' if 
there is no feature branch for this release [default: CASSANDRA-9]: 

Commits:
1: Commit(sha='bde2c79b82', author='Jacek Lewandowski', title='Updated 
README.asc in a stupid way')
2: Commit(sha='045c27f4e8', author='Jacek Lewandowski', title='DO NOT MERGE')

Enter the number of the commit whose message should be used as a title in 
CHANGES.txt or leave empty to enter a custom title: 1
Enter the filename to save the script to [default: merge_CASSANDRA-9.sh]: 
{noformat}

As you can see, when the branches are named properly, it will autosuggest the 
right names, but you are still free to choose any branches.

It generates a script like the following one:

{noformat}
#!/bin/bash

set -xe

[[ -z $(git status --porcelain) ]] # worktree must be clean



# Commands for merging CASSANDRA-9-4.0 -> cassandra-4.0

git switch cassandra-4.0
git reset --hard origin/cassandra-4.0
git cherry-pick bde2c79b82 # Jacek Lewandowski - Updated README.asc in a stupid 
way
git cherry-pick -n 045c27f4e8 # Jacek Lewandowski - DO NOT MERGE
python3 
/home/jlewandowski/dev/cassandra-builds/CASSANDRA-18399/dev/scripts/update_changes.py
 'CASSANDRA-9' '4.0' '' 'Updated README.asc in a stupid way'
git add CHANGES.txt
git commit --amend --no-edit
[[ -n "$(git diff origin/cassandra-4.0..HEAD -- .circleci/)" ]] && (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



# Commands for merging CASSANDRA-9-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 339f66a75e # Jacek Lewandowski - Updated README.asc in a 
stupid way
git cherry-pick -n eb400940b6 # Jacek Lewandowski - DO NOT MERGE
python3 
/home/jlewandowski/dev/cassandra-builds/CASSANDRA-18399/dev/scripts/update_changes.py
 'CASSANDRA-9' '4.1' '4.0' 'Updated README.asc in a stupid way'
git add CHANGES.txt
git commit --amend --no-edit
[[ -n "$(git diff origin/cassandra-4.1..HEAD -- .circleci/)" ]] && (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



# Commands for merging CASSANDRA-9 -> trunk

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-09 Thread Michael Semb Wever (Jira)


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

Michael Semb Wever commented on CASSANDRA-18399:


bq. The last case is interesting because the information about the patch being 
applied to trunk will be lost, right?

Yes, but it's not of relevance in trunk (or 4.1).  And the release branches are 
forever.

> 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
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-08 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

The last case is interesting because the information about the patch being 
applied to trunk will be lost, right?

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-08 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

Thank you Mick

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-08 Thread Michael Semb Wever (Jira)


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

Michael Semb Wever commented on CASSANDRA-18399:



(I'll refer to branch names in full.)

First up, CHANGES.txt in trunk from the 4.1 section and down should be 
identical to cassandra-4.1 CHANGES.txt

For (4), cassandra-4.1 and trunk have no edit.

For (5), cassandra-4.0 has no edit. cassandra-4.1 and trunk has the edit under 
4.1's Merged from 3.11. (It does not matter that the change is not in trunk, 
the 4.1 section must remain identical between cassandra-4.1 and trunk.)

For (6), cassandra-4.1 and trunk has no edit.

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-08 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

Thanks, for checking, I expected there will be problems, that's why decided to 
rewrite in Python to avoid discrepancies.

Anyway, for editing {{CHANGES.txt}} I'd like to find an algorithm which rules 
how to do that correctly (I've noticed I don't know exactly):

say, trunk represents 5.0 (current situation)

1. If the change is only for *trunk*, then we add the entry in the *5.0* 
section (top section).

2. If the change is for *4.1* and *trunk*, then:
   - in *4.1*, we add the entry in the *4.1* section (top section)
   - in *trunk*, we add the entry in the *4.1* section (first encountered *4.1* 
section)

3. If the change is for *4.0*, *4.1* and *trunk*, then:
   - in *4.0*, we add the entry in the *4.0* section (top section)
   - in *4.1*, we add then entry in the *4.1* section (top section), under 
*Merged from 4.0* subsection
   - in *trunk*, we add the entry in the *4.1* section (first encountered *4.1* 
section), under *Merged from 4.0* subsection

4. If the change is for *4.0* and not for *4.1* or *trunk*, then:
   - in *4.0*, we add the entry in the *4.0* section (top section)
   - in *4.1*, {color:#DE350B}*???*{color}
   - in *trunk*, {color:#DE350B}*???*{color}

5. If the change is for *3.11* and *4.1* and not for *4.0* or *trunk*, then:
   - in *3.11*, we add the entry in the *3.11* section (top section)
   - in *4.0*, {color:#DE350B}*???*{color}
   - in *4.1*, {color:#DE350B}*???*{color}
   - in *trunk*, {color:#DE350B}*???*{color}

6. If the change is for *4.0* and *trunk*, and not for *4.1*, then:
   - in *4.0*, we add the entry in the *4.0* section (top section)
   - in *4.1*, {color:#DE350B}*???*{color}
   - in *trunk*, {color:#DE350B}*???*{color}

I need to clarify what to do in the highlighted cases.


> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-06 Thread Ekaterina Dimitrova (Jira)


[ 
https://issues.apache.org/jira/browse/CASSANDRA-18399?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel=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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-06 Thread Michael Semb Wever (Jira)


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

Michael Semb Wever commented on CASSANDRA-18399:


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.

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-06 Thread Michael Semb Wever (Jira)


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

Michael Semb Wever commented on CASSANDRA-18399:


bq. EDIT: I can see a property java.supported got added in 5.0, so we can use 
that, and hardcode for previous versions. We can assume JAVA__HOME env 
properties to be present so that the script can consistently switch

JAVA__HOME env properties are (getting) removed. You cannot rely on 
them anymore.

4) 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).

> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-06 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

{{JAVA__HOME}} would be a custom env anyway. Just need some consistent 
way we can switch Java version and those envs could just point to certain 
version. Alternatively, we could assume there is SDKMan installed and we can 
use it to switch Java version

> 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
> # 
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-06 Thread Jacek Lewandowski (Jira)


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

Jacek Lewandowski commented on CASSANDRA-18399:
---

Thanks for trying [~e.dimitrova]

Answering your questions:
1) because such commits may have different titles, also because sometimes 
changes to circle ci config can be part of some other commit - this approach 
simply handles all the cases. Also, this is a script generator so you can 
comment out / remove that line from the output

2) if you mean, git push --atomic -n, then it is added, and in new version it 
does the verification whether:
- the newer branch contains all the commits from the previous branch + one new 
merge commit with correct versions
- the first branch contains only one commit, which is not a merge commit
Additionally, the script generates git diff --name-only, and git show commands 
for each branch reported by git push -n

3) this is a good idea, but I'd rather do ant artifacts; though - I don't know 
where to get the supported java versions from, also, I don't know what is the 
common way to switch the java version

4) because this must be branch/version agnostic stuff

The error you reported is valid if your commit does not cherry-pick cleanly - 
was that the case?


> 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 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-05 Thread Ekaterina Dimitrova (Jira)


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

Ekaterina Dimitrova commented on CASSANDRA-18399:
-

I can run it on a Mac. 

Just a few initial thoughts while reading it here:

1) Why do you cherry-pick at all CircleCI changes which are throwaway commit?

2) I am wondering, do we want maybe to add a dry-run -n option for the script? 
Potentially with git diff or so to encourage people to verify changes pre - 
commit? (Now this will be probably an option for committers only though)

3) Probably we can add also 
{code:java}
ant realclean && ant jar build-test{code}
after applying a patch to a branch as per our [commit 
process|https://cassandra.apache.org/_/development/how_to_commit.html]?

4) Why is this in cassandra-builds? I know we try to move to in-tree as much as 
possible, though I understand that the it can drift in time between branches. 
But I wouldn't expect that to be an issue as since the 3 years and a half I am 
working on Cassandra we didn't change anything in the merge strategy even once.

 

Started running the 3.0 script and got an error:

 
{code:java}
git cherry-pick -n 99e96a4f95 && git commit -a --amend --no-edit
src/java/org/apache/cassandra/db/SystemKeyspace.java: unmerged 
(dc550dfdc7870b5f176487467e588f320d5b8c8e)
src/java/org/apache/cassandra/db/SystemKeyspace.java: unmerged 
(c0bf31779b9c30765bb06191788953ccce46b9cb)
src/java/org/apache/cassandra/db/SystemKeyspace.java: unmerged 
(eaa9ad32af1b460dec1a02c7184798b42ce0aecd)
error: your index file is unmerged.
fatal: cherry-pick failed
{code}
 

> 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
> # 
> 

[jira] [Commented] (CASSANDRA-18399) Add simple helper script for commiting a change to multiple branches

2023-04-01 Thread Josh McKenzie (Jira)


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

Josh McKenzie commented on CASSANDRA-18399:
---

ping [~dcapwell] 

> 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
>
> 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