Pullrequest for RWE Smarthome binding - little help needed


I am ready for a first pull request, but I am a bit confused and need some help. What I did:

  • implemented a new binding for RWE Smarthome based on openhab-master
  • after implementing, my fork was a bunch of commits behind master, so I updated from master again
  • when github said, I was 0 behind and 88 commits ahead master, I ran the command to squash 88 commits into one

Now in this 88 commits there a loads of commits from the official openhab-master and all my commits. Is that ok and can I finally execute the command and then create the pull request or did I do something wrong here?

I am a bit confused by all those commits from master in the list…

Thanks and regards

You don’t want all those unrelated changes in your pull request. The basic steps I would use are:

  • Create a fork of openhab/openhab repo
  • Clone the fork to your local machine
  • On the master branch, create a new branch named something like rwe-smarthome-binding
  • Perform all of your file edits on this branch, and do all testing, builds, etc.
  • Stage them for commit and commit them to this current branch
  • git push origin rwe-smarthome-binding
  • Go to github.com to your fork with the newly pushed branch, and submit a pull request for your branch

Hope this helps!

Hi Watou,

thanks a lot for this little step-by-step guide. I just created the pullrequest:

Would be great to see the RWE Smarthome binding as part of the official 1.8.0 release. :smile:

If the pullrequest is accepted, do I then just have to do an “Update from openhab/master” and to the same again (create branch, commit, git push, pull request)?

Thanks and regards

Hi Ollie,
After the pull request is reviewed and some requested changes are made (usually there are a few changes before a PR is accepted), you will be asked to squash your commits into one commit for the whole pull request. (There are good guides out there for doing that.) That makes it easier to maintain the repo. After those steps, Thomas (@teichsta) would merge your PR into the main repo, and then you could switch back to your fork’s master branch, git fetch upstream, git merge upstream/master, and your binding code would be there. At that point you would have no further need for your rwe-smarthome-binding branch and you could remove it. If you had further pull requests, you would create new branches and submit new pull requests from them. Hopefully one of us can review the PR soon. Thanks so much for submitting it!

1 Like

I have a similar question, I have imported the openhab repo into bitbucket (I would rather use this than github, but I also tried it with github) and want to commit some of my private changes.
But I don’t understand how I keep my fork/import in sync with the official repo? If I run “git fetch upstream” on my local machine like watou said, I get an error message that “upstream does not appear to be a git repo”. Do I have to link them somehow?

This is what helped me:

Great, thank you!