git/list[1] front-page[2] threads[3] people[4] search[5] about
 

[WIP PATCH 03/10] A bunch of fixes and FIXMEs

From
Elijah Newren <newren@gmail.com>
Date
Mar 21, 2011, 18:30 UTC
Message-ID
<1300732264-9638-4-git-send-email-newren@gmail.com>
In-Reply-To
<1300732264-9638-1-git-send-email-newren@gmail.com>
---
 merge-recursive.c |   16 ++++++++++++----
 1 files changed, 12 insertions(+), 4 deletions(-)
diff --git a/merge-recursive.c b/merge-recursive.c
index 8d28a54..fde9f9e 100644
--- a/merge-recursive.c
+++ b/merge-recursive.c
@@ -910,7 +910,8 @@ static void conflict_rename_rename_1to2(struct merge_options *o,
 	if (o->call_depth) {
 		/*
 		 * FIXME: This is bogus.  dst_nameX are not in cache in
-		 * case of D/F conflict.
+		 * case of D/F conflict.  renX_dst are.  Simple typo, or
+		 * something worse?
 		 */
 		remove_file_from_cache(dst_name1);
 		remove_file_from_cache(dst_name2);
@@ -1290,10 +1291,12 @@ static int merge_content(struct merge_options *o,
 		const char *new_path;
 		update_file_flags(o, mfi.sha, mfi.mode, path,
 				  o->call_depth || mfi.clean, 0);
-		new_path = unique_path(o, path, df_rename_conflict_branch);
 		mfi.clean = 0;
-		output(o, 1, "Adding as %s instead", new_path);
-		update_file_flags(o, mfi.sha, mfi.mode, new_path, 0, 1);
+		if (!o->call_depth) {
+			new_path = unique_path(o, path, df_rename_conflict_branch);
+			output(o, 1, "Adding as %s instead", new_path);
+			update_file(o, mfi.clean, mfi.sha, mfi.mode, new_path);
+		}
 	} else {
 		update_file(o, mfi.clean, mfi.sha, mfi.mode, path);
 	}
@@ -1433,6 +1436,11 @@ static int process_df_entry(struct merge_options *o,
 			       src, conflict_info->pair2->two->path, conflict_info->branch2,
 			       o->call_depth ? " (left unresolved)" : "");
 			if (o->call_depth) {
+				/*
+				 * FIXME: Why remove file from cache, and
+				 * then immediately readd it?  Why not just
+				 * overwrite using update_file only?
+				 */
 				remove_file_from_cache(src);
 				update_file(o, 0, conflict_info->pair1->one->sha1,
 					    conflict_info->pair1->one->mode, src);
-- 
1.7.4
Previous: Elijah NewrenNext: Elijah Newren
Message 4 of 11 in “Work-in-progress merge-recursive work”
  1. 00/10 Work-in-progress merge-recursive workElijah Newren, Mar 21, 2011
  2. 01/10 merge-recursive: Remove redundant check for removing rename sourceElijah Newren, Mar 21, 2011
  3. 02/10 Reminder to fix o->call_depth handling in conflict_rename_rename_1to2Elijah Newren, Mar 21, 2011
  4. 03/10 A bunch of fixes and FIXMEsElijah Newren, Mar 21, 2011
  5. 04/10 Correct a commentElijah Newren, Mar 21, 2011
  6. 05/10 merge-recursive: Fix sorting order and directory change assumptionsElijah Newren, Mar 21, 2011
  7. 06/10 Add a comment pointing out a bugElijah Newren, Mar 21, 2011
  8. 07/10 Good testcasesElijah Newren, Mar 21, 2011
  9. 08/10 More test scriptsElijah Newren, Mar 21, 2011
  10. 09/10 Tests and fixes associated with rename/rename conflictsElijah Newren, Mar 21, 2011
  11. 10/10 Add new testcase (temp14) showing how undetected renames can cause or spuriously avoid merge conflictsElijah Newren, Mar 21, 2011

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.