merge-recursive: add explanation for src_entry and dst_entry

If I have to walk through the debugger and inspect the values found in here in order to figure out their meaning, despite having known these things inside and out some years back, then they probably need a comment for the casual reader to explain their purpose. Reviewed-By: Stefan Beller <sbeller@google.com> Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Elijah Newren committed Jan 5, 2018 at 12:20 UTC 379fc3786611f677b76400f6f7d0ed0faf2a9739
1 file changed +19
merge-recursive.c
+19
@@ -513,6 +513,25 @@ static void record_df_conflict_files(struct merge_options *o,
513
514 struct rename {
515 struct diff_filepair *pair;
516 + /*
517 + * Purpose of src_entry and dst_entry:
518 + *
519 + * If 'before' is renamed to 'after' then src_entry will contain
520 + * the versions of 'before' from the merge_base, HEAD, and MERGE in
521 + * stages 1, 2, and 3; dst_entry will contain the respective
522 + * versions of 'after' in corresponding locations. Thus, we have a
523 + * total of six modes and oids, though some will be null. (Stage 0
524 + * is ignored; we're interested in handling conflicts.)
525 + *
526 + * Since we don't turn on break-rewrites by default, neither
527 + * src_entry nor dst_entry can have all three of their stages have
528 + * non-null oids, meaning at most four of the six will be non-null.
529 + * Also, since this is a rename, both src_entry and dst_entry will
530 + * have at least one non-null oid, meaning at least two will be
531 + * non-null. Of the six oids, a typical rename will have three be
532 + * non-null. Only two implies a rename/delete, and four implies a
533 + * rename/add.
534 + */
535 struct stage_data *src_entry;
536 struct stage_data *dst_entry;
537 unsigned processed:1;