-
Notifications
You must be signed in to change notification settings - Fork 6.6k
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
doc: add note about force pushes to contrib guide #14444
Conversation
Codecov Report
@@ Coverage Diff @@
## master #14444 +/- ##
=========================================
Coverage ? 51.99%
=========================================
Files ? 308
Lines ? 45572
Branches ? 10553
=========================================
Hits ? 23695
Misses ? 17069
Partials ? 4808 Continue to review full report at Codecov.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
see below
to a GitHub PR (with GitHub complaining it can't find those commits). | ||
Instead of viewing changes, you'll need to view the files in GitHub | ||
as they exist after the forced push. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Suggesting this:
While amending commits and force pushing is a common review model outside github and the one recommended by Zephyr, it's not the main model supported by github and causes unexpected behavior such as not being able to use "View Changes" buttons except the last one (with GitHub complaining it can't find older commits) and not always being able to compare the latest reviewed version with the latest submitted version. When rewriting history github guarantees access to the latest version only.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I took your suggested edit but broke up the long sentence...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long sentences? Me? Naaaaahh...
Some references for the record:
Also related:
|
Let folks know that using amend and force pushes for adding review changes is the recommend method for contributing to the project, but it can cause some unexpected behavior from GitHub. Signed-off-by: David B. Kinder <david.b.kinder@intel.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would just like @dbkinder to reply to my suggestions before this gets merged.
@marc-hb I did a few seconds before your last comment :) |
to a GitHub PR (with GitHub complaining it can't find those commits). | ||
Instead of viewing changes, you'll need to view the files in GitHub | ||
as they exist after the forced push. | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Long sentences? Me? Naaaaahh...
Found some other interesting side effects of force pushes:
|
[If you're not interested in github and force pushes please unsubscribe from this PR now. It's merged] A couple real-world examples to make the description of this force push pain less theoretical. zephyrproject-rtos/ci-tools#88
Both examples above are Merge Requests with a single commit. Force pushes with multiple commits add an entire new level of review complexity, try PR #16064. In fact the fixups & squash review model is not compatible with reviewing series of multiple commits because the same commits can not have two completely different purposes https://github.com/git-series/git-series github's preferred review model is "fixup commits & final squash" and no force pushes - by several miles. It's very clear not just from all the above issues caused by force pushes but also in features like "Show changes since your last review" which shows a list of... fixup commits or in how the web editor creates fixup commits - good luck combining these with force pushes. While gitlab supports force pushes better, some of the issues above apply to it too. "fixups & final squash" is also gitlab's preferred review model "Force pushes" is Gerrit's main (single?) code review model (so "forcing" is not even needed). It even colors rebase noise differently: https://bugs.chromium.org/p/gerrit/issues/detail?id=217#c42 UPDATE: github's most common review model is apparently "fixup and NO squash" |
I don't have a definitive proof this new discovery is related to the lack of support for force-pushes, but I strongly suspect it is: the commits tab may list commits in a "random" order. Maybe it sticks to the order of the very first push, never updated later? Thanks @crazoes for the report. UPDATE: it's not "random" but based on the commit date. Amend as a workaround.
|
There is now a Google Summer of Code project idea to add |
Let folks know that using amend and force pushes for adding review
changes is the recommend method for contributing to the project, but it
can cause some unexpected behavior from GitHub.
Signed-off-by: David B. Kinder david.b.kinder@intel.com