git@vger.kernel.org mailing list mirror (one of many)
 help / color / mirror / code / Atom feed
From: Bert Wesarg <bert.wesarg@googlemail.com>
To: Pat Thoyts <patthoyts@users.sourceforge.net>
Cc: Bert Wesarg <bert.wesarg@googlemail.com>,
	"Shawn O . Pearce" <spearce@spearce.org>,
	git@vger.kernel.org
Subject: [PATCH 2/2] git-gui: support for diff3 conflict style
Date: Tue, 16 Nov 2010 10:26:58 +0100	[thread overview]
Message-ID: <1289899618-2845-1-git-send-email-bert.wesarg@googlemail.com> (raw)
In-Reply-To: <1289899312-2732-1-git-send-email-bert.wesarg@googlemail.com>

This adds highlight support for the diff3 conflict style.

The common pre-image will be reversed to --, because it has been removed
and either replaced with our or their side.

Signed-off-by: Bert Wesarg <bert.wesarg@googlemail.com>

---
 git-gui/git-gui.sh   |    3 +++
 git-gui/lib/diff.tcl |   10 ++++++++++
 2 files changed, 13 insertions(+), 0 deletions(-)

diff --git a/git-gui/git-gui.sh b/git-gui/git-gui.sh
index 38362fa..0134438 100755
--- a/git-gui/git-gui.sh
+++ b/git-gui/git-gui.sh
@@ -3354,6 +3354,9 @@ $ui_diff tag conf d_s- \
 $ui_diff tag conf d< \
 	-foreground orange \
 	-font font_diffbold
+$ui_diff tag conf d| \
+	-foreground orange \
+	-font font_diffbold
 $ui_diff tag conf d= \
 	-foreground orange \
 	-font font_diffbold
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index d4e2ce3..ccd4c70 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -339,6 +339,7 @@ proc start_show_diff {cont_info {add_opts {}}} {
 	}
 
 	set ::current_diff_inheader 1
+	set ::in_conflict_pre_image 0
 	fconfigure $fd \
 		-blocking 0 \
 		-encoding [get_path_encoding $path] \
@@ -420,6 +421,15 @@ proc read_diff {fd conflict_size cont_info} {
 					set is_conflict_diff 1
 					set line [string replace $line 0 1 {  }]
 					set tags d$op
+					set ::in_conflict_pre_image 0
+				} elseif {[regexp {^\+\+\|{$conflict_size}(?: |$)} $line]} {
+					set is_conflict_diff 1
+					set line [string replace $line 0 1 {  }]
+					set tags d|
+					set ::in_conflict_pre_image 1
+				} elseif ($::in_conflict_pre_image) {
+					set line [string replace $line 0 1 {--}]
+					set tags d_--
 				} else {
 					set tags d_++
 				}
-- 
tg: (fba7c96..) bw/git-gui/support-diff3 (depends on: master bw/git-gui/respect-conflict-marker-size)

  reply	other threads:[~2010-11-16  9:27 UTC|newest]

Thread overview: 23+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-11-16  7:49 [PATCH] git-gui: respect conflict marker size Bert Wesarg
2010-11-16  9:21 ` [PATCHv2 1/2] " Bert Wesarg
2010-11-16  9:26   ` Bert Wesarg [this message]
2010-11-19 11:41     ` [PATCH 2/2] git-gui: support for diff3 conflict style Pat Thoyts
2010-11-19 12:05       ` Bert Wesarg
2011-02-27 20:15       ` Bert Wesarg
2011-03-30  6:44         ` Bert Wesarg
2011-03-30  7:18           ` [PATCH 2v2/2] " Bert Wesarg
2011-10-20 19:35             ` Bert Wesarg
2010-11-19 11:20   ` [PATCHv2 1/2] git-gui: respect conflict marker size Pat Thoyts
2010-11-19 11:48     ` Bert Wesarg
  -- strict thread matches above, loose matches on Subject: below --
2019-09-25 20:38 [PATCH 1/2] git-gui: use existing interface to query a path's attribute Bert Wesarg
2019-09-25 20:38 ` [PATCH 2/2] git-gui: support for diff3 conflict style Bert Wesarg
2019-09-29 15:04   ` Pratyush Yadav
2019-09-30 12:17     ` Bert Wesarg
2019-10-03 20:02       ` Philip Oakley
2019-10-03 20:54         ` Pratyush Yadav
2019-10-03 21:40           ` Philip Oakley
     [not found]             ` <CAKPyHN0_AUqLpPVDNJUZqNV8zRQzaDOMXJV4AbnK969AdtGpNg@mail.gmail.com>
2019-10-04 16:09               ` Philip Oakley
2010-11-15 10:04 [PATCH] git-gui: support for underline styles Bert Wesarg
2010-11-19 10:00 ` Pat Thoyts
2010-11-19 10:55   ` Bert Wesarg
2011-02-27 20:04   ` Bert Wesarg
2011-03-30  6:44     ` [PATCH 1/2] " Bert Wesarg

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

  List information: http://vger.kernel.org/majordomo-info.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1289899618-2845-1-git-send-email-bert.wesarg@googlemail.com \
    --to=bert.wesarg@googlemail.com \
    --cc=git@vger.kernel.org \
    --cc=patthoyts@users.sourceforge.net \
    --cc=spearce@spearce.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.
Code repositories for project(s) associated with this public inbox

	https://80x24.org/mirrors/git.git

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 read-only IMAP folder(s) and NNTP newsgroup(s).