Cruisers Forum
 

Go Back   Cruisers & Sailing Forums > Seamanship, Navigation & Boat Handling > OpenCPN
Cruiser Wiki Click Here to Login
Register Vendors FAQ Community Calendar Today's Posts Log in

Reply
  This discussion is proudly sponsored by:
Please support our sponsors and let them know you heard about their products on Cruisers Forums. Advertise Here
 
Thread Tools Search this Thread Rate Thread Display Modes
Old 12-08-2012, 16:49   #1
Registered User

Join Date: Aug 2012
Posts: 37
Contribution to OpenCPN Development

Hi 2 all,

i've added ( and i'm going to add more) some functionality to recent OpenCPN snapshot (for my purposes).

These are:
- Extended the table in Dialog "Route Properties" by Two fields more: Description of WP and Course from WP.
I need it to create a route plan for my watch officer. I use WP description field to add remarks, how to control WP position using bearings and radar information. Field "course" is just a field "Bearing" for the next WP. It shows, which course should be taken by the current WP.
- I've added Button "Print Route" in very same dialog to print the table (in implementation right now) with captions: WP, Position of WP, Course to steer, Position control, Remarks for next route Leg (dangerous areas, minimal coast approach, TSS approach and similar)
- I'm going to add as well "Harbour approaches", where one can specify how to approach a certain harbour at night or day, with description which boye shoud be kept onf which side, courses, remarks and field for check mark "Passed"

- Besides of that, i would like to develop a plug-in "Ship and Courses identification"
, where on inputs the color lights (green, red, white, red, white ), gets a possible picture to select (motor vessel with restricted in manoeuvrability for example), and gives taken into account own course, its (of another ship) possible courses and gives advice (keep course related to this ship, how to avoid course to not to crow bow line of that ship and similar)
I know, this should be known by heart, but if some rar combination lights appears, it might be not bad idea to make check.



So, here is my question: how do i contribute my development to OpenCPN?
Is there some review process?
Can i just commit my changes?

Cheers,
Registry
registry is offline   Reply With Quote
Old 12-08-2012, 19:52   #2
Marine Service Provider
 
bdbcat's Avatar

Join Date: Mar 2008
Posts: 7,397
Re: Contribution to OpenCPN Development

Registry...

Welcome aboard.

There are several means by which you may contribute.

1. A PlugIn may be developed independently, and hosted by us on opencpn.org if OpenSource rules are followed.

2. An enhancement to the core of OpenCPN may be submitted as a git "pull request" to the opencpn repository at github. Your modifications will be reviewed by the development team, possible changes suggested, and perhaps your new feature will find its way into the next actual release of OpenCPN.

3. Finally, if you and the developers find that your specific changes are outside of the mainstream direction for OpenCPN, you may wish to "fork" your own project from OpenCPN, host it on github, and carry on with independent development. In this case you would be of course encouraged to merge from the current OpenCPN repo master to keep your work in sync with the general direction of OpenCPN development.

We look forward to your involvement in the project.

Dave
bdbcat is offline   Reply With Quote
Old 13-08-2012, 16:48   #3
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Thnx for reply.

Cool.

Now another question.

How to commit ? Several small commits (for easier review) while i'm still developing or one big after all is more or less done?

Cheers,
registry
registry is offline   Reply With Quote
Old 13-08-2012, 22:18   #4
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Contribution to OpenCPN Development

What I usually do is keep one local branch per feature for my own work. Then before letting other people look at a new feature merge the many "work in progress" commits into one, and make that available in a public branch based from the current master. Easy to cherry pick if the feature is OK, and easy to revert if problems are discovered.
JesperWe is offline   Reply With Quote
Old 20-09-2012, 12:59   #5
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Hi,
ok, sofar im approaching finishing line at least for first part of my contributoin.

I've read rules for code style and was wandering, whether you are aware of the project: Uncrustify - Source Code Beautifier for C-like languages

We are using it in our (company, where im employeed) development and it removes a lot of stress with code style. We apply it for every commit and our code looks same independend of the developer coding style.

Don't you want to use it in OpenCPN ?

Just a suggestion.


Now help me please through "pull request".

Once i'm ready to publish my contributoin for review, how should i proceed?
I've created a work branch with the name "routeplanning", was doing my commits and was merging master on regular basis.

Did i understand you correctly (last post)?:
1. I create another branch from master, something like "routeplanning-review"
2. Merge master to my "routeplanning"
3. Merge "routeplanning" into "routeplanning-review".
4. pull request "routeplannig-review"
5. Apply all comments and critics in "routeplanning" and repeat steps 3-5, till opencpn team is satisfied?


Is it correct?

Cheers,
Registry
registry is offline   Reply With Quote
Old 20-09-2012, 13:36   #6
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Contribution to OpenCPN Development

Thx for the code formatter tip. It's only that all us developers are using different environments. I for example use Eclipse. Some use kdevelop. Etc.
I have published settings for Eclipse on the Code Style page. If you want to contribute a settings file for Uncrustify that would be welcome. (You can create an account and edit that page if you wish)

Your understanding of the process is fine. I would clarify:

1. Create your own fork of OpenCPN/OpenCPN on github.
2. Develop in the routeplanning branch of that fork.
3. Push your commit up to Github.
4. Now you can go to your routeplanning branch on Github and do a pull request against OpenCPN/OpenCPN master.
JesperWe is offline   Reply With Quote
Old 21-09-2012, 11:52   #7
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Hi, JesperWe

