{"thread":{"id":"58099","subject":"cherry-pick with --no-rerere-autoupdate does still rerere?","startedAt":"2022-07-02T07:37:25Z","lastAt":"2022-07-12T14:25:27Z","messageCount":5,"participants":["Matthias Beyer","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"458428","messageId":"1656746869.11nc2qu6dn.astroid@takeshi.none","threadId":"58099","inReplyTo":null,"subject":"cherry-pick with --no-rerere-autoupdate does still rerere?","fromName":"Matthias Beyer","fromEmail":"mail@beyermatthias.de","sentAt":"2022-07-02T07:30:18Z","receivedAt":"2022-07-02T07:37:25Z","isPatch":false,"sender":{"key":"mail@beyermatthias.de","avatar":null},"body":"Hi,\n\nI just experienced a `git cherry-pick <commit> --no-rerere-autoupdate` where the\nconflict still got automatically resolved from rerere.\n\nIs this a known bug, or am I doing something wrong?\n\n    $ git cherry-pick 61c16c9 --no-rerere-autoupdate\n    Auto-merging crates/common/tedge_utils/src/file.rs\n    CONFLICT (content): Merge conflict in crates/common/tedge_utils/src/file.rs\n    error: could not apply 61c16c9cd... Fix (style): Do not use dedicated statement for return value\n    hint: After resolving the conflicts, mark them with\n    hint: \"git add/rm <pathspec>\", then run\n    hint: \"git cherry-pick --continue\".\n    hint: You can instead skip this commit with \"git cherry-pick --skip\".\n    hint: To abort and get back to the state before \"git cherry-pick\",\n    hint: run \"git cherry-pick --abort\".\n    Resolved 'crates/common/tedge_utils/src/file.rs' using previous resolution.\n\nUsing\n\n    $ git --version\n    git version 2.36.0\n\nBest,\nMatthias\n\n-- \nMit freundlichen Grüßen,\nKind regards,\nMatthias Beyer\n"},{"id":"458429","messageId":"xmqqwncv49qm.fsf@gitster.g","threadId":"58099","inReplyTo":"1656746869.11nc2qu6dn.astroid@takeshi.none","subject":"Re: cherry-pick with --no-rerere-autoupdate does still rerere?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-02T19:04:17Z","receivedAt":"2022-07-02T19:04:28Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Beyer <mail@beyermatthias.de> writes:\n\n> I just experienced a `git cherry-pick <commit> --no-rerere-autoupdate` where the\n> conflict still got automatically resolved from rerere.\n\nIf I am not mistaken, this is totally expected.  You told the\ncommand \"use rerere but do not blindly accept the replayed\nresolution into the index\".\n\nWhen you run \"cherry-pick\" there are three possible outcomes:\n\n * The change <commit> wanted to make cleanly replays on top of\n   HEAD.  Unless --no-commit is given, we update the index and the\n   working tree, make a commit, and advance HEAD to point at the new\n   commit.\n\n * The change does not cleanly replay, and you either do not have an\n   earlier resolution recorded in the rerere database, or you tell\n   rerere not to kick in by setting the rerere.enabled configuration\n   variable to 'false'.  In this case, the working tree files would\n   have conflict markers in them and the index would have higher\n   stages for these conflicted paths to record the original, our,\n   and their versions.\n\n * The change does not cleanly replay, but your rerere database\n   knows a resolution you accepted already that applies cleanly, and\n   you allow rerere to kick in by the rerere.enabled configuration\n   variable.  This will update the working tree files by replaying\n   the recorded resolution, but leaves the index conflicted, so that\n   you can inspect the auto-resolution with \"git diff --cc\".\n\n   If rerere is allowed to update the index with the result of its\n   operation (either by the rerere.autoupdate configuration or the\n   --rerere-autoupdate command line option), it also adds the result\n   to the index (\"git diff --cc\" would no longer work as a way to\n   view how the conflict was resolved).\n\nI think the default these days is to allow rerere to replay the\nresolution to the working tree files, but not allow the index to be\nauto-updated.  This allows people to be lazy but still be careful\nbefore (re)committing to accept the previous resolution to the\nindex.\n\nThe above is not limited to \"git cherry-pick\", but applies also to\nany mergy operation like \"git merge\", \"git revert\", and \"git am -3\".\n\nA bonus protip.  Always write dashed options to a subcommand (like\n\"cherry-pick\") before non-option argument, i.e.\n\n\tgit cherry-pick --[no-]rerere-autoupdate <commit>\n\nSome subcommands may be lenient and take arguments given in a wrong\norder when they are not ambiguous, but it is a good discipline to\nfollow.\n"},{"id":"458431","messageId":"1656831907.rjf3s99jhj.astroid@takeshi.none","threadId":"58099","inReplyTo":"xmqqwncv49qm.fsf@gitster.g","subject":"Re: cherry-pick with --no-rerere-autoupdate does still rerere?","fromName":"Matthias Beyer","fromEmail":"mail@beyermatthias.de","sentAt":"2022-07-03T07:08:01Z","receivedAt":"2022-07-03T07:12:27Z","isPatch":false,"sender":{"key":"mail@beyermatthias.de","avatar":null},"body":"Excerpts from Junio C Hamano's message of Juli 2, 2022 9:04 pm:\n> Matthias Beyer <mail@beyermatthias.de> writes:\n> \n>> I just experienced a `git cherry-pick <commit> --no-rerere-autoupdate` where the\n>> conflict still got automatically resolved from rerere.\n> \n> If I am not mistaken, this is totally expected.  You told the\n> command \"use rerere but do not blindly accept the replayed\n> resolution into the index\".\n\nAh! After over 10 years of using git, I still missed that (\"update the index\" in\nthe manpage). I was thinking about \"cherry pick this, but don't use rerere at\nall\".\n\nThanks for clearing up my confusion!\nMatthias\n\n\n-- \nMit freundlichen Grüßen,\nKind regards,\nMatthias Beyer\n"},{"id":"458487","messageId":"xmqq4jzvla9x.fsf@gitster.g","threadId":"58099","inReplyTo":"1656831907.rjf3s99jhj.astroid@takeshi.none","subject":"Re: cherry-pick with --no-rerere-autoupdate does still rerere?","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2022-07-05T17:49:46Z","receivedAt":"2022-07-05T17:49:56Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Matthias Beyer <mail@beyermatthias.de> writes:\n\n> Excerpts from Junio C Hamano's message of Juli 2, 2022 9:04 pm:\n>> Matthias Beyer <mail@beyermatthias.de> writes:\n>> \n>>> I just experienced a `git cherry-pick <commit> --no-rerere-autoupdate` where the\n>>> conflict still got automatically resolved from rerere.\n>> \n>> If I am not mistaken, this is totally expected.  You told the\n>> command \"use rerere but do not blindly accept the replayed\n>> resolution into the index\".\n>\n> Ah! After over 10 years of using git, I still missed that (\"update the index\" in\n> the manpage). I was thinking about \"cherry pick this, but don't use rerere at\n> all\".\n>\n> Thanks for clearing up my confusion!\n\nIt is highly appreciated that you gave us an opportunity to\nimproving the documentation (or possibly something else) to avoid\ngetting other users into a similar misunderstanding.\n\nA discussion, proposal, or a patch to improve docs and helps is\ncertainly welcome.\n"},{"id":"458906","messageId":"20220712140450.1288726-1-mail@beyermatthias.de","threadId":"58099","inReplyTo":"xmqq4jzvla9x.fsf@gitster.g","subject":"[PATCH] Add note that conflict resolution is still performed","fromName":"Matthias Beyer","fromEmail":"mail@beyermatthias.de","sentAt":"2022-07-12T14:04:50Z","receivedAt":"2022-07-12T14:25:27Z","isPatch":true,"sender":{"key":"mail@beyermatthias.de","avatar":null},"body":"We should note that conflict resolution is still performed, even if\n`--no-rerere-autoupdate` is specified, to make sure users do not get\nconfused by the setting and assume this disables rerere conflict\nresultion all together.\n\nCC: Phillip Wood <phillip.wood@dunelm.org.uk>\nCC: Junio C Hamano <gitster@pobox.com>\nSigned-off-by: Matthias Beyer <mail@beyermatthias.de>\n---\n Documentation/git-cherry-pick.txt | 2 ++\n 1 file changed, 2 insertions(+)\n\ndiff --git a/Documentation/git-cherry-pick.txt b/Documentation/git-cherry-pick.txt\nindex 78dcc9171f..730a4590af 100644\n--- a/Documentation/git-cherry-pick.txt\n+++ b/Documentation/git-cherry-pick.txt\n@@ -160,6 +160,8 @@ effect to your index in a row.\n --no-rerere-autoupdate::\n \tAllow the rerere mechanism to update the index with the\n \tresult of auto-conflict resolution if possible.\n+\tIf `--no-rerere-autoupdate` is specified, the conflict resolution is\n+\tstill performed, but the index is not updated.\n \n SEQUENCER SUBCOMMANDS\n ---------------------\n-- \n2.36.0\n\n"}]}