[PATCH] git-gui: recognize submodule diff when replaced by file

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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@xxxxxxxxxx>
---
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

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]