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

[PATCH] git-gui: Do not munge conflict marker lines in a normal diff

From
Johannes Sixt <j.sixt@viscovery.net>
Date
Oct 14, 2008, 11:48 UTC
Message-ID
<48F48715.9070105@viscovery.net>
From: Johannes Sixt <johannes.sixt@telecom.at>

Previously, conflict markers were highlighted in two ways: (1) They received a distinguishing color; and (2) they had the '+' removed at the beginning of the line. However, by doing (2), a hunk that contained conflict markers could not be staged or unstaged because the resulting patch was corrupted. With this change we no longer modify the diff text of a 2-way diff, so that "Stage Hunk" and friends work.

Note that 3-way diff of a conflicted file is unaffected by this change, and '++' before conflict markers is still removed. But this has no negative impact because in this mode staging hunks or lines is disabled anyway.

Signed-off-by: Johannes Sixt <johannes.sixt@telecom.at>
---
 lib/diff.tcl |    1 -
 1 files changed, 0 insertions(+), 1 deletions(-)
diff --git a/lib/diff.tcl b/lib/diff.tcl
index bdcbbf8..94ee38c 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -377,7 +377,6 @@ proc read_diff {fd cont_info} {
 			{+} {
 				if {[regexp {^\+([<>]{7} |={7})} $line _g op]} {
 					set is_conflict_diff 1
-					set line [string replace $line 0 0 { }]
 					set tags d$op
 				} else {
 					set tags d_+
-- 
1.6.0.2.1493.g2969e
Message 1 of 1 in “git-gui: Do not munge conflict marker lines in a normal diff”
  1. git-gui: Do not munge conflict marker lines in a normal diffJohannes Sixt, Oct 14, 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.