Tell me more ×
Programmers Stack Exchange is a question and answer site for professional programmers interested in conceptual questions about software development. It's 100% free, no registration required.

What are the mechanics of contributing to open source projects? How are they managed? What exactly is meant by submitting a patch? Should I do some reading up on advanced version control techniques?

share|improve this question
2  
It depends very much on the particular project. Find one that you're interested in and inquire on how to get involved. You'll that most are more than accommodating to developers who have time and knowledge they're willing to invest. – Cody Gray Jan 22 '11 at 17:39
I think this article would be useful: 14 Ways to Contribute to Open Source without Being a Programming Genius or a Rock Star. – m0nhawk Dec 17 '12 at 15:07
@CodyGray "Ask not what others can do for you..." – Evan Plaice Dec 17 '12 at 22:10

migrated from stackoverflow.com Jan 22 '11 at 17:56

7 Answers

First step is Version Control, I recommend git in conjunction with github. The whole process has been made very painless there, and you can get started fairly quickly.

basic process at github

  1. install and learn git basics

  2. "fork" a project you want to contribute to

  3. clone it to your local machine, edit, and commit changes

  4. then submit a pull request to orignal author, and at that point they decide if they want to include your code in their project.

Note on contribution:

Contribution(like invention) is most commonly born out of necessity. You need a piece of OSS to do something it does not currently do, so you build in (invent) the functionality you require for your given project, it is then that you turn around and say, there is probably more people out there that would benefit from this, so you then turn around and share your progress.

I would say find something that interests you, but more importantly find something that you commonly use (and are familiar with) that you can envision yourself extending. This advice covers the fact that you are interested in it.

share|improve this answer
Are there any projects you would recommend? – Navi Jan 22 '11 at 17:44
added note about picking a project to contribute to. – jondavidjohn Jan 22 '11 at 17:55
You can edit directly on the github site. It will automatically fork the project, create a branch for your edit, and start the process of submitting a pull request. Find some typos or other minor problems in someone's github repo, fix them using the Edit button, and submit your first pull request to get started. Then install git (SmartGit), and clone your fork to your own computer, and you can see what the site did in the log and learn how to do it yourself. – endolith Dec 17 '12 at 17:51
1  
+1 for "Contribution(like invention) is most commonly born out of necessity." If you're submitting patches to projects just for the sake of it, you probably aren't going to get those patches accepted. – nbv4 Dec 18 '12 at 6:37

What can you bring to the table?

Asking, "how do I contribute" is like asking a capitalist how to get rich. There's no one good answer but there are a lot of steps you can take to start moving in the right direction. Let me see if I can help.

What are the mechanics of contributing to open source projects?

It depends on what you're contributing. It's important to make this distinction because contributions can come in many forms and contributing code may not the best entry point to join a project.

If you want to contribute code and the project uses git for version control, then you'll need to have a strong understanding of how to share/collaborate code using patches or via remote tracking branches (ie a 'fork' for the GitHub fans).

How are they managed?

There is always a dictator, either the original author or a project maintainer. How much power/control they grant to project contributors/developers is usually based on trust. Contrary to popular belief, write access to a project's public repository is usually granted to only a select few.

Typically, the project will have a roadmap planning the future direction. If a project has a good community following then creating the roadmap can be as simple as cherry-picking suggestions from user-submitted feature requests.

There almost always is some form of central feature/issue/bug tracking. It's usually the primary communication medium between the project team and the greater community. Most/all external feedback goes through this system because it provides a means for prioritizing and filtering the suggestions based on quality.

What exactly is meant by submitting a patch?

A patch is a diff between two commits in a repository.

AFAIK, every VCS platform has a way to create patches. In git you use the "git format-patch". If you're contributing multiple disparate changes, it's usually good to break the changes down into multiple patches so they can be accepted/rejected individually.

The other way to contribute code is via a remote tracking branch. Basically, you fork (ie clone) the main repo so you can gain write access to it, make it available publicly, and notify the project team that you have code that can be pulled from it for review. GitHub automates most of this process when you fork a project but the workflow is common among DVCS platforms.

If you want to contribute code, this is your first major barrier of entry. If you don't have a good understanding of version control software then you have a lot of reading to do.

