Contributing changes to Arduino github branches...

20 views
Skip to first unread message

William Westfield

unread,
Dec 18, 2017, 8:45:27 PM12/18/17
to Developers
Normally, I only experiment on official Arduino code, off in a "git clone” of the master branch.
But now I have an actual patch where the Arduino team is like “sounds good! Submit a pull request!”

And it seems I don’t quite no how to do that; all my git experience has been with repositories where I am the owner!
Pull requests go from branch to master, not from clone to master, right? Or is it “fork”? or both?
Do I create a branch and then clone that, or create a branch inside my clone?

I found this: https://github.com/asmeurer/git-workflow for another open source project. Does it look about right?

If I’ve forked, do I continue to use the same fork for additional patches? How do I keep it up-to-date WRT changes in the Arduino repository? (I thought I had westfw/Arduino that I was using for possible optiboot patches, but it seems to have gotten heavily out-of-sync (merge required) with changes that I don’t think came from me, so perhaps I did something wrong?

Some of this should probably be in https://github.com/arduino/Arduino/blob/master/CONTRIBUTING.md - it has details on format of commit docs, but not much on forking/branching/etc…

Thanks
Bill W

Victor Aprea

unread,
Dec 18, 2017, 8:57:39 PM12/18/17
to Arduino Developers
Fork it in github.

Then clone the fork.

Then merge your changes into the cloned fork repo and push.

Then submit a pull request from the forked repo.

Vic


--
You received this message because you are subscribed to the Google Groups "Developers" group.
To unsubscribe from this group and stop receiving emails from it, send an email to developers+unsubscribe@arduino.cc.

Phillip Stevens

unread,
Dec 18, 2017, 9:17:12 PM12/18/17
to Arduino Developers
Yes as Victor says.

Me, as a git-noob, but doing a number of pulls for the z88dk, I use this work process.

Fork it in github.

Keep your fork clean and keep "pulling" from the master repo to stay up to date over the weeks / months you're tracking it.

If something can't be automatically merged from the master, for what ever reason, then burn it all down (delete the fork) and start again.
But, then you lose history that perhaps you'd like to have around.

Then clone the fork.
 
To make your local copy of your fork (not the master fork).

Then merge your changes into the cloned fork repo and push.

I use Meld (visual diff) to do this step, and I don't leave until the directory that I've been working in is exactly the same.
Commit the changes carefully, not to accidentally add any files that are not part of what you want to commit.
If necessary for clarity, break up the commits into smaller chunks that are related to each other.
Then "push" the local changes into the forked repo version that you own.


Then submit a pull request from the forked repo.

Then do a new pull request "compare across forks" with your repo as the "head fork".

As a check once my pull has been committed, then I "stash" the original changes I made in my working clone of the master fork, and then update my clone of the master fork, and check (the reverse check) again with Meld that I didn't forget to commit something that I'd put into my clone of my fork, which originated the pull request.

Once everything checks out (no dumb mistakes) I "drop stash" on my local changes (which are now in the master repo, and my local clone of it).

Vic

Cheers,
Phillip 

William Westfield

unread,
Dec 18, 2017, 9:23:15 PM12/18/17
to Developers
On a somewhat related note, if I patch one of the separate core repositories (Arduino/ArduinCore-sam), how do I convince a normal Arduino install to use that core for testing?

Thanks
Bill W

Cristian Maglie

unread,
Dec 19, 2017, 4:33:51 AM12/19/17
to devel...@arduino.cc
Il 19/12/2017 03:22, William Westfield ha scritto:
> On a somewhat related note, if I patch one of the separate core repositories (Arduino/ArduinCore-sam), how do I convince a normal Arduino install to use that core for testing?


The simplest way is to use the sketchbook/hardware folder, just make a
symlink from:

SKETCHBOOK/hardware/arduino-test/sam

to your clone of the ArduinoCore-sam repo.

Note the use of the vendor "arduino-test" instead of "arduino": this is
required to not overlap with the core installed via board manager and
results in a duplicate set of boards in the boards menu (one from the
core installed via board manager and the other from your cloned
repository), you need to select the correct board to test your cloned
repository.

If you're unsure you can enable verbose compile to see if the IDE is
picking the desired files.

C
--
Cristian Maglie <c.ma...@arduino.cc>
Reply all
Reply to author
Forward
0 new messages