5

Let's say Alice has a Git repository, and the version is kept track of inside the repository (let's say package.json for npm).

Bob sends a pull request to Alice which increments the version number from 0.1.0 to 0.1.1

Carol also sends a pull request to Alice (independently from Bob's request) which increments the version number to 0.1.1 as well.

How can Alice deal with this situation?

8

If Alice is the maintainer of the project, then Alice and Alice alone should be the one that increments the version. Increasing the version number means a release, and Alice is the one to decide when to release - not Bob and Carol.

Whatever code Bob and Carol contribute, you can be 99.99% certain it'll still work even if they don't increment the version number. The remaining 0.01% is because one can always query for the version number and crash the program if it's below the new value. This can be neglected though - Alice should reject any pull request that does that...

9

Alice should handle this situation by rejecting the pull requests which also change the version number (both of them). Collaborators who are not the maintainer should not be changing the version number - that is the job of the project maintainer.

  • 1
    In my case, the maintainer was asking contributors to increment the version number whenever they submit a pull request. I can see why that's not a good idea. – nyuszika7h Jun 25 '14 at 13:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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