)]}'
{"/COMMIT_MSG":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"7d2a888cf6487eee36d7c24ae593e8b1baf3d697","unresolved":true,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"071dc261_6e922789","line":15,"updated":"2023-02-14 21:11:31.000000000","message":"Note, this appears to keep a commit but without changes. If you run `git show HEAD` after this operation you have a commit message with no diff. This is different than the git merge case which simply exits 0 and reports `Already up to date.`\n\nFor many users this might be fine. But if you use git repo state to calculate versioning for example this could be a problem.\n\nA better solution with fewer side effects may be to avoid merging anything in the case of change-merged/ref-updated events and simply checkout the state of the system at that point in time? I haven\u0027t dug in to see what would be involved in doing that, but would avoid problematic side effects in the git tree.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":1,"name":"James E. Blair","email":"jim@acmegating.com","username":"corvus"},"change_message_id":"0329a772c61098c07d2da4b43f5e1d8df9e8d4c7","unresolved":false,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"fa21475c_9b663cf4","line":15,"in_reply_to":"071dc261_6e922789","updated":"2023-02-15 14:00:37.000000000","message":"Here\u0027s an experiment I\u0027d like you to run to collect information to help us decide how to proceed:\n\nPropose a change to gerrit in a cherry-pick repo which is identical to a commit already in the branch.  Does that work?  If so, submit it.   Does that work?   What does the resulting tree look like?\n\nThat\u0027s the behavior we need to mimic, because the pre-merge behavior should match Gerrit exactly.  If we need to alter the behavior for a post-merge change-based pipeline, then we may need to add a pipeline option, or start paying attention to the \u0027merged\u0027 flag on the change.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":35619,"name":"Christian von Schultz","display_name":"Christian von Schultz","email":"christian+u1@embedl.com","username":"von"},"change_message_id":"0533768e925fa37880234cd5b3d3c68606d4e494","unresolved":true,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"93a89ffc_11012ec8","line":15,"in_reply_to":"071dc261_6e922789","updated":"2023-02-15 07:48:54.000000000","message":"OK, so `--keep-redundant-commit` keeps an extra commit that we\u0027re not actually interested in having. I think maybe `--allow-empty` would be the better option then:\n\n\u003e Commits which are made empty due to a previous commit are dropped. To force the inclusion of those commits use --keep-redundant-commits.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":33934,"name":"Joshua Watt","email":"JPEWhacker@gmail.com","username":"jpew"},"change_message_id":"7166775bbc7933fe5bdbfe61d8e56479dfb08741","unresolved":true,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"b4dd755e_b9221c1f","line":15,"in_reply_to":"3a615a66_7f03d97f","updated":"2023-02-15 16:57:23.000000000","message":"`git cherry-pick --allow-empty` is unfortunately insufficient because it only applies to commits that are _initially_ empty (that is, the commit you are cherry-picking from is empty). There is no option to tell git to skip cherry-picking a commit that does nothing; you can either apply the empty commit with `--keep-redundant-commit` or have `git cherry-pick` fail so you can inspect the results.\n\nThe other option would be to use `--keep-redundant-commit` and then manually inspect if the commit is empty after applying and hard reset back if so.\n\n\nOr filter based on the event, but I don\u0027t see any other events doing that sort of thing.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":33934,"name":"Joshua Watt","email":"JPEWhacker@gmail.com","username":"jpew"},"change_message_id":"431dad836a26a0b0ef920920ce5e3669890ea9da","unresolved":false,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"beb314e2_9cee6929","line":15,"in_reply_to":"723a69e6_b0ee7ba4","updated":"2023-02-16 13:53:31.000000000","message":"Patch set 3 will do that; regardless of submit.rejectEmptyCommit I think this is OK, because it models what Gerrit will do if it allows the commit to actually merge, plus fixes the deploy pipeline problem we were having","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":35619,"name":"Christian von Schultz","display_name":"Christian von Schultz","email":"christian+u1@embedl.com","username":"von"},"change_message_id":"269f311f2c4df35c12fb0b2ff64d400ba59c638f","unresolved":false,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"723a69e6_b0ee7ba4","line":15,"in_reply_to":"b4dd755e_b9221c1f","updated":"2023-02-16 08:16:45.000000000","message":"Looks like you\u0027re right about `git cherry-pick --allow-empty`. The man page confused me by talking about \"commits which are made empty due to a previous commit\". Maybe `--keep-redundant-commit` and conditionally checking out the parent is the closest we can get to the Gerrit behavior, at least when `submit.rejectEmptyCommit \u003d False`.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":35619,"name":"Christian von Schultz","display_name":"Christian von Schultz","email":"christian+u1@embedl.com","username":"von"},"change_message_id":"fc63caf154781d24869621c70d6317e4e8d3d0f5","unresolved":true,"context_lines":[{"line_number":12,"context_line":"merges where they will succeed even if they do nothing."},{"line_number":13,"context_line":""},{"line_number":14,"context_line":"To fix this, add the --keep-redundant-commit option to `git cherry-pick`"},{"line_number":15,"context_line":"to make git add commit when cherry-picking, even if it does nothing."},{"line_number":16,"context_line":""},{"line_number":17,"context_line":"This is particularly important in a \"deploy\" pipeline triggered by a"},{"line_number":18,"context_line":"Gerrit \"change-merged\" event, since the scheduler will try to"}],"source_content_type":"text/x-gerrit-commit-message","patch_set":2,"id":"3a615a66_7f03d97f","line":15,"in_reply_to":"fa21475c_9b663cf4","updated":"2023-02-15 15:00:58.000000000","message":"Proposing a change identical to a commit in the branch works (provided it has a unique Change-Id footer in the commit message, so the commit hash _is_ different in my experiment).\n\nAs for submitting, it depends on the `submit.rejectEmptyCommit` project setting in Gerrit. If `submit.rejectEmptyCommit \u003d True`, you get an error when you submit:\n\n\u003e Could not perform action: Failed to submit 1 change due to the following problems:\n\u003e Change 4184: Change could not be merged because the commit is empty. Project policy requires all commits to contain modifications to at least one file.\n\nIf `submit.rejectEmptyCommit \u003d False`, the submit succeeds, and the change is marked as merged by Gerrit, but no extra commit appears in the git log. I believe this matches the `--allow-empty` option to git cherry-pick.\n\nTested on Gerrit 3.6.1.","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"}],"/PATCHSET_LEVEL":[{"author":{"_account_id":33934,"name":"Joshua Watt","email":"JPEWhacker@gmail.com","username":"jpew"},"change_message_id":"65f9854d1d1fbfb451bb259e610fb29bbab83a8b","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":2,"id":"402862ae_1cb4e7f1","updated":"2023-02-14 21:06:12.000000000","message":"recheck","commit_id":"50f8ed3c1a0e1cfd336838550da94a4de5fcc324"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"7e4eab556bc2aacc8ce28764ab19e8b4e1f26577","unresolved":false,"context_lines":[],"source_content_type":"","patch_set":3,"id":"9a159d70_eb95f8a0","updated":"2023-02-17 17:24:01.000000000","message":"Changing my vote as I wasn\u0027t aware of an existing need for empty commits with Zuul. Given that I think the behavior here is not a corner case limitation that can be accepted.","commit_id":"94ef7123d0382d9f7c6ae2d977ddd36205382611"}],"zuul/merger/merger.py":[{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"4b050d5f220a88039b48399262d083e653550beb","unresolved":true,"context_lines":[{"line_number":590,"context_line":"            parent \u003d head.parents[0]"},{"line_number":591,"context_line":"            if not any(head.diff(parent)):"},{"line_number":592,"context_line":"                log.debug(\"%s has no changed files. Removing it\", ref)"},{"line_number":593,"context_line":"                self._checkout(repo, parent)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"        return repo.head.commit"},{"line_number":596,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"1ebedfbc_ef62b8fb","line":593,"updated":"2023-02-17 16:46:10.000000000","message":"Nit looks like we may want to use checkout() to avoid some stale lock file problem? However, the risk of that seems low since we\u0027re switching to HEAD~1.\n\nThinking about this I suppose it is possible for users to intentionally cherry pick a commit that is empty for some reason (version manipulation?). For this reason I\u0027m still not sure this is the best approach. As I mentioned on a previous patchset I think we may need to use the information from the code review system to know if we are merging an intentional empty commit or something that should just be ignored.\n\nThat said I do think this is an improvement over the previous patchset because only those looking for intentional empty commits will be affected instead of every change. I don\u0027t use cherry-pick but this caveat may be worth living withfor now as it should get most use cases of this merge type moving forward in post review pipelines.","commit_id":"94ef7123d0382d9f7c6ae2d977ddd36205382611"},{"author":{"_account_id":4146,"name":"Clark Boylan","email":"cboylan@sapwetik.org","username":"cboylan"},"change_message_id":"10473fccdfad050229a05d034c0f5640a6f62974","unresolved":false,"context_lines":[{"line_number":590,"context_line":"            parent \u003d head.parents[0]"},{"line_number":591,"context_line":"            if not any(head.diff(parent)):"},{"line_number":592,"context_line":"                log.debug(\"%s has no changed files. Removing it\", ref)"},{"line_number":593,"context_line":"                self._checkout(repo, parent)"},{"line_number":594,"context_line":""},{"line_number":595,"context_line":"        return repo.head.commit"},{"line_number":596,"context_line":""}],"source_content_type":"text/x-python","patch_set":3,"id":"7ae62d82_baf925eb","line":593,"in_reply_to":"1ebedfbc_ef62b8fb","updated":"2023-03-01 22:09:22.000000000","message":"Done","commit_id":"94ef7123d0382d9f7c6ae2d977ddd36205382611"}]}
