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

Merge avr-100-pin branch into master #49

Closed
wants to merge 62 commits into from
Closed

Merge avr-100-pin branch into master #49

wants to merge 62 commits into from

Conversation

MCUdude
Copy link
Owner

@MCUdude MCUdude commented May 21, 2017

I've been working on this branch for a while now. Support for ATmega640/1280/2560 is added, and Optiboot has gotten a major cleanup and is now maintained from its own repository. The Arduino core files now supports all my Arduino cores, and is also maintained from its own repository. Travis CI is now implemented, which makes testing and bug smacking much easier.

MCUdude and others added 30 commits March 28, 2017 22:37
This branch is a work in progress. The intention is to add support for the ATmega640/1280/2560 to this Arduino core as well.
Delete duplicate file. Located in the src folder instead
Delete duplicate file. Located in the src folder instead
It's easier to maintain one copy of optiboot, rather than four. That's why I've merged optiboot_flash from MightyCore, MiniCore, MajorCore and ButterflyCore into this one. Hopefully this will be helpfull when the official optiboot testing will begin
Needed to fix the new bootloader path + pinout naming
More self explaining names where needed
git-subtree-dir: avr/bootloaders/optiboot_flash
git-subtree-split: ab5e7651397c20b1caa32a8139327af93c5b4a0d
per1234 and others added 10 commits May 16, 2017 20:29
Correctly handle failure at all build lifecycle steps. This should
allow
the report push to be retried if it fails and if the retries fail
it
will still complete the rest of the build and not cause a failure.

per1234/arduino-ci-script@6ec96b8
Now that error handling in the script has been fixed, Travis CI will
be
able to track job success based on the return value of build_sketch
so
it's no longer necessary to have a function for this.
Update arduino-ci-script subtree to 6ec96b8
Fix bug that causes build_sketch to return false negatives when:
- build_sketch arguments specify compilation of a single sketch with
multiple IDE versions.
- One of the complations fails
- The last compilation before build_sketch returns is successful

per1234/arduino-ci-script@dc0c81d
Retry verification after arduino returns any undocumented error code.
This will provide multiple opportunities for a successful sketch
compilation in the event that a temporary glitch unrelated to the sketch
or script causes a failture.

per1234/arduino-ci-script@7fd36de
Update arduino-ci-script for correct failure handling
Without the leading zeros the folder listing in the report repository is not correctly ordered.
Add leading zeros to the report folder name
@MCUdude MCUdude closed this May 21, 2017
@MCUdude MCUdude reopened this May 21, 2017
@MCUdude MCUdude closed this May 21, 2017
@MCUdude MCUdude reopened this May 21, 2017
@MCUdude
Copy link
Owner Author

MCUdude commented May 21, 2017

I need some help here. I tried to resolve this issue from the command line, but git added <<<<<<< HEAD: to a lot of the files, which obviously caused Travis build to fail. I've now rolled it back, but how can I merge this PR without messing everything up again? Will the commit history from the avr-100-pin branch be added to the master?

It seems like the conflicting files is avr/cores/MegaCore/Arduino.h and avr/cores/MegaCore/WInterrupts.c. However, these files should be deleted anyway.

@per1234
Copy link
Contributor

per1234 commented May 21, 2017

There are some conflicts as the history of the branches are combined because they have diverged a little. I just had a try at resolving them but I was tripped up somehow by the subtree commits so I need to redo it. All the commit history from the avr-100-pin branch should be added to master during the merge. I feel like these should be rebased onto it so that none of the history of the master branch is changed. The one I saw that became redundant was c6ae0fd because, other than breaking line 70 into two lines, that change had already been made on the master branch at 30723e0 so I squashed that change into e546d43.

I'm a little too tired now to make sure I don't mess this up but I'll have another try in the morning if you haven't fixed it by then. Resolving merge conflicts always make my head hurt. I always keep my finger crossed when I'm doing a rebase in hopes that I won't have any to deal with.

@per1234
Copy link
Contributor

per1234 commented May 21, 2017

Just wanted to give an update on my progress (or lack thereof). It turns out that for some crazy reason Git puts subtrees into the repository root when you rebase. I couldn't figure out why that kept happening to me. The only workaround I've found is that all the subtree merges need to be omitted from the rebase and then added back in one at a time:
http://stackoverflow.com/questions/12858199
So I'll give it a try and then submit a PR to master if I can get it to work right.

