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

Code is disconnected from upstream #7

Open
olesenm opened this issue Feb 12, 2021 · 6 comments
Open

Code is disconnected from upstream #7

olesenm opened this issue Feb 12, 2021 · 6 comments

Comments

@olesenm
Copy link

olesenm commented Feb 12, 2021

This is a really interesting development, but in my opinion it would be greatly beneficial if you rebase your changes on top of the upstream openfoam repo. Eg branch AD-1812 etc. This would help track the differences introduced, make it easier to interact with the upstream repo. Should also make it easy enough to rebase the changes onto v2012 etc..
Tag me if you need any git help with this.
/mark

@friedenhe
Copy link
Contributor

Hi Mark, thanks for the comments. Yes, we will eventually connect to the OpenFOAM upstream repo. Stay tuned!

@friedenhe
Copy link
Contributor

@olesenm, we tried to rebase this repo to the upstream and had some problems. We followed this link but it did not allow us to rebase the repo to upstream/OpenFOAM-v1812. Do you have any suggestions on what is the best way to rebase this repo to the OpenFOAM upstream? Such that we can apply the AD changes to a newer version of OpenFOAM easier? Thanks very much in advance!

@olesenm
Copy link
Author

olesenm commented Dec 22, 2021

@friedenhe - to rebase implies that you have some common starting point for the rebase to work. In your case, all of the OpenFOAM code came in with commit e7aabfa3d6ca which means there is absolutely nothing in common with the regular OpenFOAM repo == problem now.

Probably the only reasonable way to recover at this point of your would be to spinoff a repository locally on your machine, using the OpenFOAM-v1812 tag as your starting point (checkout). Branch off with a new name (eg, feature-ad), but still keeping the original OpenFOAM code completely untouched. This is more or less your "blank slate". Use git remote to add in this repo here, with a git fetch (not git clone) to get its contents. The next bit is the tedious part, but essentially all of the commits on this repo here (except for the first two), can be considered as "delta" change on top of the original OpenFOAM code.
Usually I would use "git log --reverse" on the added repo to get the list of commits. Start cherry-picking them across to your new "blank slate" branch. With luck, they will apply cleanly, but otherwise you will need to fixup and commit.
Search for "git cherry-pick"

After this process is complete, you should have a set of files that are almost identically to what this repo currently has. This would then be a good place to perform a simple interactive rebase to squash, combine, edit the commits and make a nicer, more coherent history for your changes.

Armed with this, you will now a clean set of changes. Make a new branch from there (eg, "rebased-2112") and then rebase that onto the current OpenFOAM-v2112. When you do this, you are most certainly going too see various rebase conflicts. This is where you can see which parts of the code changed upstream that you also changed. You need to sort out which fragments make sense to keep and/or update your changes to align with upstream changes.

This will definitely consume some time, but will keep your project from becoming irrelevant and out of date with newer OpenFOAM versions.

@friedenhe
Copy link
Contributor

@olesenm Thanks very much for the suggestion! We will start a new repo and try the steps you mentioned. Cheers!

@olesenm
Copy link
Author

olesenm commented Dec 22, 2021

@olesenm Thanks very much for the suggestion! We will start a new repo and try the steps you mentioned. Cheers!

There are probably better ways to spend the holidays though...

@friedenhe
Copy link
Contributor

@olesenm Thanks very much for the suggestion! We will start a new repo and try the steps you mentioned. Cheers!

There are probably better ways to spend the holidays though...

Aha, coding never stops. :) Happy holiday!

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

2 participants