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

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

From
Heiko Voigt <hvoigt@hvoigt.net>
Date
Jun 9, 2012, 13:47 UTC
Message-ID
<20120609134729.GA16268@book.hvoigt.net>
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
Previous: Adam SpiersNext: Heiko Voigt
Message 2 of 7 in “Bug in git citool when staging symlink as replacement for submodule”
  1. Adam SpiersJun 1, 2012
  2. git-gui: recognize submodule diff when replaced by fileHeiko Voigt, Jun 9, 2012
  3. update-index: allow overwriting existing submodule index entriesHeiko Voigt, Jun 9, 2012
  4. Junio C HamanoJun 11, 2012
  5. Jens LehmannJun 11, 2012
  6. Heiko VoigtJun 12, 2012
  7. Jens LehmannJun 12, 2012

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.