Should I do some reading up on advanced version control techniques?

If you want to contribute code then yes. Don't expect the project developers to go out of their way to help you learn to use version control software, especially if you haven't contributed anything of value to a project yet.

You'll want to know how to clone, commit, create patches, how to work with branches, how to merge and/or rebase, how to push/pull, how to use remote branches, the difference between a hard/soft reset, cherry-picking commits, conflict resolution, and good practices for creating and documenting code commits.

**Note: GitHub makes it ridiculously easy to fork a project's public repo.I'd still recommend that you learn how to do things the non-GitHub way.


Intimidated yet? Don't worry...

I answered the questions you asked but not the one you should really be asking yourself.

What valuable skills do I have to offer to the project?

Open Source projects don't run on altruism any more than imagination is fueled by unicorns that fart rainbows. The software is free of cost and free for all to use but that doesn't make the time of the project developers worthless.

If your contribution isn't of a sufficient quality, then it may require further revision or be rejected outright. Even if your code works and is high quality, it could be rejected because it doesn't meet the long-term goals set out by the project maintainers.

A lot of people make the mistake of assuming that because they put a lot of effort into a contribution that it's intrinsically valuable to the project. The harsh truth is, contributions that don't meet a specific need are worthless.

If you really want to become a regular contributor to a project I personally suggest that you don't start by submitting code. Offer other forms of value, whether that be feedback, testing, supporting users, updating documentation, etc. Not only will it help you familiarize yourself with the project and it's goals but it'll start building a good standing with the team.

The hidden cost of OSS development is time. It costs time to produce anything of value and it takes time away from others when you don't. The hidden benefit is that OSS development is often carried out by very highly skilled developers, it teaches you how to effectively manage/coordinate a software development project, and it will most likely lead you to become a better programmer.

Merit is the currency of Open Source. When you're starting out you have none. Don't expect people to go out of their way to help get you up to speed. If you read nothing else in my answer just remember the following three points: contributions don't always come in the form of code; approach a project with a realistic idea of what you have to offer; and do your best to earn merit before you ask for help (you'll be shocked at how much better you will be received if you do).

Aside: It seems counter-intuitive to think that you need to earn the privilege to give your time/effort for free. The economy of merit feels strange and unnatural in a capitalist society but it holds a much deeper intrinsic value. Chances are, whatever time you put in starting off will pale in comparison to the work the project developers have put in. Invest time before demanding it from others and you'll find that the OSS project team will be much more open/receptive to your work/ideas.

share|improve this answer

There is no single answer to this question. There are many different models of FOSS development with many different procedures.

One flavor is the Apache Software Foundation; our web site has quite of a lot of process documentation. But we're only one flavor.

share|improve this answer

there are two simple answers. (a) If your contribution is a simple bug fix, just send it in to whomever you can identify as a principal in the project. If you are looking to join the team, start with (a) but expect to be challenged to prove your seriousness. Huge amounts of time are wasted on volunteers who vanish.

share|improve this answer

http://openhatch.org/ is a site dedicated to getting ppl into open source development, have a look.

Should I do some reading up on advanced version control techniques?

I wouldn't say that was essential when your starting out. As long as you basically understand source control ...

share|improve this answer

There are multiple mechanisms to contribute:

  • Paypal
    But only do so if the project advertises specific uses for donations. Or pay someone to write a feature for you.
  • Subversion
    Join the mailing list, contribute working "patches" against the development version. Patches mean modifications that you run through diff -u to get it in a readable comparison format.
  • Forum
    It's often sufficient to help out managing user support, or to contribute documentation. Contributing ideas is often only asked for by small projects.
share|improve this answer
Documentation is often in wikis or static webpages. Version control is often git, hg, fossil, darcs, or cvs. – Xiong Chiamiov Feb 20 '11 at 23:53

My advice to you is quite simple. If you want to contribute to a project you just have to find one that suits you in GitHub, CodePlex or any other site, read all the documentation they have about the subject (normally you'll find a "get evolved" link) and go from there following all the recommendations that the project's current contributors ask.

You can do code and submit patches, you can donate, you can test and report bugs... etc, etc, etc. Just try to find what the project you've choose needs the most and what's inside your capabilities to do.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.