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

Avoid generating review drafts for merge commits. #284

Merged
merged 1 commit into from
Sep 26, 2023

Conversation

dbaron
Copy link
Member

@dbaron dbaron commented Sep 25, 2023

This avoids generating review drafts for merge commits unless the merge commit has modifications to the review draft (which I hope means that it's different from all parents of the merge).

The code prior to this change tries to generate a review draft if the first parent of the merge commit introduces a review draft. (This happens if "git merge main" is done on a feature branch and main has introduced a review draft.)


This came up in the discussion starting in whatwg/html#9400 (comment) .

I'm not aware of a better way to tell git show to skip the header other than --format=format:.

I'm not 100% sure about how this handles all edge cases, but I tested the git command against the basic cases of a regular commit that does or doesn't modify a review draft, and against two variants of merge commit from the above pull (with parents in both orders).

This avoids generating review drafts for merge commits unless the merge
commit has modifications to the review draft (which I believe means that
it's different from *all* parents of the merge).

The code prior to this change tries to generate a review draft if the
first parent of the merge commit introduces a review draft.  (This
happens if "git merge main" is done on a feature branch and main has
introduced a review draft.)
@dbaron
Copy link
Member Author

dbaron commented Sep 26, 2023

This git command appears unchanged since it was introduced in c38c237.

@dbaron
Copy link
Member Author

dbaron commented Sep 26, 2023

(Also, seems like I don't have the power to make a review request in this repository, but I was hoping to request review from @domenic, who has made most of the recent changes to this file.)

Copy link
Contributor

@sideshowbarker sideshowbarker left a comment

Choose a reason for hiding this comment

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

It seems to me that this should work in all cases, but I’ll hold off on merging until Domenic weighs in too

Copy link
Member

@domenic domenic left a comment

Choose a reason for hiding this comment

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

Happy to trust you that this is better. Can you also update https://github.com/whatwg/whatwg.org/blob/main/resources.whatwg.org/build/deploy.sh#L125 so that these stay in sync, per the comment?

@domenic domenic merged commit 54c7524 into whatwg:main Sep 26, 2023
1 check passed
dbaron added a commit to dbaron/whatwg.org that referenced this pull request Sep 26, 2023
This avoids generating review drafts for merge commits unless the merge 
commit has modifications to the review draft (which I hope means that
it's different from all parents of the merge).

The code prior to this change tries to generate a review draft if the 
first parent of the merge commit introduces a review draft. (This
happens if "git merge main" is done on a feature branch and main has
introduced a review draft.)

This matches the change in 
whatwg/html-build#284 .
@dbaron
Copy link
Member Author

dbaron commented Sep 26, 2023

Created whatwg/whatwg.org#424 . (I did see that comment, but I couldn't figure out what it was referring to.)

annevk pushed a commit to whatwg/whatwg.org that referenced this pull request Sep 26, 2023
This avoids generating review drafts for merge commits unless the merge 
commit has modifications to the review draft (which I hope means that
it's different from all parents of the merge).

The code prior to this change tries to generate a review draft if the 
first parent of the merge commit introduces a review draft. (This
happens if "git merge main" is done on a feature branch and main has
introduced a review draft.)

This matches the change in 
whatwg/html-build#284 .
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants