Skip to contentSkip to conversation

git-gui: Do not automatically stage file after merge tool finishes

PATCH In review Johannes Sixt 2 participants 2 messages Jun 15, 2016 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 git-gui: Do not automatically stage file after merge tool finishes

From: Johannes Sixt <[email protected]>

If a merge tool was invoked on a conflicted file and the tool completed, then the conflicted file was staged automatically. However, the fact that the user closed the merge tool cannot be understood as the unequivocal sign that the conflict was completely resolved. For example, the user could have decided to postpone the resolution of the conflict, or could have accidentally closed the tool. We better leave the file unstaged and let the user stage it explicitly.

Since the file is not staged anyway, the check for an unmodified timestamp is pointless and removed.

---
I had sent this patch last week (but marked as RFC). Here it is again without 'RFC' because I think it is a necessary change.

-- Hannes

 lib/mergetool.tcl |   10 +---------
 1 files changed, 1 insertions(+), 9 deletions(-)
lib/mergetool.tcl +1 -9
index 6ab5701..8d1ee5b 100644
@@ -375,14 +375,6 @@ proc merge_tool_finish {fd} {
 		}
 	}
 
-	# Check the modification time of the target file
-	if {!$failed && [file mtime $mtool_target] eq $mtool_mtime} {
-		if {[ask_popup [mc "File %s unchanged, still accept as resolved?" \
-				[short_path $mtool_target]]] ne {yes}} {
-			set failed 1
-		}
-	}
-
 	# Finish
 	if {$failed} {
 		file rename -force -- $backup $mtool_target
@@ -395,6 +387,6 @@ proc merge_tool_finish {fd} {
 
 		delete_temp_files $mtool_tmpfiles
 
-		merge_add_resolution $mtool_target
+		reshow_diff
 	}
 }
Signature · 1 line
1.6.0.2.1262.ge466e
#1 lore raw
Quoted 10 lines · On Tuesday 30 September 2008 10:43:11 Johannes Sixt wrote:

From: Johannes Sixt <[email protected]>

If a merge tool was invoked on a conflicted file and the tool completed, then the conflicted file was staged automatically. However, the fact that the user closed the merge tool cannot be understood as the unequivocal sign that the conflict was completely resolved. For example, the user could have decided to postpone the resolution of the conflict, or could have accidentally closed the tool. We better leave the file unstaged and let the user stage it explicitly.

Quoted 7 lines

Since the file is not staged anyway, the check for an unmodified timestamp is pointless and removed.

---
I had sent this patch last week (but marked as RFC). Here it is again without 'RFC' because I think it is a necessary change.

Now that the issue with staging of working copy files is more or less resolved, I agree that it is better to disable automatic staging.

Alexander