git-gui: show staged submodules regardless of ignore config
Currently setting submodule.<name>.ignore and/or diff.ignoreSubmodules to "all" suppresses all output of submodule changes for git-gui. This is really confusing, as even when the user chooses to record a new commit for an ignored submodule by adding it manually this change won't show up under "Staged Changes (Will Commit)". Fix that by using the '--ignore-submodules=dirty' option for both callers of "git diff-index --cached" when the underlying git version supports that option. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com> Signed-off-by: Pat Thoyts <patthoyts@users.sourceforge.net>
Jens Lehmann committed
Apr 8, 2014 at 21:30 UTC
e0db1dd7d4bc87825f0d7d743f1a01b4461a59ff
2 files changed
+8
-1
git-gui.sh
+5
-1
@@ -1558,7 +1558,11 @@ proc rescan_stage2 {fd after} {
1558
1559
set rescan_active 2
1560
ui_status [mc "Scanning for modified files ..."]
1561
- set fd_di [git_read diff-index --cached -z [PARENT]]
1561
+ if {[git-version >= "1.7.2"]} {
1562
+ set fd_di [git_read diff-index --cached --ignore-submodules=dirty -z [PARENT]]
1563
+ } else {
1564
+ set fd_di [git_read diff-index --cached -z [PARENT]]
1565
+ }
1566
set fd_df [git_read diff-files -z]
1567
1568
fconfigure $fd_di -blocking 0 -translation binary -encoding binary
lib/diff.tcl
+3
@@ -287,6 +287,9 @@ proc start_show_diff {cont_info {add_opts {}}} {
287
if {$w eq $ui_index} {
288
lappend cmd diff-index
289
lappend cmd --cached
290
+ if {[git-version >= "1.7.2"]} {
291
+ lappend cmd --ignore-submodules=dirty
292
+ }
293
} elseif {$w eq $ui_workdir} {
294
if {[string first {U} $m] >= 0} {
295
lappend cmd diff