]> granicus.if.org Git - git/commitdiff
git-gui: show staged submodules regardless of ignore config
authorJens Lehmann <Jens.Lehmann@web.de>
Tue, 8 Apr 2014 19:30:51 +0000 (21:30 +0200)
committerPat Thoyts <patthoyts@users.sourceforge.net>
Fri, 13 Jun 2014 17:27:33 +0000 (18:27 +0100)
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>
git-gui.sh
lib/diff.tcl

index cf2209b4f201b990cffab6d454599b9fa6932fc0..c69bfb310e190b000260311e634cac764381a72a 100755 (executable)
@@ -1558,7 +1558,11 @@ proc rescan_stage2 {fd after} {
 
        set rescan_active 2
        ui_status [mc "Scanning for modified files ..."]
-       set fd_di [git_read diff-index --cached -z [PARENT]]
+       if {[git-version >= "1.7.2"]} {
+               set fd_di [git_read diff-index --cached --ignore-submodules=dirty -z [PARENT]]
+       } else {
+               set fd_di [git_read diff-index --cached -z [PARENT]]
+       }
        set fd_df [git_read diff-files -z]
 
        fconfigure $fd_di -blocking 0 -translation binary -encoding binary
index 30d9a797769b49cdd9d42fba925d8fa8ecbffb21..b0a5180af71ac04c58d2dd44664df98b67d3a770 100644 (file)
@@ -287,6 +287,9 @@ proc start_show_diff {cont_info {add_opts {}}} {
        if {$w eq $ui_index} {
                lappend cmd diff-index
                lappend cmd --cached
+               if {[git-version >= "1.7.2"]} {
+                       lappend cmd --ignore-submodules=dirty
+               }
        } elseif {$w eq $ui_workdir} {
                if {[string first {U} $m] >= 0} {
                        lappend cmd diff