fraction / oasis

Free, open-source, peer-to-peer social application that helps you follow friends and discover new ones on Secure Scuttlebutt (SSB).
http://oasis-demo.fraction.io
GNU Affero General Public License v3.0
286 stars 42 forks source link

Propose defaulting to Rebase & Merge #103

Closed jedahan closed 4 years ago

jedahan commented 4 years ago

What's the problem you want to solved? Merge commits create unnecessary noise and possible confusion in the git history.

Is there a solution you'd like to recommend? For #95 I tried out Rebase & Merge over just the simple Merge. This had a number of effects, all of which I think were positive:

  1. Kept the commit history from the branch
  2. Moved closed to the default C4 branchless dev ideology
  3. Unexpectedly interesting: showed the maintainer name next to the committer name "with jedahan" which felt good by highlighting the collaboration and reinforcing the collaborator-maintainer separation.

This is related to #54 , but I think instead of having that languish on forever, I'd like to branch the discussion here, and make a PR with the change.

Proposed solution: default to rebase & merge, and capture that somewhere, likely contributing.md

christianbundy commented 4 years ago

Thanks for opening this discussion. I'd be comfortable experimenting with this, but my first reaction is hesitance and caution.

Merge commits create unnecessary noise and possible confusion in the git history.

I agree that a branch with merge commits is aesthetically bleh, but I see them like log files where the verbosity and usefulness are correlated. Keeping the real Git history means that we can see what the tree looked like during development, which makes git bisect and such way more useful. I think this page on rebase vs merge sums up the trade-offs, but the biggest red flags for rebases (for me) are:

Pivoting a bit, I think the reason that we're seeing lots of merge commits is that I've enabled one of GitHub's branch protection options:

Require branches to be up to date before merging
This ensures pull requests targeting a matching branch have been tested with the latest code. This setting will not take effect unless at least one status check is enabled (see below).

What happened in #95 is that I clicked 'merge master into this branch' on GitHub, immediately forgot that I'd done that, and then ran git pull origin master on the command-line. I wasn't very considerate about my merge conflicts and didn't think they'd affect anyone, so I just pushed up the entire hairball.

Two other options I'd like to highlight:

Summary of my feelings:

christianbundy commented 4 years ago

Also, I've noticed that you've been developing on your personal fork -- cool! I'll join you. Should I remove my branches on this repo and add branch protection so we can't push anything accidentally?

jedahan commented 4 years ago

Thats a very thoughful reply. My gut feeling is disabling up-to-date before merging is mostly good. I feel like I haven't experienced all the possible development workflows to understand the drawbacks and benefits of each. In some ways, this makes me an ideal instigator because I've got a bit more of a beginners mind.

I think a subtle distinction to be made is the difference between encouraging git rebase vs Github Rebase & Merge button. From what I understand, Github Rebase & Merge is equivalent to "Disabling up-to-date before merging" except the web interface does all the work for you. At least in the case of #95 thats what it felt like to me.

The downsides of signed commits and "is commit X in main?" is real though.

edit: after reading the kernel document, I am now more confused the implications of requiring up-to-date before merging, and the multiple merge strategies.

Whatever decisions are to be made, as long as we think it makes contributing easier, especially for beginners, let's do that. I need to sleep on it or pair with someone to understand it all.

This also makes me wanna try Pijul :)

christianbundy commented 4 years ago

@jedahan How have the past few merges been? Better without all of the superfluous merging, or is this still a pain point for you?

jedahan commented 4 years ago

Its been good, happy to close.