How to post new code

I built and emonGLCD this weekend and downloaded the solar sketch.  Being from the other side of the pond I wanted to see the temperature in degrees F so I  made a few change to the code to allow selecting C or F and voila I had units I can understand.   Then I realized that I needed to add L1 and L2 of my power together and divide by 2 on my incoming feeds to get the right consumption. So I added a constant for choosing a US setup.  Then I decided that I like to see watts not KW when the readings are over 1000 watts, so I made a change to choose that.  Then i thought, you know i need to be able to turn the backlight and leds on and off manually so that got added.  

Needless to say.....this is addictive.  Three days into it and I have a whole host of changes I have made.  

Now to my question...where to I push the files if I want to contribute to the project.  I have never contributed to open source before so I am not sure how to go about it.  If I push back to git will I overwrite what is already there?  

Ken

Robert Wall's picture

Re: How to post new code

Most people tend to attach the file, or a zipped set of files, to a post in which they explain why it is changed/better.

knicely's picture

Re: How to post new code

That works!  Here are my changes to the emonGLCD solar sketch.

The changes include....

  • degrees Fahrenheit or Celsius
  • manual backlight and led control via switch 3
  • US setup for unbalanced feed (2 120VAC feeds)
  • watts or kilowatts display.

Ken

Jérôme's picture

Re: How to post new code

The workflow on Github (and more generally) is the following.

Assuming you already used git to pull the code.

- Log into Github (yes, this means create an account...)

- Fork the project in Github (you can't miss the Fork button)

- Clone you fork (easy but you'll need to more your modifications to this new fork) or (more elegant but a bit more tricky) modify the config of your local clone to point to your new Github clone (http://blog.csanchez.org/2011/01/06/github-forking-after-cloning/).

- Commit your modifs in a new development branch on your local clone.

- Push the modifs from your local clone to your Github clone (all branches, or at least the dev branch your created).

- Log into Github Web interface, pick the dev branch and click "Pull request'. Add an explanation message.

The people following the project will be notified.

This is a bit more of a pain for you at first, but it's a time saver when you get used to it, and it allows the devs to integrate your work in one click. Plus the gain in terms of traceability.

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.