git.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Michele Ballabio <barra_cuda@katamail.com>
To: "Shawn O. Pearce" <spearce@spearce.org>
Cc: git@vger.kernel.org
Subject: git-gui: more issues with diff parsing
Date: Tue, 9 Sep 2008 10:30:04 +0200	[thread overview]
Message-ID: <200809091030.04507.barra_cuda@katamail.com> (raw)

The patch
	git-gui: Fix diff parsing for lines starting with "--" or "++"
seems to have introduced some glitches. With this sequence:

git init
touch g
git add g
git commit -m"g is a file"
rm g
echo "vvvv" > file
ln -s file g
git add g file
git gui

Now clicking on "g" in the staged changes, git-gui gives this line:
	error: Unhandled 2 way diff marker: {d}

The following patch seems to fix this particular issue, but I don't think
it's the right fix...

diff --git a/lib/diff.tcl b/lib/diff.tcl
index a30c80a..0dac732 100644
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
@@ -345,6 +345,8 @@ proc read_diff {fd scroll_pos} {
 				set tags {}
 			}
 			}
+		} elseif [string match {diff --git *} $line] {
+			continue
 		} else {
 			set op [string index $line 0]
 			switch -- $op {

             reply	other threads:[~2008-09-09  8:22 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-09-09  8:30 Michele Ballabio [this message]
2008-09-12 15:23 ` git-gui: more issues with diff parsing Shawn O. Pearce
2008-09-12 17:06   ` Junio C Hamano
2008-09-12 18:01   ` Jakub Narebski

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=200809091030.04507.barra_cuda@katamail.com \
    --to=barra_cuda@katamail.com \
    --cc=git@vger.kernel.org \
    --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.
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).