summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: a91be3f)
raw | patch | inline | side by side (parent: a91be3f)
author | Jens Lehmann <Jens.Lehmann@web.de> | |
Tue, 21 Jul 2009 17:32:31 +0000 (19:32 +0200) | ||
committer | Shawn O. Pearce <spearce@spearce.org> | |
Mon, 10 Aug 2009 15:30:26 +0000 (08:30 -0700) |
As it is hard to say what changed in a submodule by looking at the hashes,
let's show the colored submodule summary instead.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
let's show the colored submodule summary instead.
Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
git-gui.sh | patch | blob | history | |
lib/diff.tcl | patch | blob | history |
diff --git a/git-gui.sh b/git-gui.sh
index 14b92ba786554f4e714c89191e5584a825964ab2..3c0ce2602987c5ca04acbde27a021a0009917d6b 100755 (executable)
--- a/git-gui.sh
+++ b/git-gui.sh
set l [mc "Stage Hunk For Commit"]
set t [mc "Stage Line For Commit"]
}
- if {$::is_3way_diff
+ if {$::is_3way_diff || $::is_submodule_diff
|| $current_diff_path eq {}
|| {__} eq $state
|| {_O} eq $state
diff --git a/lib/diff.tcl b/lib/diff.tcl
index 925b3f56c1c23cc5e0c2b270b9f7e160013c9009..ae1ea3a615f8bc4c809341ae6c6dd3fcf8a54269 100644 (file)
--- a/lib/diff.tcl
+++ b/lib/diff.tcl
proc start_show_diff {cont_info {add_opts {}}} {
global file_states file_lists
- global is_3way_diff diff_active repo_config
+ global is_3way_diff is_submodule_diff diff_active repo_config
global ui_diff ui_index ui_workdir
global current_diff_path current_diff_side current_diff_header
set s $file_states($path)
set m [lindex $s 0]
set is_3way_diff 0
+ set is_submodule_diff 0
set diff_active 1
set current_diff_header {}
lappend cmd $path
}
+ if {[string match {160000 *} [lindex $s 2]]
+ || [string match {160000 *} [lindex $s 3]]} {
+ set cmd {submodule summary -- $current_diff_path}
+ }
+
if {[catch {set fd [eval git_read --nice $cmd]} err]} {
set diff_active 0
unlock_index
}
proc read_diff {fd cont_info} {
- global ui_diff diff_active
+ global ui_diff diff_active is_submodule_diff
global is_3way_diff is_conflict_diff current_diff_header
global current_diff_queue
global diff_empty_count
}
set ::current_diff_inheader 0
+ if {[regexp {^\* } $line]} {
+ set is_submodule_diff 1
+ }
# -- Automatically detect if this is a 3 way diff.
#
if {[string match {@@@ *} $line]} {set is_3way_diff 1}
set tags {}
}
}
+ } elseif {$is_submodule_diff} {
+ if {$line == ""} continue
+ if {[regexp {^\* } $line]} {
+ set line [string replace $line 0 1 {Submodule }]
+ set tags d_@
+ } else {
+ set op [string range $line 0 2]
+ switch -- $op {
+ { <} {set tags d_-}
+ { >} {set tags d_+}
+ { W} {set tags {}}
+ default {
+ puts "error: Unhandled submodule diff marker: {$op}"
+ set tags {}
+ }
+ }
+ }
} else {
set op [string index $line 0]
switch -- $op {