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

[PATCH/RFC 1/2] Revert "git-gui: Don't allow staging files with conflicts."

From
Johannes Sixt <johannes.sixt@telecom.at>
Date
Sep 17, 2008, 11:40 UTC
Message-ID
<1221651652-3712-2-git-send-email-johannes.sixt@telecom.at>
In-Reply-To
<1221651652-3712-1-git-send-email-johannes.sixt@telecom.at>

This reverts commits 617ceee653bd7377f662bfc6d3085f321efab7e4 (Don't allow staging files with conflicts) and 2fe5b2ee42897a3acc78e5ddaace3775eb2713ca (Restore ability to Stage Working Copy for conflicts).

The inability to use the icon in front of the file name to stage a file, even a conflicted one, is too disruptive for the workflow. It was intended as a safety valve against accidentally staging the conflicted file, which would remove the conflict stages from the index and inhibit the use of the merge tool. The new menu item "Stage Working Copy" that the second reverted commit introduced helped a bit, but it clearly was just a workaround.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 git-gui.sh        |   10 ----------
 lib/mergetool.tcl |    6 ------
 2 files changed, 0 insertions(+), 16 deletions(-)
diff --git a/git-gui.sh b/git-gui.sh
index 1044ab9..3b1532c 100755
--- a/git-gui.sh
+++ b/git-gui.sh
@@ -1954,17 +1954,12 @@ proc toggle_or_diff {w x y} {
 	$ui_index tag remove in_sel 0.0 end
 	$ui_workdir tag remove in_sel 0.0 end
 
-	# Do not stage files with conflicts
 	if {[info exists file_states($path)]} {
 		set state [lindex $file_states($path) 0]
 	} else {
 		set state {__}
 	}
 
-	if {[string first {U} $state] >= 0} {
-		set col 1
-	}
-
 	# Restage the file, or simply show the diff
 	if {$col == 0 && $y > 1} {
 		if {[string index $state 1] eq {O}} {
@@ -2902,11 +2897,6 @@ $ctxmmg add command \
 	-command {merge_resolve_one 1}
 lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
 $ctxmmg add separator
-$ctxmmg add command \
-	-label [mc "Stage Working Copy"] \
-	-command {merge_resolve_one 0}
-lappend diff_actions [list $ctxmmg entryconf [$ctxmmg index last] -state]
-$ctxmmg add separator
 create_common_diff_popup $ctxmmg
 
 proc popup_diff_menu {ctxm ctxmmg x y X Y} {
diff --git a/lib/mergetool.tcl b/lib/mergetool.tcl
index a44a725..965cfe4 100644
--- a/lib/mergetool.tcl
+++ b/lib/mergetool.tcl
@@ -5,12 +5,6 @@ proc merge_resolve_one {stage} {
 	global current_diff_path
 
 	switch -- $stage {
-		0 {	# Stage without confirmation, to minimize
-			# disruption of the rerere workflow
-			merge_add_resolution $current_diff_path
-			return
-		}
-
 		1 { set targetquestion [mc "Force resolution to the base version?"] }
 		2 { set targetquestion [mc "Force resolution to this branch?"] }
 		3 { set targetquestion [mc "Force resolution to the other branch?"] }
-- 
1.6.0.1.1210.gb7ffe
Previous: Johannes SixtNext: Johannes Sixt
Message 13 of 21 in “Add mergetool functionality to git-gui.”
  1. 0/8 Add mergetool functionality to git-gui.Alexander Gavrilov, Aug 30, 2008
  2. 1/8 git-gui: Don't allow staging files with conflicts.Alexander Gavrilov, Aug 30, 2008
  3. 2/8 git-gui: Support resolving conflicts via the diff context menu.Alexander Gavrilov, Aug 30, 2008
  4. 3/8 git-gui: Support calling merge tools.Alexander Gavrilov, Aug 30, 2008
  5. 4/8 git-gui: Support more merge tools.Alexander Gavrilov, Aug 30, 2008
  6. 5/8 git-gui: Support conflict states _U & UT.Alexander Gavrilov, Aug 30, 2008
  7. 6/8 git-gui: Reimplement and enhance auto-selection of diffs.Alexander Gavrilov, Aug 30, 2008
  8. 7/8 git-gui: Make F5 reselect a diff, if an untracked file is selected.Alexander Gavrilov, Aug 30, 2008
  9. 8/8 git-gui: Show special diffs for complex conflict cases.Alexander Gavrilov, Aug 30, 2008
  10. Johannes SixtSep 8, 2008
  11. Alexander GavrilovSep 8, 2008
  12. 0/2 git-gui: issues with merge tool seriesJohannes Sixt, Sep 17, 2008
  13. 1/2 Revert "git-gui: Don't allow staging files with conflicts."Johannes Sixt, Sep 17, 2008
  14. 2/2 git-gui: Do not automatically stage file after merge tool finishesJohannes Sixt, Sep 17, 2008
  15. Alexander GavrilovSep 17, 2008
  16. Shawn O. PearceSep 24, 2008
  17. 2/2 git-gui: Do not automatically stage file after merge tool finishesJohannes Sixt, Sep 24, 2008
  18. Alexander GavrilovSep 17, 2008
  19. Johannes SixtSep 17, 2008
  20. Alexander GavrilovSep 17, 2008
  21. Shawn O. PearceSep 24, 2008

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.