Syncing with Bootstrap - Orange-OpenSource/Orange-Boosted-Bootstrap GitHub Wiki

Pre-requisite

  1. Fork Bootstrap (on your personal account);
  2. add Bootstrap's repository to your remote.

Then you'll be able to sync your Boosted's repository.


Note: examples assume you're working on v4-dev branch.

Merging

To get latest Bootstrap's changes, you may use two different strategies.

Flat merge, without fork

Working without your own Bootstrap fork will throw conflict for each file in the repository. Pretty ugly, but when no merge had been done for a while or if you're new to Boosted, it'll allow you to learn everything about Boosted differences.

git merge upstream/v4-dev --squash --allow-unrelated-histories

Squashing is optionnal but I highly recommend it. You'll encounter conflict for each file and will need to resolve them manually. Good luck!

Maintenance, with fork

To maintain Boosted at a higher frequency, you'll need to have your own Bootstrap's fork.

Note: you'll have to keep the last patched commit hash somewhere. I highly recommend to add it to your commit message — see an example commit somewhere in v4.4.0 — or at least either in your PR or issue.

In your Bootstrap repo

Note: arguments starting with $ are variable, usually commit hashes.

git fetch upstream
git merge upstream/v4-dev
git diff --full-index --binary $last-patched-commit $last-commit > ../patch.patch

This should generate a patch.patch file in Bootstrap's parent directory.

Then, in your Boosted repo

git checkout -b chore/merge-v4-dev@$last-commit
git apply -3 --ignore-space-change --ignore-whitespace ../patch.patch --exclude=dist/ --exclude=js/dist/ --exclude=docs/dist/

You should have conflicts, and you'll need to resolve them manually — using a GUI (like your IDE) will save you time and mental health.

If you don't have conflicts

You'll then need to use the same command using the reject mode instead of the 3-points one.

git apply --reject --ignore-space-change --ignore-whitespace ../patch.patch --exclude=dist/ --exclude=js/dist/ --exclude=docs/dist/

This will result in modified files (those without conflicts) and reject files — with .rej extension — working the same way a conflict message. You then need to merge those, either manually or using your IDE.

To find every .rej files:

find . -name "*.rej"

Commit your merge

Since Boosted is not currently a fork, you won't have any merge commit. I suggest to format your commit message this way: chore(merge v4-dev): patched commit → $last-commit where v4-dev is the merged branch name and $last-commit the last merged commit's hash.

Before commiting, ensure that you updated Boosted customizations accordingly to latest Bootstrap changes (docs, custom docs, custom components, custom examples, etc.) and that you apply the discrepancies between Boosted and Bootstrap.