Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Changing style: a guide to branch conflicts #1157

Open
Iximiel opened this issue Nov 18, 2024 · 0 comments
Open

Changing style: a guide to branch conflicts #1157

Iximiel opened this issue Nov 18, 2024 · 0 comments

Comments

@Iximiel
Copy link
Member

Iximiel commented Nov 18, 2024

#1114 #1118 and #1180 will probably cause some headache after being merged, so this is a guide to avoid future merge conflicts

Caution

Do NOT do all the v2.9 steps, then v2.10 steps, then the master steps, since v2.10 has already the done the v2.9 steps for you, and same thing for master and v2.10.
Only do the procedure with the hashes relevant to your target base branch!!!

BEFORE DOING ANYTHING DO A BACKUP OF YOUR BRANCH WITH git branch nameofyourbranch-bk and KEEP it

If you mess something up you can then git reset --hard nameofyourbranch-bk while checked out in nameofyourbranch to reset to the previous version

Note

If your branch has a linear history:
The ideal way to proceed would be to rebase your work-in-progres branch to the one that you are targeting and then proceed to "make astyle" your way for all the commits.

I assume you have the remote origin pointed at your own repository and upstream to the public plumed2 repository.

Let's go

v2.9

Important

Have you done a backup of your branch?

If you are working in a branch from v2.9, use the following hashes

this is the before-v2.9-astyle commit: 53d5819fb75447905afcac66ae76ee2c14b6a514
this is the v2.9-astyle commit: 2cd41d16623b7a062b2a716eaf5c91a741cc19ea

start with git fetch upstream/v2.9

  1. I would recommend rebasing git rebase 53d5819fb75447905afcac66ae76ee2c14b6a514, but merging is ok: git merge 53d5819fb75447905afcac66ae76ee2c14b6a514 this will likely be the most headachy thing in the procedure, for v2.9 you only get the updated src/astyle.sh
  2. git merge -s ours 2cd41d16623b7a062b2a716eaf5c91a741cc19ea this will tell git that the branch has been merged with no problem for future merges (the -s ours)
  3. git checkout 2cd41d16623b7a062b2a716eaf5c91a741cc19ea .astyle.options to retrieve the new options since I forgot to add them in 53d5819 this step is skipped for v2.10 and above
  4. Now you should be good to go and you can merge the v2.9 branch hopefully with less problem
  5. make astyle and then commit
  6. git commit -am astyled
    1. optional git checkout upstream/v2.9 .git-blame-ignore-revs
    2. optional add the hash of the last comment to .git-blame-ignore-revs that you will get when you merge the full v2.9/checkout it
    3. optional commit the modification to .git-blame-ignore-revs
  7. ready to go, you can merge upstream/v2.9 or prepare the PR to be merged into it

v2.10

Important

Have you done a backup of your branch?

v2.10 and master are more linear

If you are working in a branch from v2.10, use the following hashes

this is the before-v2.10-astyle commit: df889170c00ea0ce6b69c2c6f690e6643b027a3e
this is the v2.10-astyle commit: df781b48652d8cdde2994dae1197cdb623f3f3fa

start with git fetch upstream/v2.10

  1. I would recommend rebasing git rebase df889170c00ea0ce6b69c2c6f690e6643b027a3e, but merging is ok: git merge df889170c00ea0ce6b69c2c6f690e6643b027a3e this will likely be the most headachy thing in the procedure but it should get you the updated .astyle.options and the updated src/astyle.sh script.
  2. git merge -s ours df781b48652d8cdde2994dae1197cdb623f3f3fa this will tell git that the branch has been merged with no problem for future merges, but will likely not update the .astyle.options
  3. make astyle
  4. git commit -am "meaningful message"
    1. optional git checkout upstream/v2.10 .git-blame-ignore-revs
    2. optional add the hash of the last comment to .git-blame-ignore-revs that you will get when you merge the full v2.10/checkout it
    3. optional commit the modification to .git-blame-ignore-revs
  5. ready to go, now you can merge upstream/v2.10 or prepare the PR to be merged into it

master

Important

Have you done a backup of your branch?

If you are working in a branch from master/v2.11, use the following hashes

this is the before-master-astyle commit: 2c1e52d91478333c08bf21d3d9d9016354e4d635
this is the master-astyle commit: 380bb46eea1bc2a38fba94f3f72af2d8d6e41669

start with git fetch upstream/master

  1. I would recommend rebasing git rebase 2c1e52d91478333c08bf21d3d9d9016354e4d635, but merging is ok: git merge 2c1e52d91478333c08bf21d3d9d9016354e4d635 this will likely be the most headachy thing in the procedure but it should get you the updated .astyle.options and the updated src/astyle.sh script
  2. git merge -s ours 380bb46eea1bc2a38fba94f3f72af2d8d6e41669 this will tell git that the branch has been merged with no problem for future merges, but will likely not update the .astyle.options
  3. make astyle
  4. git commit -am "meaningful message"
    1. optional git checkout upstream/master .git-blame-ignore-revs
    2. optional add the hash of the last comment to .git-blame-ignore-revs that you will get when you merge the full merhe/checkout it
    3. optional commit the modification to .git-blame-ignore-revs
  5. ready to go, now you can merge upstream/master or prepare the PR to be merged into it
@Iximiel Iximiel changed the title [WIP]Changing style a guide to branch conflicts [WIP]Changing style: a guide to branch conflicts Jan 16, 2025
@Iximiel Iximiel changed the title [WIP]Changing style: a guide to branch conflicts Changing style: a guide to branch conflicts Jan 17, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant