Skip to content
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

Allow rebase strategy #7689

Merged
merged 3 commits into from
Aug 10, 2021
Merged

Allow rebase strategy #7689

merged 3 commits into from
Aug 10, 2021

Conversation

Ryuno-Ki
Copy link
Collaborator

@Ryuno-Ki Ryuno-Ki commented Aug 7, 2021

Issue number that this PR fixes (if any). For example: 'Fixes #987654321'

As discussed in https://github.com/mdn/content/discussions/6480 rebase should not be forbidden outright any more.
However, a warning is still apt.

What was wrong/why is this fix needed? (quick summary only)

Looking at actual behaviour, sometimes a PR branch was updated by rebasing main instead of merging it.
If this becomes acceptable behaviour, we should reflect that in our documentation.

Anything else that could help us review it

I'd like to have the discussion of the general direction in https://github.com/mdn/content/discussions/6480 and use this PR for forging the wording.

@Ryuno-Ki Ryuno-Ki requested a review from escattone August 7, 2021 13:29
@Ryuno-Ki Ryuno-Ki requested a review from a team as a code owner August 7, 2021 13:29
@Ryuno-Ki Ryuno-Ki requested review from a team and Rumyra and removed request for a team August 7, 2021 13:29
@Rumyra
Copy link
Collaborator

Rumyra commented Aug 8, 2021

Thanks so much @Ryuno-Ki 🙏 Rebase is the one thing that everyone likes to make confusing 😆

I've got one nit and will also let @escattone take a quick look 👍

README.md Outdated Show resolved Hide resolved
README.md Outdated
1. An alternative strategy is `git rebase` of `main` on your branch.
This will rewrite the git history and might confuse reviewers as notifications
from GitHub leed to nowhere. Your changes are replayed on top of the current
main branch at that point in time. Any additional changes should be made as
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I much prefer rebasing. As a reviewer it is rare to get lost in the historical rewrite, and rebase it creates a much better story for git archeologists.

Anyway, this is perhaps simpler?

While merging with the main branch using git pull is recommended (because it provides a more consistent git history), rebasing your changes using git rebase is also permitted.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my experience, the merge strategy insofar, as it does provide an easier mental model.
For git bisect it's more challenging, since you will have commits with multiple parents.

My intention is to express, that rebase is „okay if you know what you're doing”.
I also noticed some stripped GPG verifications in my personal experience. That could also go into this PR.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm not sure what you've said actually captures "OK if you know what you're doing" because even if you know what you're doing you'll still have the highlighted issue (notifications leading nowhere). I prefer my text because it captures "rebase is allowed but merge is currently preferred".

Further, the "Any additional changes should be made as commits" jarred a bit. Either approach requires changes be made as commit - unless the point is to suggest don't do squash rebase (which is something I often do, and like).

It is completely up to you though - much easier to criticize than come up with text in the first place :-)

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fair point.
It's quite difficult to me to come up with a good phrasing (in a language that is not my first one) that „sounds good”.
Hence, I'm thankful for all the feedback you provide Hamish.

I will think more about how to put „rebase is allowed but merge is currently preferred” in elegant words.
Meanwhile: would the current state be good to go? Or shall I drop the „Any additional changes should be made as commits” part? (jarred is a word I would need to look up to remember its meaning, but I can understand the sense of it).

Squashing is a whole different subject. I only do it once I'm confident to not have to revert a commit.
But I feel, it would go to deep into git advanced knowledge at this point.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is hard to find exactly the right words. I've removed the "Any additional ..." bit and merged. Thank you!

Rumyra
Rumyra previously requested changes Aug 9, 2021
README.md Outdated Show resolved Hide resolved
@Ryuno-Ki
Copy link
Collaborator Author

@Rumyra Given #7689 (comment) is there any other changes I definitively need to make from your point of view?

@hamishwillee hamishwillee dismissed Rumyra’s stale review August 10, 2021 22:24

Has been addressed

@hamishwillee hamishwillee merged commit 775541d into main Aug 10, 2021
@hamishwillee hamishwillee deleted the rebase-strategy branch August 10, 2021 22:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants