git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Elijah Newren <newren@gmail.com>
To: git@vger.kernel.org
Cc: Elijah Newren <newren@gmail.com>
Subject: [WIP PATCH 03/10] A bunch of fixes and FIXMEs
Date: Mon, 21 Mar 2011 12:30:57 -0600	[thread overview]
Message-ID: <1300732264-9638-4-git-send-email-newren@gmail.com> (raw)
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

  parent reply	other threads:[~2011-03-21 18:24 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2011-03-21 18:30 [WIP PATCH 00/10] Work-in-progress merge-recursive work Elijah Newren
2011-03-21 18:30 ` [WIP PATCH 01/10] merge-recursive: Remove redundant check for removing rename source Elijah Newren
2011-03-21 18:30 ` [WIP PATCH 02/10] Reminder to fix o->call_depth handling in conflict_rename_rename_1to2 Elijah Newren
2011-03-21 18:30 ` Elijah Newren [this message]
2011-03-21 18:30 ` [WIP PATCH 04/10] Correct a comment Elijah Newren
2011-03-21 18:30 ` [WIP PATCH 05/10] merge-recursive: Fix sorting order and directory change assumptions Elijah Newren
2011-03-21 18:31 ` [WIP PATCH 06/10] Add a comment pointing out a bug Elijah Newren
2011-03-21 18:31 ` [WIP PATCH 07/10] Good testcases Elijah Newren
2011-03-21 18:31 ` [WIP PATCH 08/10] More test scripts Elijah Newren
2011-03-21 18:31 ` [WIP PATCH 09/10] Tests and fixes associated with rename/rename conflicts Elijah Newren
2011-03-21 18:31 ` [WIP PATCH 10/10] Add new testcase (temp14) showing how undetected renames can cause or spuriously avoid merge conflicts 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=1300732264-9638-4-git-send-email-newren@gmail.com \
    --to=newren@gmail.com \
    --cc=git@vger.kernel.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).