Skip to content

add rules to convert the current git tree/index#4922

Merged
yebblies merged 2 commits intodlang:masterfrom
MartinNowak:dswitch
Aug 23, 2015
Merged

add rules to convert the current git tree/index#4922
yebblies merged 2 commits intodlang:masterfrom
MartinNowak:dswitch

Conversation

@MartinNowak
Copy link
Member

convert_tree simply converts the working dir (made for tree-filter)
convert_index uses git rm and git add to prepare a conversion commit.

@MartinNowak
Copy link
Member Author

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

last-cdmd
first-ddmd

@MartinNowak
Copy link
Member Author

The LastCDMD and FirstDDMD commit are still to be determined.
I'd say we should tag them to make the above simpler.

@MartinNowak MartinNowak changed the title remove d sources from gitignore add rules to convert the current git tree/index Aug 23, 2015
@MartinNowak
Copy link
Member Author

I didn't test the windows rules, hope they work.

@MartinNowak MartinNowak mentioned this pull request Aug 23, 2015
@yebblies
Copy link
Contributor

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.

@MartinNowak
Copy link
Member Author

Yeah, so you've lost me at filter-branch.

foreach (commit)
    checkout sources into tmpdir
    run command
    commit missing/updated/added files (a.k.a. just what we need)

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.

@yebblies
Copy link
Contributor

It's rather confusing for everyone who will have to rebase their converted code onto this.

Just turn git add $(GENSRC) objc.d
into
git add -f $(GENSRC) objc.d

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

@MartinNowak
Copy link
Member Author

This pull is missing the makefile updates from https://gist.github.com/yebblies/43555390d29624232ada

This should be done after the conversion.

And it will work as expected, so the changes are not necessary.

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.
It's not like this switch gets better by splitting it in fractal pieces.

@yebblies
Copy link
Contributor

This should be done after the conversion.

Why?

@MartinNowak
Copy link
Member Author

Why?

Because this is still CDMD and you want to build the C compiler.
The next PR will have the converted sources and updated makefiles.
Then we can tag the merge commit of this PR as {LASTCDMD} and the merge commit of the next PR as {FIRSTDDMD}.

@yebblies
Copy link
Contributor

Auto-merge toggled on

yebblies added a commit that referenced this pull request Aug 23, 2015
add rules to convert the current git tree/index
@yebblies yebblies merged commit 9d9cb89 into dlang:master Aug 23, 2015
@MartinNowak MartinNowak deleted the dswitch branch August 23, 2015 04:23
@MartinNowak
Copy link
Member Author

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.

@MartinNowak
Copy link
Member Author

I updated the tree-filter script to account for that.

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

Successfully merging this pull request may close these issues.

2 participants