@per1234
Copy link
Contributor

per1234 commented May 21, 2017

Well, this is what I've managed:
https://github.com/per1234/MegaCore/pull/1
That's a preview of what the pull request would look like if I submitted it.

The main thing I don't like is that the author field for every one of your commits says "MCUdude committed with per1234" now. I don't know how to get rid of that.

I didn't end up exactly reproducing your subtree commits for optiboot_flash and MCUdude_corefiles. We must have a different system for doing that because mine happen in only a single commit but yours happen in multiple commits. I follow these instructions:
https://git-scm.com/book/en/v1/Git-Tools-Subtree-Merging
Interestingly, my arduino-ci-script subtree commits didn't have the issue with Git moving them to the root of the repository.

@MCUdude
Copy link
Owner Author

MCUdude commented May 22, 2017

Well, this is what I've managed:
per1234#1
That's a preview of what the pull request would look like if I submitted it.

I have no problems with you getting you name all over this merge. After all, you're been incredibly helpful.

Does this mean you would have to create a new pull request, where you've merged avr-100-pin into the master of your fork, and then I merge your fork into this repos master, right?

@per1234
Copy link
Contributor

per1234 commented May 22, 2017

Does this mean you would have to create a new pull request, where you've merged avr-100-pin into the master of your fork, and then I merge your fork into this repos master, right?

That's correct. I would just need to submit a pull request to merge my branch:
https://github.com/per1234/MegaCore/tree/rebase-avr-100-pin
into your master branch. In that branch I've already rebased all commits from your avr-100-pin branch onto your master branch so it will be able to be merged to your master branch without any conflicts.

I just need to wait for the Travis CI build of my branch and then I can submit the pull request. Unfortunately I just noticed that the build was blocked from starting by an ongoing build of a previous attempt that I had replaced but forgot to cancel so it's just getting started now:
https://travis-ci.org/per1234/MegaCore/builds/234693547

@MCUdude MCUdude force-pushed the avr-100-pin branch 3 times, most recently from bafb54e to 0485272 Compare May 22, 2017 08:29
@MCUdude
Copy link
Owner Author

MCUdude commented May 22, 2017

I got som help from a colleague, which is much more experienced with git than I am. We were able to merge the two branches, and created a new one, v2.0.0 which Travis is now working on. Let's see how it goes 🤞

@per1234
Copy link
Contributor

per1234 commented May 22, 2017

My work is more clean but go with whatever you're happy with.

@MCUdude
Copy link
Owner Author

MCUdude commented May 22, 2017

I'd allways prefer the cleanest. How is yours cleaner then v2.0.0?

@per1234
Copy link
Contributor

per1234 commented May 22, 2017

I redid the subtree commits after the rebase so that they correctly place the subtrees in the correct subfolder of the repository, as the original commits did. Your subtree commits put the subtrees in the root folder, which required you to later add the commits moving them to the correct folder:
ba386ff
ee77ab8
This means that MegaCore is broken at all points in history between the subtree commits and the commits listed above. I always try to create a commit history where the code is in a working state at any point in history. This allows you to step back through history when you are troubleshooting a bug to determine exactly which commit introduced the bug. There's a good chance that nobody will ever need to do that in this case but it's just a general best practice.

The subtrees initially being added to the root in your v2.0.0 branch also caused the strange conflict in README.md which required you to add e2bb8b7. This also resulted in the README.md file being missing from avr/cores/MCUdude_corefiles/, which was not the case in the avr-100-pin branch. Not really a big deal but fairly easy to avoid.

The final result is essentially the same in either branch so either way you go it will be fine. I get kind of uptight about commit histories because I end up digging through them quite often. Mostly this is because I don't really know what I'm doing and I have to try to "reverse engineer" the purpose of some code that would probably be obvious to someone with more knowledge. When find the commit where that line was added or modified and it's a some non-atomic changes with a commit message that only says "Update foo.c" it makes me want to tear my hair out!

@MCUdude
Copy link
Owner Author

MCUdude commented May 23, 2017

Yep, my colleagues fix messes up the subtrees. If you create a PR, i'll merge it into the master

@MCUdude MCUdude closed this May 25, 2017
@MCUdude MCUdude deleted the avr-100-pin branch May 25, 2017 20:51
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