DEV Community

Andy Li
Andy Li

Posted on

Create 5 real PRs in an hour and win a Hacktoberfest T-shirt

The annual Hacktoberfest, which gives away free T-shirts to people who create 5 or more GitHub pull requests, is about to end in a week.

I have been an active open source contributor for years, so I was pretty confident that I will eventually fulfill 5 PRs without actively working towards it. Turn out I was wrong - because I'm now part of the Haxe Foundation org, in which I contributed most, I don't really make PRs to contribute since I just push my commits, and that doesn't count towards the Hacktoberfest goal.

Luckily, there are plenty of low-hanging fruits around and I have successfully reached the 5 PRs mark quite easily. Note that I didn't make useless PRs that paraphrase sentences or perform minor formatting to code. I made "real" contributions that is beneficial. Here is how.

Maintain packages!

The one thing that people may not realize that needs continuous work and is quite easy to do (even for beginner devs) is to maintain software packages. Every time you use a package manager to install something, it pull the package from a repository. It is often to have thousands of packages in a repository and the packages need to be updated (usually manually) all the time since new versions are coming out continuously.

Homebrew-core is a pretty nice repository to work on since it is maintained though GitHub, which is familiar to most open source contributors nowadays. We simply send them PR to update its packages (which they call them formulae).

Find out what is outdated

We can make use of Repology to find out what is outdated. We look up the Repology homebrew page, and click on the "Outdated" metapackages number link.

Outdated homebrew packages

From there, we just pick some familiar ones to work on - maybe you've used that software before, or it's a simple one that is built with languages that you're good at. Try to pick the ones that only need minor/patch update, e.g. from 1.2.3 to 1.2.4 or 1.3.0, but not to a major 2.0.0 release. Be sure to check that there is no existing update PRs created already.

Do the update

We can refer to the homebrew-core's CONTRIBUTING.md for how to do the update.

We can either (A) edit the formula file by updating url and sha256, and then send a PR by hand, or (B) use the brew bump-formula-pr command to do the same thing.

For reference, here is one PR that I made with the command as follows.

brew bump-formula-pr --strict bmake --url=http://www.crufty.net/ftp/pub/sjg/bmake-20180919.tar.gz
Enter fullscreen mode Exit fullscreen mode

That's it!

After sending out the PRs, we can wait for the maintainer's feedback. If the package can be built successfully, it is usually accepted right away. Also, you can click on the "Check Your Progress" button in the Hacktoberfest homepage after you've logged in to make sure you've made enough PRs :)

Top comments (0)