Archive

Posts Tagged ‘opensource’

Day from opensource project maintainer: git commit –author

October 2nd, 2013 1 comment

Working as opensource project maintainer is a big task. I have been doing it for some time for the RVM project thanks to Engine Yard.

Problem

A big part of the maintenance is accepting others code for the project; it is very important to handle it well so the code author wants to get back to us and help again. As much as Ruby community is opensource oriented there are few things that can be improved. It happened a few times to me and other developers that the code was merged into projects without preserving authorship. This is a basic error made by maintainers, so I want to share some thoughts on how I try to avoid that problem when maintaining RVM. This problem mostly happens when the we want to change the commits, but is not limited to it and happens also without changes.

Easy way

When you do not care about number of commits you can merge the commit from Github or using hub and then add new commit on top updating it to proper state mentioning the ticket number in commit:

git commit -m "Formatting ..., update #2195"

For example see https://github.com/wayneeseguin/rvm/pull/2195

Limit number of commits

The most basic method when you want to limit the number of commits is to apply changes from the committer and then commit it using the --author flag. I used this for https://github.com/wayneeseguin/rvm/pull/2238 – getting the proper result with involving author would require too much work as for small commit, so I did the required changes to the code (just changing order of paragraphs) and committed it using:

git commit -m "..., closes #2238" --author "Name <author@email.com>"

It is important that the author matches exactly the original author name and email (from their commits) so it does not confuse others or tools used (like git annotate). Also make sure to mention the pull request (close #2238) so it is automatically closed and your commit is linked with it.

Work with the author

The slowest way is to actually talk to the author and explain to him/her what changes are required to make his/her commit accepted. For example, this happened in https://github.com/wayneeseguin/rvm/pull/2187 where most of the discussions happened on IRC or Skype sometimes in comments. This way the person contributing gets best experience and getting back to coding on your project is much easier for him/her.

MINASWAN

Matz Is Nice And So We Are Nice

Most important for maintaining your project is treating other developers with respect, they are human beings, being impolite just builds a wall and ensures they will not get back to you or your project.

Other ways?

Obviously there have to be other ways to handle this, please comment below if you use another flow.

Categories: Development, Linux Tags: , ,

A story of PROMPT_COMMAND and RVM

December 17th, 2012 14 comments

It’s a bit over a year as I work as RVM maintainer with over one and half year (19 months) of contributing to the project.

As I work on the project it was always improved, we spent a lot of time responding to user requests. At first I was helping Wayne E. Seguin the original author and later I took over as maintainer. We have been working hard in our free time to improve the first ruby environment switcher. We also had a lot of ideas how to make things better, but because it was our free time we were not always able to make all the ideas happen even implementing them would be as simple as just few lines change.

Today I want to share history of one of that ideas, automatic environment switching using a shell hook PROMPT_COMMAND => http://www.tldp.org/HOWTO/Bash-Prompt-HOWTO/x264.html, it is very easy idea allowing to execute piece of code every time user prompt is to be displayed. It was supposed to solve some limitations of overwriting builtin change directory command – cd, especially not rereading project file when it’s updated.

Before we were able to implement it a new project come to life – rbenv, it was also intended to do the environment switching but a lot simpler. Among of a lot of promotional keywords rbenv was accusing rvm of overwriting cd, which is considered harmful by rbenv author. To not feed the propaganda of a new tool rvm team has dropped all ideas related to accusations from rbenv. Among other interesting ideas rvm dropped also the idea of using PROMPT_COMMAND.

As time passes a lot of new tools was created to do the same thing – switching ruby environments. One of the tools is chruby, one of the most minimalistic implementations. I was helping from time to time the author with shell code, with understanding the problem of switching environment or just discussing various aspects of the tools we work on.

Of course there was also a need for automated switching of environment in chruby, the author started with cd function implementation as this is one of the easiest ways to archive this functionality. But then I have remembered of PROMPT_COMMAND and proposed use of it, which after quick test appeared to be better solution.

Seeing the idea working I have decided to implement it also for rvm, as initially expected this is a lot simpler code and solves some of the issues. We could have this code available for rvm users one year ago, possibly we could have a lot more of good solutions if the problems were discussed instead of throwing accusations as it was done by rbenv author.

So I wanted to sum the situation here, I wanted to disapprove the method of promoting opensource in cost of other opensource software without bringing discussion, without opening not a single ticket for the project. This are practices that you use fighting “corporate” world, as opensource authors we can choose to work together put aside all the politics, and do our work together for common benefit.

On the end I would thank postmodern the author of chruby for bringing up the discussion and working towards standardizing our software.

Categories: Development Tags: , ,