[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