Contributing Code: One Big Commit or Several Small, Consecutive Ones?

For community members who want to contribute a large change to Unreal Engine, is it better to submit a single, gigantic pull request (for less frequent/demanding merge intervals)? Or would Epic prefer that we contribute it in several small, consecutive updates (for rapid and evolving development)? Discussions in the community IRC imply that Epic likes to heavily QA contributions before merging, which suggests the former is a better fit. Thoughts?

Your commits should be atomic changes, you should be able to justify not breaking each commit into two or more smaller changes.

Your pull requests on the other hand should be full (but also probably atomic) features/bugfixes. All but the most trivial bugfixes should encompass multiple commits.

Both are guidelines and opinions at that. Your instinct is correct in that a bunch of small pull requests would waste time. But lumping in multiple unrelated features is not helpful. Basically each pull request should probably be describable in one or two sentences without the word “and”. (Though “and cleaned up documentation” and such is usually fine :stuck_out_tongue: )

Example Good Pull Requests:

  • “Fixed array overflow in physics loop”
  • “Added Analytics provider X”
  • “Removed duplication between Y and Z classes” Can’t even follow my own guidelines

Example Bad Pull Request:

  • “Added Analytics provider X and fixed array overflow in physics loop”