MicroPython and CircuitPython

C programming, build, interpreter/VM.
Target audience: MicroPython Developers.
Post Reply
ttmetro
Posts: 99
Joined: Mon Jul 31, 2017 12:44 am

MicroPython and CircuitPython

Post by ttmetro » Tue Jan 05, 2021 6:36 pm

I'd like to do a PR but since I already have a fork of CircuitPython I cannot create another fork of MicroPython.

Does anyone have a solution for dealing with this?
I prefer not having two github accounts or deleting the CircuitPython branch.
Bernhard Boser

stijn
Posts: 588
Joined: Thu Apr 24, 2014 9:13 am

Re: MicroPython and CircuitPython

Post by stijn » Tue Jan 05, 2021 7:35 pm

since I already have a fork of CircuitPython I cannot create another fork of MicroPython
You can just fork MicroPython separately, clone it in a separate directory and copy your patch (a.k.a. changed files) to it and work as usual?

Or you can add MicroPython as a separate git remote to your current repository, but since CP and MP are probably hundreds of commits away from each other that might get confusing.

ttmetro
Posts: 99
Joined: Mon Jul 31, 2017 12:44 am

Re: MicroPython and CircuitPython

Post by ttmetro » Tue Jan 05, 2021 7:54 pm

stijn wrote:
Tue Jan 05, 2021 7:35 pm
since I already have a fork of CircuitPython I cannot create another fork of MicroPython
You can just fork MicroPython separately, clone it in a separate directory and copy your patch (a.k.a. changed files) to it and work as usual?
Tried, but

(1) github won't let me fork micropython since I already have a fork of circuitpython which itself is a fork of micropython.

(2) I tried just cloning micropython, but then was not able to do a PR.
Or you can add MicroPython as a separate git remote to your current repository, but since CP and MP are probably hundreds of commits away from each other that might get confusing.
As you say, this gets super confusing. But the bigger problem I ran into is that I could still not make a PR against micropython, just against circuitpython.

Thanks for the response, maybe I'll just need separate github accounts (which gets confusing ...).
Bernhard Boser

stijn
Posts: 588
Joined: Thu Apr 24, 2014 9:13 am

Re: MicroPython and CircuitPython

Post by stijn » Tue Jan 05, 2021 8:06 pm

Ah sorry, missed the part where github doesn't let you do that. Hmm, interesting.

Christian Walther
Posts: 131
Joined: Fri Aug 19, 2016 11:55 am

Re: MicroPython and CircuitPython

Post by Christian Walther » Tue Jan 05, 2021 10:56 pm

Weird. I just confirmed that GitHub doesn’t let you fork MicroPython if you already have a fork of CircuitPython (I thought I already had forks of both but I didn’t). I would take that up with GitHub support, it’s clearly a valid use case.

A possibly less (or possibly more) confusing alternative to making a second account might be to make an organization that your account is a member of. You should then be able to make a fork under that organization (at least GitHub proposes that to me) and work on both with the same account. Or you could try to make a fork under a second account (or organization) and then transfer its ownership to your main account – I don’t know if that would let you circumvent the limitation.

tannewt
Posts: 49
Joined: Thu Aug 25, 2016 2:43 am

Re: MicroPython and CircuitPython

Post by tannewt » Wed Jan 06, 2021 12:45 am

Hi folks,
You don't actually need a separate GitHub fork. You can create a pull request to either by changing the comparison root on the comparison screen. There is also a helpful pop up that appears after you push to a branch. So, view `github.com/micropython/micropython` and push to a branch on your "circuitpython github fork". You should see a prompt at the top to make a PR. Click that and you should see the diff. My setup is the opposite because my github fork is from micropython originally.

Locally, you likely want to add another remote for micropython so do `git remote add micropython git@github.com:micropython/micropython.git) (or https if you have it setup like that.) Then do `git fetch micropython` and `git checkout micropython/master`. This will put you at the latest version of micropython that you can start from (aka create a new branch).

I don't often switch between mp and cp so there may be untracked files left between the two.

Feel free to ping me on the adafruit discord if you need further help: https://adafru.it/discord

Post Reply