Jump to content
 
  • 0
holdmybeer

Help, my Github project splits up!

Question

My SAME54 project is growing every day, and I have to make a decision how to manage my code. Maybe someone has an advise for me?

The situation is this, I started to develop the project in Studio. Later, some people persuaded my to rebuild my project to work with XC32 along with the headers from XC. So I made a branch "MPLABX_Branch" to put the modified project there. Now I have a complete parallel branch with different register names and it's quite a pain to maintain them both if I want to add something new.

Should I put the branch into a new repository? Or should clutter up the code with a lot of #ifdefs for XC and GCC? What would be the best approach?

 

Share this post


Link to post
Share on other sites

1 answer to this question

Recommended Posts

  • 1

Depends on what you need of course 🙂

You need a repository for everything that will become a stand-alone project/product, something you would like to give a version number. Branches are temporary things that you will delete. Forks are new projects which are unique projects themselves, based on another project, like a fork in the road it takes you to a new destination.

Looking at your project I think you should not have 2 branches. If you want this to be 1 project/product you should merge the branches so that you can use the shared code and use either separate folders or defines to get your code to cross-compile. If you want them to be 2 separate projects you should make a second repo with the other project.

Just a side-note. Cut and paste is a perfectly reasonable way to re-use code. If you make one repo which cross compiles you are not just sharing code, your projects actually have a hard dependency on each other, which mean you can never change the one without profoundly affecting the other one. This kind of "marriage" of projects is often not the intent of sharing code, so take care to not end up with unwanted dependencies.

Share this post


Link to post
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Answer this question...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


 


×
×
  • Create New...