kcc icon indicating copy to clipboard operation
kcc copied to clipboard

Rebase over SDCC r11930

Open pixelherodev opened this issue 5 years ago • 7 comments

pixelherodev avatar Oct 30 '20 14:10 pixelherodev

cc @aviallon @MaxLeiter

pixelherodev avatar Oct 30 '20 14:10 pixelherodev

@aviallon For future reference: the process I used to import changes relatively cleanly:

  • Format all the codes. clang-format -i --style=file src/*.{c,h,hpp,cc} src/backend/*.{c,cc,h} src/util/*.{c,h}

A simpler formatter would be nice, but I used what I had on hand

  • Commit that and leave it on master. For the future, we'll want to enforce this for every commit, so it doesn't need to be done in bulk.

  • Branch.

  • Copy all upstream files in place.

    • rsync ../../../archives/sdcc/sdcc/src/SDCC* src/
    • rsync ../../../archives/sdcc/sdcc/src/z80/*.{h,c,cc,def,i} src/backend/
    • etc
  • Selectively apply patches with git add -p. It's been five years, and there's about 10KLoC changes. If we do this regularly (monthly, maybe?), we should be able to easily apply only those patches we want and reject the ones we don't. Alternatively, we can go over the revisions upstream now that there's fewer to look at, and apply those instead. This time, I just took my time and combed over the changes, adding them piecemeal.

  • Once all desired changes are selected, make a temporary commit.

  • Remove unwanted changes with e.g. git reset --hard.

  • Test.

  • Add fixes in their own commits, with careless messages :p

  • Rebase, merge together commits which make sense as one, clean up messages. Rule of thumb: every single commit should build without issues. If any don't, that's a problem, and it should be fixed in this step.

  • Review

  • PR

pixelherodev avatar Oct 30 '20 14:10 pixelherodev

Ignoring the changelog, this is +16328 -9249, which should be much easier to review than the last attempt, but still might be better split into pieces.

pixelherodev avatar Oct 30 '20 14:10 pixelherodev

This is very neat ! Thanks !

aviallon avatar Oct 30 '20 15:10 aviallon

I'm happy you find the time to work on this... Do you think that this new codebase would support c99 ? (At least variable declarations not at the beginning of a context) This would be cool :smiley:

aviallon avatar Oct 30 '20 15:10 aviallon

It already did! :P

It supports more of C99 now, but it already supported a good chunk with --std-c99.

pixelherodev avatar Oct 30 '20 15:10 pixelherodev

Unfortunately, it didn't for this particular feature.

aviallon avatar Oct 30 '20 19:10 aviallon