-
Notifications
You must be signed in to change notification settings - Fork 295
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposed change to coding guidelines: squashing commits #660
Comments
Ref http://blogs.atlassian.com/2013/10/git-team-workflows-merge-or-rebase/. In the context of khmer, I think the second sentence under "Decisions, decisions, decisions" is an important consideration:
|
To clarify: we would still do merges to incorporate a pull request (thus documenting what happened). What I'm advocating for is "rebase as cleanup" prior to the merge. "When a feature branch’s development is complete, rebase/squash all the work down to the minimum number of meaningful commits" and then do a merge using the button in GitHub |
I'm still not sure how all the moving parts interact in a pull request. Run through, tutorial, documentation? I'm pretty worried about raising the bar on contributors and adding additional requirements; it's pretty discouraging to receive the message "you did everything right, but here's one more thing..." for the umpteenth time. |
I like the idea of maintaining history clear, but squashing and rebasing is not trivial. Might be a good resource to link on the docs: http://robots.thoughtbot.com/git-interactive-rebase-squash-amend-rewriting-history |
I also think rebasing is a bad idea in general; for example, yesterday, because of the rebase and squash on the seqan branch, @mr-c and I sat there for an hour trying to fix the multiprocessing branch which had merged in seqan before the rebase. Rebasing is not only confusing (let alone for beginners), it has the potential to seriously compromise integrity. It also can silently drop changes if the rebaser makes a mistake during the interactive process. Instead, I think we need to just encourage better commit policy, or deal with the potential for many small commits. I can see no real reason other than pedantry why a less than perfect commit history is a problem anyway. |
That is to say: not only do I think we shouldn't require squashing / rebasing, I think we should discourage any rebasing on all publicly facing branches. |
Any more discussion? At this point I'm leaning towards requesting clear commit messages and that's it. |
I've also now dealt with several merge conflicts caused by rebasing and squashing on branches in PRs. It's a waste of my time and a potential source of bugs when playing around with other people's branches, and I think it needs to be strongly discouraged. |
Maybe we all need a rebasing, merging, and cherry picking primer? People On Fri, Jan 30, 2015, 13:11 C. Titus Brown notifications@github.com wrote:
|
On Sat, Jan 31, 2015 at 12:23:21AM -0800, Michael R. Crusoe wrote:
As soon as a branch is merged into another branch (as happened with HLL
|
@ctb just called this issue out on @swc's discuss@ list, so I thought I'd share another interesting point. In it's GitHub chapter, the v2 Pro Git book has a section (“Pull Requests as Patches”, just under here) that claims the rebase-or-not choice tends to break along mailing-list-based vs. PR-based projects. Personally, I like rebased branches, because I want to review the whole feature branch from scratch before merging it, and I don't want to be distracted by dead-end work and other waffling that happend while the feature branch was being discussed (but then, I came up through list-based projects). But if your reviewers are following along as a branch develops, starting the review again after each round of edits is going to be more work. The other main impact is if you're using On the difficulty front, the “Rebase without tears” seemed a bit alarmist ;). So in rebase vs. not before merging, I'd say rebasing gets you a shorter history that's easier to review after the fact and has a useful |
@wking Thank you for sharing, I am +100 on this perspective but still unsure as to how to enshrine into policy. |
On Mon, Mar 30, 2015 at 04:56:37AM -0700, Michael R. Crusoe wrote:
If the maintainers feel like they follow all the in-flight PRs as they Please don't reroll your pull requests, because we're following them If the maintainers (like me) want to re-review a rerolled feature After submitting a pull request, the usual worflow is:
One other feature of a rerolly workflow is that you're more likely to |
On Mon, Mar 30, 2015 at 04:56:37AM -0700, Michael R. Crusoe wrote:
I'm -1 on requiring it of new contributors - I don't want to add to what we I'm currently -0 on allowing it on open pull requests. It has been the cause I honestly don't see a strong reason to complicating our lives. |
On Tue, Mar 31, 2015 at 03:41:03AM -0700, C. Titus Brown wrote:
I agree, which is why you want a “good enough” safety valve (step 3 in
I think the solution here is more clarity on when portions of unmerged
As you gradually train your contributors to polish and reroll their
|
Thought about it a lot. Tentative decisions:
|
On Fri, May 08, 2015 at 10:09:44AM -0700, C. Titus Brown wrote:
These sound good to me. My only suggestion would be to drop “but the This needs to be rebased onto the current master to resolve or: This could be rebased and squashed into more compact pull request, or: This could be rebased and squashed into more compact pull request. In each case, I think it's fairly clear who is expected to do (or has |
Suggested language is good, thanks - I basically want to avoid clubbing our contributors into yet more technically demanding requirements for a merge! |
+1000. If people are incorporating another's PR then heads up should be given so the that source PR can rebase/squash prior. Thank you @wking for all the feedback! |
On Fri, May 08, 2015 at 01:27:17PM -0700, Michael R. Crusoe wrote:
This isn't necessarily how research works :). +1 on "should" and -1 on "must". |
See #1013 for a good method of squashing commits! |
Fixed in #1222 |
During the bulk of the development of a pull request I think the commits should fly fast and furious. However I would like to see them squashed down to a handful of commits (perhaps 1) during the refinement phase prior to merging.
Thoughts?
The text was updated successfully, but these errors were encountered: