-
Notifications
You must be signed in to change notification settings - Fork 26.5k
docs: add info about working with fixup commits #39110
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
Conversation
Using fixup commits when addressing review feedback can considerably improve the review experience on subsequent reviews. This commit adds information and guidelines for contributors on how to work with fixup commits. Fixes angular#33042
e6fae8f
to
f36f4d7
Compare
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.
Nice bit of work @gkalpak - you are getting ahead of the fixit coming up a the end of the month!
I wonder if there is room in this PR for discussion of whether the PR author should reorder fixup commits manually to ensure that they can be squashed without conflicts or whether they should leave them at the end of the PR commit list to make it more clear to reviewers what has changed.
I think we could also have a discussion about squashing fixup commits from previous rounds of review so that the only fixup commits in a PR are the ones that have not been approved yet?
docs/FIXUP_COMMITS.md
Outdated
See the [`git` docs](https://git-scm.com/docs/git-rebase#Documentation/git-rebase.txt---autosquash) for more details. | ||
|
||
|
||
### Configuring `git` to auto-squash by default |
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 not recommend setting this default. When working with PRs I often rebase interactively but do not want to autosquash. For example, if a PR was built on top of another one, and you want to remove those commits when the upstream PR has been merged to master. Or when re-wording commit messages in a PR after a review finds typos.
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 am not recommeding it, but I wanted to have it mentioned.
(FWIW, I do have this set to true 🤷♂️)
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.
Are you saying it would be better to remove this section or word it differently (how?) to make it not sound as if we are recommending it?
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.
Definitely not remove it, but make it a bit less prominent so that it doesn't sound like a recommendation/requirement.
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.
Done.
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.
Nice fixup commit @gkalpak :-D
I originally had an "Advanced tips" section discussing these things, but I ended up removing it.
That said, I am all for discussing this, standardizing the process and enhacing the docs 🚀 |
I think a discussion to be had during the next fixit! |
* Make the required updates. | ||
* Re-run the Angular test suites to ensure tests are still passing. | ||
* Rebase your branch and force push to your GitHub repository (this will update your Pull Request): | ||
#### Addressing review feedback |
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.
That's a great section, thanks for adding this @gkalpak 👍
Another very common thing that we can include into this section (in the future PRs) is how to change commit message (git commit --amend
) as it's often time needed as a result of the lint
CI failure and/or reviewer comment.
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.
Sure! There is already a note below with instructions on how to amend commits (for the purpose of updating the commit message):
Fixup commits (as shown above) are preferred when addressing review feedback, but in some cases you may need to amend the original commit instead of creating a fixup commit (for example, if you want to update the commit message).
To amend the last commit and update the Pull Request:git commit --all --amend git push --force-with-lease
Are you suggesting expanding on that (or maybe making it its own section (with a sub-heading, etc.))?
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.
Yeah, I was thinking if we can make it a separate sub-section, so that we can refer to it (and provide a link to PR authors when needed). This is a very common thing that we request the commit message to be updated (especially common for docs-related commits) when other changes are ok.
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.
For reference: #39215
…UTING.md` A common review request is updating the commit message of a commit. Since this is something that is not straight forward for inexperienced contributors, it is useful to be able to point a contributor to some docs outlining the process. This commit adds such a section in `CONTRIBUTING.md` (as discussed in angular#39110 (comment)).
…UTING.md` (#39215) A common review request is updating the commit message of a commit. Since this is something that is not straight forward for inexperienced contributors, it is useful to be able to point a contributor to some docs outlining the process. This commit adds such a section in `CONTRIBUTING.md` (as discussed in #39110 (comment)). PR Close #39215
…UTING.md` (#39215) A common review request is updating the commit message of a commit. Since this is something that is not straight forward for inexperienced contributors, it is useful to be able to point a contributor to some docs outlining the process. This commit adds such a section in `CONTRIBUTING.md` (as discussed in #39110 (comment)). PR Close #39215
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Using fixup commits when addressing review feedback can considerably improve the review experience on subsequent reviews.
This commit adds information and guidelines for contributors on how to work with fixup commits.
Fixes #33042.