add rules to convert the current git tree/index#4922
Conversation
# How to convert a PR against CDMD?
# update upstream and tags
git fetch upstream --tags
# checkout your branch
git checkout myBranch
BRANCH=$(git rev-parse --abbrev-ref HEAD)
# make sure your working dir is clean
git status && git clean -dn
# rebase onto last CDMD state, resolve merge conflicts as usual
git rebase --onto last-cdmd last-cdmd ${BRANCH}
# convert all commits using magicport
# In case the magicport filter-branch fails b/c you need to
# update magicport.json, redo the above rebase as interactive rebase
# and edit/update your commits as necessary.
git filter-branch -f --tree-filter '
cp src/root/async.{h,bak}
cp src/root/checkedint.{h,bak}
make -C src -f posix.mak convert_tree
mv src/root/async.{bak,h}
mv src/root/checkedint.{bak,h}
rm -f src/verstr.h' last-cdmd..${BRANCH}
# cleanup the working tree (still contains .c files)
git reset --hard
# rebase your new DDMD branch onto the first DDMD commit, -X theirs keeps all your changes
git rebase -s recursive -X theirs --onto first-ddmd first-ddmd ${BRANCH}
# rebase your branch onto master
git rebase --onto upstream/master first-ddmd ${BRANCH}
# update your PR
git push -f origin ${BRANCH} |
|
The LastCDMD and FirstDDMD commit are still to be determined. |
|
I didn't test the windows rules, hope they work. |
|
https://gist.github.com/yebblies/43555390d29624232ada Yeah, so you've lost me at filter-branch. The gitignore changes do not need to be done now. |
It's rather confusing for everyone who will have to rebase their converted code onto this. |
Just turn And it will work as expected, so the changes are not necessary. This pull is missing the makefile updates from https://gist.github.com/yebblies/43555390d29624232ada |
This should be done after the conversion.
If I have to make another PR for this trivial piece I'll have to wait another hour and will rather go to bed, meaning we'll continue on monday or so. |
Why? |
Because this is still CDMD and you want to build the C compiler. |
|
Auto-merge toggled on |
add rules to convert the current git tree/index
|
Damn it, you didn't delete root/{async,checkedint}.h, not this will happen in the filter-branch step, and needs to be resolved when rebasing onto upstream/master. |
|
I updated the tree-filter script to account for that. |
convert_treesimply converts the working dir (made for tree-filter)convert_indexusesgit rmandgit addto prepare a conversion commit.