All of lore.kernel.org
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: git@vger.kernel.org
Cc: gitster@pobox.com, Elijah Newren <newren@gmail.com>
Subject: [PATCH 01/17] merge-ort: add new data structures for directory rename detection
Date: Mon,  4 Jan 2021 15:49:50 -0800	[thread overview]
Message-ID: <20210104235006.2867404-2-newren@gmail.com> (raw)
In-Reply-To: <20210104235006.2867404-1-newren@gmail.com>

Signed-off-by: Elijah Newren <newren@gmail.com>
---
 merge-ort.c | 34 +++++++++++++++++++++++++++++++---
 1 file changed, 31 insertions(+), 3 deletions(-)

diff --git a/merge-ort.c b/merge-ort.c
index 6900ab9e7f..719cc1c582 100644
--- a/merge-ort.c
+++ b/merge-ort.c
@@ -52,14 +52,42 @@ enum merge_side {
 };
 
 struct rename_info {
+	/*
+	 * All variables that are arrays of size 3 correspond to data tracked
+	 * for the sides in enum merge_side.  Index 0 is almost always unused
+	 * because we often only need to track information for MERGE_SIDE1 and
+	 * MERGE_SIDE2 (MERGE_BASE can't have rename information since renames
+	 * are determined relative to what changed since the MERGE_BASE).
+	 */
+
 	/*
 	 * pairs: pairing of filenames from diffcore_rename()
-	 *
-	 * Index 1 and 2 correspond to sides 1 & 2 as used in
-	 * conflict_info.stages.  Index 0 unused.
 	 */
 	struct diff_queue_struct pairs[3];
 
+	/*
+	 * dirs_removed: directories removed on a given side of history.
+	 */
+	struct strset dirs_removed[3];
+
+	/*
+	 * dir_rename_count: tracking where parts of a directory were renamed to
+	 *
+	 * When files in a directory are renamed, they may not all go to the
+	 * same location.  Each strmap here tracks:
+	 *      old_dir => {new_dir => int}
+	 * That is, dir_rename_count[side] is a strmap to a strintmap.
+	 */
+	struct strmap dir_rename_count[3];
+
+	/*
+	 * dir_renames: computed directory renames
+	 *
+	 * This is a map of old_dir => new_dir and is derived in part from
+	 * dir_rename_count.
+	 */
+	struct strmap dir_renames[3];
+
 	/*
 	 * needed_limit: value needed for inexact rename detection to run
 	 *
-- 
2.29.1.106.g3ff750dc32.dirty


  reply	other threads:[~2021-01-04 23:51 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-01-04 23:49 [PATCH 00/17] Add directory rename detection to merge-ort Elijah Newren
2021-01-04 23:49 ` Elijah Newren [this message]
2021-01-04 23:49 ` [PATCH 02/17] merge-ort: initialize and free new directory rename data structures Elijah Newren
2021-01-04 23:49 ` [PATCH 03/17] merge-ort: collect which directories are removed in dirs_removed Elijah Newren
2021-01-04 23:49 ` [PATCH 04/17] merge-ort: add outline for computing directory renames Elijah Newren
2021-01-04 23:49 ` [PATCH 05/17] merge-ort: add outline of get_provisional_directory_renames() Elijah Newren
2021-01-04 23:49 ` [PATCH 06/17] merge-ort: copy get_renamed_dir_portion() from merge-recursive.c Elijah Newren
2021-01-04 23:49 ` [PATCH 07/17] merge-ort: implement compute_rename_counts() Elijah Newren
2021-01-04 23:49 ` [PATCH 08/17] merge-ort: implement handle_directory_level_conflicts() Elijah Newren
2021-01-04 23:49 ` [PATCH 09/17] merge-ort: modify collect_renames() for directory rename handling Elijah Newren
2021-01-04 23:49 ` [PATCH 10/17] merge-ort: implement compute_collisions() Elijah Newren
2021-01-04 23:50 ` [PATCH 11/17] merge-ort: implement apply_dir_rename() and check_dir_renamed() Elijah Newren
2021-01-04 23:50 ` [PATCH 12/17] merge-ort: implement check_for_directory_rename() Elijah Newren
2021-01-04 23:50 ` [PATCH 13/17] merge-ort: implement handle_path_level_conflicts() Elijah Newren
2021-01-04 23:50 ` [PATCH 14/17] merge-ort: add a new toplevel_dir field Elijah Newren
2021-01-04 23:50 ` [PATCH 15/17] merge-ort: implement apply_directory_rename_modifications() Elijah Newren
2021-01-04 23:50 ` [PATCH 16/17] merge-ort: process_renames() now needs more defensiveness Elijah Newren
2021-01-04 23:50 ` [PATCH 17/17] merge-ort: fix a directory rename detection bug Elijah Newren

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20210104235006.2867404-2-newren@gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    --cc=gitster@pobox.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.