{"thread":{"id":"48782","subject":"git rerere and diff3","startedAt":"2018-06-26T13:25:44Z","lastAt":"2018-06-26T19:37:26Z","messageCount":3,"participants":["Nicolas Dechesne","Junio C Hamano"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"350968","messageId":"CAP71WjzHffLRCDbjvF7qpexjXDMFcJkaPpEn=AtbSMCJd6QkBQ@mail.gmail.com","threadId":"48782","inReplyTo":null,"subject":"git rerere and diff3","fromName":"Nicolas Dechesne","fromEmail":"nicolas.dechesne@linaro.org","sentAt":"2018-06-26T13:25:28Z","receivedAt":"2018-06-26T13:25:44Z","isPatch":false,"sender":{"key":"nicolas.dechesne@linaro.org","avatar":null},"body":"hi there,\n\ni have noticed that merge.conflictstyle has an impact on the rerere\nresolution. looking briefly at the source code, it seems that git\ntries to discard the common ancestor diff3 bits, but what I am seeing\nis that if i do the following then it fails:\n\n1. from a clean rr-cache state, with merge.conflictsytle=diff3, git\nmerge <branch with conflict>, resolve the conflicts, then commit\n2. undo the previous merge, remove merge.conflictstyle=diff3 (disable\ndiff3) and merge the *same* branch, then rerere won't fix the\nconflicts\n\nIs that the expected behavior? I am not familiar with git code, but\nbrowsing rerere.c makes me think that it should have worked..\n\nOf course, if I merge the same branch without modifying\nmerge.conflictstyle, then the merge conflicts are properly resolved by\nrerere.\n\nthanks!\n"},{"id":"350993","messageId":"xmqq1sctl676.fsf@gitster-ct.c.googlers.com","threadId":"48782","inReplyTo":"CAP71WjzHffLRCDbjvF7qpexjXDMFcJkaPpEn=AtbSMCJd6QkBQ@mail.gmail.com","subject":"Re: git rerere and diff3","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2018-06-26T19:05:01Z","receivedAt":"2018-06-26T19:05:06Z","isPatch":false,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Nicolas Dechesne <nicolas.dechesne@linaro.org> writes:\n\n> i have noticed that merge.conflictstyle has an impact on the rerere\n> resolution. looking briefly at the source code, it seems that git\n> tries to discard the common ancestor diff3 bits, but what I am seeing\n> is that if i do the following then it fails:\n>\n> 1. from a clean rr-cache state, with merge.conflictsytle=diff3, git\n> merge <branch with conflict>, resolve the conflicts, then commit\n> 2. undo the previous merge, remove merge.conflictstyle=diff3 (disable\n> diff3) and merge the *same* branch, then rerere won't fix the\n> conflicts\n\nIt is possible that the conflict left when making the same merge are\nactually different when using these two conflict styles.  IOW, if\nthe merge produces\n\n\t<<<\n\tside A\n\t|||\n\tcommon\n\t===\n\tside B\n\t>>>\n\nwhen diff3 style is chosen, but if the same merge results in\n\n\t<<<\n\tside A'\n\t===\n\tside B'\n\t>>>\n\nwhere side A' is not identical to side A (or B' and B are not\nidentical), then we will fail to find the previously recorded\nresolution.\n\n"},{"id":"350997","messageId":"CAP71Wjxxx=mNFUAOn331vjqqf77mkBgU_hE+SKoTuszx6MMjvg@mail.gmail.com","threadId":"48782","inReplyTo":"xmqq1sctl676.fsf@gitster-ct.c.googlers.com","subject":"Re: git rerere and diff3","fromName":"Nicolas Dechesne","fromEmail":"nicolas.dechesne@linaro.org","sentAt":"2018-06-26T19:37:10Z","receivedAt":"2018-06-26T19:37:26Z","isPatch":false,"sender":{"key":"nicolas.dechesne@linaro.org","avatar":null},"body":"On Tue, Jun 26, 2018 at 9:05 PM Junio C Hamano <gitster@pobox.com> wrote:\n>\n> Nicolas Dechesne <nicolas.dechesne@linaro.org> writes:\n>\n> > i have noticed that merge.conflictstyle has an impact on the rerere\n> > resolution. looking briefly at the source code, it seems that git\n> > tries to discard the common ancestor diff3 bits, but what I am seeing\n> > is that if i do the following then it fails:\n> >\n> > 1. from a clean rr-cache state, with merge.conflictsytle=diff3, git\n> > merge <branch with conflict>, resolve the conflicts, then commit\n> > 2. undo the previous merge, remove merge.conflictstyle=diff3 (disable\n> > diff3) and merge the *same* branch, then rerere won't fix the\n> > conflicts\n>\n> It is possible that the conflict left when making the same merge are\n> actually different when using these two conflict styles.  IOW, if\n> the merge produces\n>\n>         <<<\n>         side A\n>         |||\n>         common\n>         ===\n>         side B\n>         >>>\n>\n> when diff3 style is chosen, but if the same merge results in\n>\n>         <<<\n>         side A'\n>         ===\n>         side B'\n>         >>>\n>\n> where side A' is not identical to side A (or B' and B are not\n> identical), then we will fail to find the previously recorded\n> resolution.\n\nwell, you're rigth.. that's what's happening...\n\n=== with conflictstyle=merge\ndiff --cc arch/arm64/configs/defconfig\nindex 3cfa8ca26738,d53a1b00ad82..000000000000\n--- a/arch/arm64/configs/defconfig\n+++ b/arch/arm64/configs/defconfig\n@@@ -356,7 -334,7 +357,11 @@@ CONFIG_GPIO_PCA953X=\n  CONFIG_GPIO_PCA953X_IRQ=y\n  CONFIG_GPIO_MAX77620=y\n  CONFIG_POWER_AVS=y\n++<<<<<<< HEAD\n +CONFIG_ROCKCHIP_IODOMAIN=y\n++=======\n+ CONFIG_QCOM_CPR=y\n++>>>>>>> tracking-qcomlt-8016-dvfs\n  CONFIG_POWER_RESET_MSM=y\n  CONFIG_POWER_RESET_XGENE=y\n  CONFIG_POWER_RESET_SYSCON=y\n\n=== with conflictstyle=diff3\ndiff --cc arch/arm64/configs/defconfig\nindex 3cfa8ca26738,d53a1b00ad82..000000000000\n--- a/arch/arm64/configs/defconfig\n+++ b/arch/arm64/configs/defconfig\n@@@ -355,8 -333,8 +356,14 @@@ CONFIG_GPIO_XGENE_SB=\n  CONFIG_GPIO_PCA953X=y\n  CONFIG_GPIO_PCA953X_IRQ=y\n  CONFIG_GPIO_MAX77620=y\n++<<<<<<< HEAD\n +CONFIG_POWER_AVS=y\n +CONFIG_ROCKCHIP_IODOMAIN=y\n++||||||| merged common ancestors\n++=======\n+ CONFIG_POWER_AVS=y\n+ CONFIG_QCOM_CPR=y\n++>>>>>>> tracking-qcomlt-8016-dvfs\n  CONFIG_POWER_RESET_MSM=y\n  CONFIG_POWER_RESET_XGENE=y\n  CONFIG_POWER_RESET_SYSCON=y\n\nthat explains it.. it was simpler than what I thought..\n\nthanks!\n"}]}