Comments (6)
OK, I finally got it:
# create a working branch just to avoid messing up master if something goes wrong
git checkout -b update-core-subtree master
# create a remote for the core repository and fetch from it
git remote add -f MCUdude_corefiles-remote https://github.com/MCUdude/MCUdude_corefiles.git
# create a branch with the contents of the core repository's master branch
git branch MCUdude_corefiles-branch MCUdude_corefiles-remote/master
# update the core subtree
git merge --squash -s recursive -Xsubtree=avr/cores/MCUdude_corefiles -Xtheirs --allow-unrelated-histories --no-commit MCUdude_corefiles-branch
# commit the updates to the subtree
git commit -m 'Update core subtree to 3aa8d81' -m 'Fix tone() for ATmega64/128' -m 'https://github.com/MCUdude/MCUdude_corefiles/tree/3aa8d810b24952efc870483dfa2af609a50aa720'
git checkout master
# rebase the commit from the working branch to master
git rebase update-core-subtree
# delete the working branch
git branch -d update-core-subtree
# push the commit to GitHub
git push
That automatically solves the merge conflict.
I'm happy to submit a PR if you prefer.
I also verified that, after the above commands, my standard subtree update recipe works correctly without needing to specify the prefix or dealing with any merge conflicts (not even automatically resolved ones). It seems like something got glitched with the subtree information in the MegaCore repository and after successful update it was repaired.
Here's my subtree update recipe for future reference (not needed for this update as that's handled by the above commands):
# create a working branch just to avoid messing up master if something goes wrong
git checkout -b update-core-subtree master
# create a remote for the core repository and fetch from it
git remote add -f MCUdude_corefiles-remote https://github.com/MCUdude/MCUdude_corefiles.git
# create a branch with the contents of the core repository's master branch
git branch MCUdude_corefiles-branch MCUdude_corefiles-remote/master
# update the core subtree
git merge --squash -s subtree --allow-unrelated-histories --no-commit MCUdude_corefiles-branch
# commit the updates to the subtree
git commit -m 'Update core subtree to {latest commit short hash}' -m '{summary of changes since last update}' -m 'https://github.com/MCUdude/MCUdude_corefiles/tree/{latest commit hash}'
git checkout master
# rebase the commit from the working branch to master
git rebase update-core-subtree
# delete the working branch
git branch -d update-core-subtree
# push the commit to GitHub
git push
The only difference between the two is that instead of using the recursive
strategy with the -Xsubtree=<path>
option, it uses the standard subtree
strategy.
from mcudude_corefiles.
Thanks for the cookbook instructions! Updating MegaCore went smoothly 👍
from mcudude_corefiles.
It's strange because I have specific recipes (based on the official documentation) saved that I use to create subtrees and update them that have always worked in the past but mine also don't work.
I was able to do it like this:
# create a working branch just to avoid messing up master if something goes wrong
git checkout -b update-core-subtree master
# create a remote for the core repository and fetch from it
git remote add -f MCUdude_corefiles-remote https://github.com/MCUdude/MCUdude_corefiles.git
# create a branch with the contents of the core repository's master branch
git branch MCUdude_corefiles-branch MCUdude_corefiles-remote/master
# update the core subtree
git merge --squash -s subtree -Xsubtree=avr/cores/MCUdude_corefiles --allow-unrelated-histories -m 'Update core subtree to 3aa8d81' -m 'Fix tone() for ATmega64/128' -m 'https://github.com/MCUdude/MCUdude_corefiles/tree/3aa8d810b24952efc870483dfa2af609a50aa720' MCUdude_corefiles-branch
# the above fails with "Automatic merge failed; fix conflicts and then commit the result."
# I had to fix the merge conflicts in README.md and Tone.cpp
# add the edits that fix the merge conflicts
git add .
# finally commit the updates to the subtree
git commit -m 'Update core subtree to 3aa8d81' -m 'Fix tone() for ATmega64/128' -m 'https://github.com/MCUdude/MCUdude_corefiles/tree/3aa8d810b24952efc870483dfa2af609a50aa720'
git checkout master
# rebase the commit from the working branch to master
git rebase update-core-subtree
The difference from my standard procedure was the -Xsubtree=avr/cores/MCUdude_corefiles
was required and also the merge conflict never has happened before. Even though that gets the job done it really doesn't make sense that there was a merge conflict.
I'm going to work on it some more and will let you know as soon as I find a better solution.
from mcudude_corefiles.
Not a big deal, but I noticed there might have been some confusion about my subtree update "recipe" above from this commit:
MCUdude/MegaCore@46fc7ea
The things I put in braces like {latest commit short hash} were meant to be manually replaced. They were just notes to myself to give a standardized commit format for subtree updates. I should have been clear about that.
I'm sure it would be easy enough to create a script that automatically fills those values. There's probably one of them out there on the internet.
from mcudude_corefiles.
Yep, I understood that just after pushing the commit..
I'll try to make sure it don't happened again 😉
from mcudude_corefiles.
@per1234 sorry for bringing this thread back up, but I'm having a real hard time updating the MCUdude_corefiles subtree in MegaCore. I'm following your procedure, but strangely, there is nothing to be committed. Do you have any idea why?
$ git checkout -b update-core-subtree master
Switched to a new branch 'update-core-subtree'
$ git remote add -f MCUdude_corefiles-remote https://github.com/MCUdude/MCUdude_corefiles.git
fatal: remote MCUdude_corefiles-remote already exists.
$ git branch MCUdude_corefiles-branch MCUdude_corefiles-remote/master
Branch 'MCUdude_corefiles-branch' set up to track remote branch 'master' from 'MCUdude_corefiles-remote'.
$ git merge --squash -s subtree --allow-unrelated-histories --no-commit MCUdude_corefiles-branch
Squash commit -- not updating HEAD
Automatic merge went well; stopped before committing as requested
$ git commit -m "Update corefiles"
On branch update-core-subtree
nothing to commit, working tree clean
$ git checkout master
Switched to branch 'master'
Your branch is up to date with 'origin/master'.
$ git rebase update-core-subtree
Current branch master is up to date.
$ git branch -d update-core-subtree
Deleted branch update-core-subtree (was 972faf75).
$ git push
Everything up-to-date
from mcudude_corefiles.
Related Issues (12)
- Unified tab spacing and line feed
- gitlab CI HOT 2
- delay() on 20 & 24MHz is wrong HOT 4
- Accurate delayMicroseconds for 14.7456 MHz, 11.0592 MHz, 7.3728 MHz, 3.6864 MHz and 1.8432 MHz HOT 7
- Travis fails HOT 2
- Radical suggestion HOT 5
- Atmega8a-PU (DIP-28) @ internal 8Mhz issue HOT 4
- Replace macros with "proper" functions HOT 11
- Compatibility of delayMicroseconds HOT 3
- Support for ATmega48PB/88PB/168PB/328PB should be considered HOT 13
- Update CI script? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mcudude_corefiles.