I would post for the beginning example of the uncrustify.cfg , but cannot find how to upload files into wiki.

I've created an account for OpenCPN wiki and in principle can edit pages (tested with the page Code Formatting).

How do i do that (upload )?

Cheers,
Registry
registry is offline   Reply With Quote
Old 21-09-2012, 13:50   #8
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Contribution to OpenCPN Development

Well... I'm afraid you can't. Neither can I.
The server only allows images to be uploaded.

I suggest upload somewhere else, link to it, and send a PM to "cagney" on this forum and ask him to put the file on the server and update the link.
JesperWe is offline   Reply With Quote
Old 22-09-2012, 03:10   #9
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Hm.... Well, i dont see even link to upload images. (I speak now about OpenCPN | Official OpenCPN Homepage)...
PM to "cagney" on this forum... or where? ( i have now three contextes, OpenCPN wiki, Github, and shis forum...)


Ok, I've managed to push my branch into registry/OpenCPN on github.
I think, that is correct.

I will polish a little bit the code and request a pull against OpenCPN/OpenCPN. Then one can start with iterative review.
registry is offline   Reply With Quote
Old 22-09-2012, 03:53   #10
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Contribution to OpenCPN Development

Image upload is a bit complex :-(

1. go to edit mode
2. Click "Insert Image"
3. Click "Browse Server"
4. Find your user name in the user list and select it.
5. Now you get an "Upload" button

We do not usually use the mail/issue/wiki features of Github.
Documentation is on the homepage wiki, and all communication in this forum.
A PM to cagney here will reach him quickly (if he's not already reading this :-)

/j
JesperWe is offline   Reply With Quote
Old 30-09-2012, 03:29   #11
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Hi,

i've placed a "pull request" from registry/OpenCPN's branch "routeplanning" against OpenCPN/OpenCPN's master.

I hope, that is correct.

Now i would expect a lot of suggestions and comments, which i would then implement, till it gets to the trunk.... or not get...

Regards,
Registry
registry is offline   Reply With Quote
Old 12-10-2012, 15:21   #12
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Hi, Jesper and others,

i'm just curious, how long is it usually takes to review a pull request? Is there some "status" of review, which could give me an idea about it?

Regards,
Registry
registry is offline   Reply With Quote
Old 12-10-2012, 15:50   #13
Registered User

Join Date: Dec 2008
Boat: Journeyman
Posts: 705
Re: Contribution to OpenCPN Development

All such decisions are made by Dave/bdbcat, the project manager.
I just generally try to help out with peoples problems.

And.... I'm afraid your pull request is a complete mess.
I don't understand exactly what you did, but the commit is full of changes from other commits already in master. That is not going to work.

Also, the short title is undescriptive, and the long description is unnecessary. What we want is a single commit with a short (single line) title that describes the changes the commit makes as clearly as possible. "Squashing all commits" does not tell people what your commit implements.

I advise you to open your commit on github.com, and see what changes it makes. If you do that to your current pull request commit, you see it makes all sorts of changes in many files that I'm sure are not part of the code you changed to implement your feature.

So all of this still means it's not possible to do a code review.

I know Git is not easy to grasp at first, I struggled with it myself for a couple of months. But opening and viewing the diff of your commit on github after you've pushed it is a very good way of verifying that you actually pushed the changes you intended to push.
JesperWe is offline   Reply With Quote
Old 12-10-2012, 16:09   #14
Registered User

Join Date: Aug 2012
Posts: 37
Re: Contribution to OpenCPN Development

Yes, there are a lot of files,which i didn't touch. I guess, those changes are from pulls from upstream master (that would be OpenCPN/OpenCPN).

But i hoped, that if i make regular update, diff against the HEAD of OpenCPN/master will show only my differences. But that seems to be not true.

Seems, that i don't understand yet really good idea behind git.

Ok, i will try to prepare branch, which diff only my part contains.

Thnx for help... but i'm afraid, that is not end yet. :-)

Regards,
Registry
registry is offline   Reply With Quote
Old 15-10-2012, 12:44   #15
Registered User

Join Date: Apr 2012
Location: New Hampshire
Boat: CWorker 4 ASV
Posts: 17
Re: Contribution to OpenCPN Development

Is this an issue where merge vs rebase might make a difference? I'm struggling with git myself trying to figure out how to correctly use branches to contribute code the "correct way".

In my case, I seem to have successively sent a patch from my fork's datastream branch, which I updated from Pavel's datastream branch, but I did encounter conflicts around where my code changes occured on my end when I tried updating from his branch after he applied the commits. Maybe this is an instance where I should have rebased instead of merged?

I'm worried that a future pull request from my branch will result in similar commit issues as encountered by Registry. Any git gurus can shed some light on how to avoid such problems?
rolker is offline   Reply With Quote
Reply

Tags
opencpn


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Advertise Here


All times are GMT -7. The time now is 21:10.


Google+
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.
Social Knowledge Networks
Powered by vBulletin® Version 3.8.8 Beta 1
Copyright ©2000 - 2024, vBulletin Solutions, Inc.

ShowCase vBulletin Plugins by Drive Thru Online, Inc.