Take the 2-minute tour ×
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.

Imagine, there is an open-source project with a Maintainer and a Contributor. Both of them have theirs repos exported to some repository hosting (github, bitbucket, sourceforge --- whatever, but they are public).

Imagine further, Contributor did several commits, pushed them into his repo and sent pull-request to the Maintainer. Maintainer did review, made several comments about commits (fix this, fix that, simplify there, blah-blah-blah) and rejected the pull-request. Note:

  1. For Contributor it's obvious that it's better to just fix patches/commits than rewriting from scratch.

  2. Please consider situation, when there are many commits and fixes have to be scattered between them.

What should Contributor do in this situation before making next pull-request? Remove invalid repo, rewrite history and push new one? Make a fix commit into current one?

May Maintainer demand, that incoming history should be clean? I.e. is it technically simple enough to do?

share|improve this question

1 Answer 1

up vote 4 down vote accepted

Most of the time, you simply incorporate the changes into a new commit which gets appended to the same pull request. Primarily this is so you don't lose the review history when the fixes are reviewed. Reviewers will want to be able to easily compare your original submission to the fixed version. If the maintainer wants a "clean history" (by definition an inaccurate history, but that's a rant for another time), then they will usually squash your pull request when they accept it.

However, some maintainers may specifically ask you to clean up the history. In that case, a contributor should do what they ask, which may necessitate a new pull request, depending on the tool you're using. If you are submitting several dependent features at once, you may want to keep them in separate branches locally to make clean up like this easier.

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.