From: Heiko Voigt <hvoigt@hvoigt.net>
To: Adam Spiers <git@adamspiers.org>, Pat Thoyts <patthoyts@googlemail.com>
Cc: Git Mailing List <git@vger.kernel.org>
Subject: [PATCH] git-gui: recognize submodule diff when replaced by file
Date: Sat, 9 Jun 2012 15:47:29 +0200 [thread overview]
Message-ID: <20120609134729.GA16268@book.hvoigt.net> (raw)
In-Reply-To: <CAOkDyE9q1n=oLoEXXxurDjNM0B2+cZ9eoeGE57F9hEQUjK0hZg@mail.gmail.com>
When coloring the diff in submodule mode we previously just looked
for the submodule change markers and not normal diff markers. Since
a submodule can be replaced by a file and vice versa lets also support
hunk, + and - lines.
Signed-off-by: Heiko Voigt <hvoigt@hvoigt.net>
---
Hi,
On Fri, Jun 01, 2012 at 11:31:26AM +0100, Adam Spiers wrote:
> At this point, git citool outputs:
>
> error: Unhandled submodule diff marker: {@@ }
> error: Unhandled submodule diff marker: {+on}
This fixes that error message (and is hopefully doing the right thing).
There will be another patch fixing the error popup.
Cheers Heiko
git-gui/lib/diff.tcl | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/git-gui/lib/diff.tcl b/git-gui/lib/diff.tcl
index ec44055..a3c997b 100644
--- a/git-gui/lib/diff.tcl
+++ b/git-gui/lib/diff.tcl
@@ -467,8 +467,16 @@ proc read_diff {fd conflict_size cont_info} {
{ >} {set tags d_+}
{ W} {set tags {}}
default {
- puts "error: Unhandled submodule diff marker: {$op}"
- set tags {}
+ set op [string index $line 0]
+ switch -- $op {
+ {-} {set tags d_-}
+ {+} {set tags d_+}
+ {@} {set tags d_@}
+ default {
+ puts "error: Unhandled submodule diff marker: {$op}"
+ set tags {}
+ }
+ }
}
}
}
--
1.7.10.2.522.g93b45fe
next prev parent reply other threads:[~2012-06-09 13:51 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-06-01 10:31 Bug in git citool when staging symlink as replacement for submodule Adam Spiers
2012-06-09 13:47 ` Heiko Voigt [this message]
2012-06-09 14:27 ` [PATCH] update-index: allow overwriting existing submodule index entries Heiko Voigt
2012-06-11 15:03 ` Junio C Hamano
2012-06-11 21:23 ` Jens Lehmann
2012-06-12 20:33 ` Heiko Voigt
2012-06-12 21:18 ` Jens Lehmann
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=20120609134729.GA16268@book.hvoigt.net \
--to=hvoigt@hvoigt.net \
--cc=git@adamspiers.org \
--cc=git@vger.kernel.org \
--cc=patthoyts@googlemail.com \
/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).