Message ID | 382a009c18efc8a46a9c0210754f2266c3116ee4.1608270687.git.gitgitgadget@gmail.com (mailing list archive) |
---|---|
State | Superseded |
Headers | show |
Series | merge-ort: add more handling of basic conflict types | expand |
On 12/18/2020 12:51 AM, Elijah Newren via GitGitGadget wrote: > + } else if (ci->df_conflict && ci->merged.result.mode != 0) { > die("Not yet implemented."); > } > > /* > * NOTE: Below there is a long switch-like if-elseif-elseif... block > * which the code goes through even for the df_conflict cases > - * above. Well, it will once we don't die-not-implemented above. > + * above. > */ This comment change might be a bit premature. Thanks, -Stolee
On Wed, Dec 30, 2020 at 6:06 AM Derrick Stolee <stolee@gmail.com> wrote: > > On 12/18/2020 12:51 AM, Elijah Newren via GitGitGadget wrote: > > + } else if (ci->df_conflict && ci->merged.result.mode != 0) { > > die("Not yet implemented."); > > } > > > > /* > > * NOTE: Below there is a long switch-like if-elseif-elseif... block > > * which the code goes through even for the df_conflict cases > > - * above. Well, it will once we don't die-not-implemented above. > > + * above. > > */ > > This comment change might be a bit premature. Or perhaps it should have been squashed into an earlier series that was already merged to next.
On 12/30/2020 10:13 AM, Elijah Newren wrote: > On Wed, Dec 30, 2020 at 6:06 AM Derrick Stolee <stolee@gmail.com> wrote: >> >> On 12/18/2020 12:51 AM, Elijah Newren via GitGitGadget wrote: >>> + } else if (ci->df_conflict && ci->merged.result.mode != 0) { >>> die("Not yet implemented."); >>> } >>> >>> /* >>> * NOTE: Below there is a long switch-like if-elseif-elseif... block >>> * which the code goes through even for the df_conflict cases >>> - * above. Well, it will once we don't die-not-implemented above. >>> + * above. >>> */ >> >> This comment change might be a bit premature. > > Or perhaps it should have been squashed into an earlier series that > was already merged to next. I think it works with the next patch, which removes the die() from the if-elseif-elseif from immediately before the comment. -Stolee
On Thu, Dec 31, 2020 at 3:17 AM Derrick Stolee <stolee@gmail.com> wrote: > > On 12/30/2020 10:13 AM, Elijah Newren wrote: > > On Wed, Dec 30, 2020 at 6:06 AM Derrick Stolee <stolee@gmail.com> wrote: > >> > >> On 12/18/2020 12:51 AM, Elijah Newren via GitGitGadget wrote: > >>> + } else if (ci->df_conflict && ci->merged.result.mode != 0) { > >>> die("Not yet implemented."); > >>> } > >>> > >>> /* > >>> * NOTE: Below there is a long switch-like if-elseif-elseif... block > >>> * which the code goes through even for the df_conflict cases > >>> - * above. Well, it will once we don't die-not-implemented above. > >>> + * above. > >>> */ > >> > >> This comment change might be a bit premature. > > > > Or perhaps it should have been squashed into an earlier series that > > was already merged to next. > > I think it works with the next patch, which removes the die() from the > if-elseif-elseif from immediately before the comment. Oh, right, it's been long enough that I forgot the details and then I read the patch backwards thinking it was adding the message. Yeah, it should go with the next patch. I'll fix it up.
diff --git a/merge-ort.c b/merge-ort.c index 414e7b7eeac..f9a79eb25e6 100644 --- a/merge-ort.c +++ b/merge-ort.c @@ -976,14 +976,35 @@ static void process_entry(struct merge_options *opt, assert(ci->df_conflict); } - if (ci->df_conflict) { + if (ci->df_conflict && ci->merged.result.mode == 0) { + int i; + + /* + * directory no longer in the way, but we do have a file we + * need to place here so we need to clean away the "directory + * merges to nothing" result. + */ + ci->df_conflict = 0; + assert(ci->filemask != 0); + ci->merged.clean = 0; + ci->merged.is_null = 0; + /* and we want to zero out any directory-related entries */ + ci->match_mask = (ci->match_mask & ~ci->dirmask); + ci->dirmask = 0; + for (i = MERGE_BASE; i <= MERGE_SIDE2; i++) { + if (ci->filemask & (1 << i)) + continue; + ci->stages[i].mode = 0; + oidcpy(&ci->stages[i].oid, &null_oid); + } + } else if (ci->df_conflict && ci->merged.result.mode != 0) { die("Not yet implemented."); } /* * NOTE: Below there is a long switch-like if-elseif-elseif... block * which the code goes through even for the df_conflict cases - * above. Well, it will once we don't die-not-implemented above. + * above. */ if (ci->match_mask) { ci->merged.clean = 1;