{"thread":{"id":"36374","subject":"[PATCH] git-gui: show staged submodules regardless of ignore config","startedAt":"2014-04-08T19:30:51Z","lastAt":"2014-04-15T22:32:41Z","messageCount":2,"participants":["Jens Lehmann","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"238560","messageId":"53444E6B.7000107@web.de","threadId":"36374","inReplyTo":null,"subject":"[PATCH] git-gui: show staged submodules regardless of ignore config","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2014-04-08T19:30:51Z","receivedAt":"2014-04-08T19:30:51Z","isPatch":true,"sender":{"key":"jens.lehmann@web.de","avatar":"https://avatars.githubusercontent.com/u/135220?v=4"},"body":"Currently setting submodule.<name>.ignore and/or diff.ignoreSubmodules to\n\"all\" suppresses all output of submodule changes for git-gui. This is\nreally confusing, as even when the user chooses to record a new commit for\nan ignored submodule by adding it manually this change won't show up under\n\"Staged Changes (Will Commit)\".\n\nFix that by using the '--ignore-submodules=dirty' option for both callers\nof \"git diff-index --cached\" when the underlying git version supports that\noption.\n\nSigned-off-by: Jens Lehmann <Jens.Lehmann@web.de>\n---\n git-gui.sh   | 6 +++++-\n lib/diff.tcl | 3 +++\n 2 files changed, 8 insertions(+), 1 deletion(-)\n\ndiff --git a/git-gui.sh b/git-gui.sh\nindex cf2209b..c69bfb3 100755\n--- a/git-gui.sh\n+++ b/git-gui.sh\n@@ -1558,7 +1558,11 @@ proc rescan_stage2 {fd after} {\n\n \tset rescan_active 2\n \tui_status [mc \"Scanning for modified files ...\"]\n-\tset fd_di [git_read diff-index --cached -z [PARENT]]\n+\tif {[git-version >= \"1.7.2\"]} {\n+\t\tset fd_di [git_read diff-index --cached --ignore-submodules=dirty -z [PARENT]]\n+\t} else {\n+\t\tset fd_di [git_read diff-index --cached -z [PARENT]]\n+\t}\n \tset fd_df [git_read diff-files -z]\n\n \tfconfigure $fd_di -blocking 0 -translation binary -encoding binary\ndiff --git a/lib/diff.tcl b/lib/diff.tcl\nindex 30d9a79..b0a5180 100644\n--- a/lib/diff.tcl\n+++ b/lib/diff.tcl\n@@ -287,6 +287,9 @@ proc start_show_diff {cont_info {add_opts {}}} {\n \tif {$w eq $ui_index} {\n \t\tlappend cmd diff-index\n \t\tlappend cmd --cached\n+\t\tif {[git-version >= \"1.7.2\"]} {\n+\t\t\tlappend cmd --ignore-submodules=dirty\n+\t\t}\n \t} elseif {$w eq $ui_workdir} {\n \t\tif {[string first {U} $m] >= 0} {\n \t\t\tlappend cmd diff\n-- \n1.9.1.492.g8149f6f\n"},{"id":"238907","messageId":"xmqq1twyjkae.fsf@gitster.dls.corp.google.com","threadId":"36374","inReplyTo":"53444E6B.7000107@web.de","subject":"Re: [PATCH] git-gui: show staged submodules regardless of ignore config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-15T22:32:41Z","receivedAt":"2014-04-15T22:32:41Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"Jens Lehmann <Jens.Lehmann@web.de> writes:\n\n> Currently setting submodule.<name>.ignore and/or diff.ignoreSubmodules to\n> \"all\" suppresses all output of submodule changes for git-gui. This is\n> really confusing, as even when the user chooses to record a new commit for\n> an ignored submodule by adding it manually this change won't show up under\n> \"Staged Changes (Will Commit)\".\n>\n> Fix that by using the '--ignore-submodules=dirty' option for both callers\n> of \"git diff-index --cached\" when the underlying git version supports that\n> option.\n>\n> Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de>\n> ---\n\nI'll tentatively queue this on jl/git-gui-show-added-submodule-changes\nand park it on 'pu'.\n\nI'll be tagging 2.0.0-rc0 later this week; if you have some\naccumulated changes (I saw that your public repository is at\ngitgui-0.19.0 which I already have), please plan to get them\nin by the end of next week.\n\nThanks.\n\n>  git-gui.sh   | 6 +++++-\n>  lib/diff.tcl | 3 +++\n>  2 files changed, 8 insertions(+), 1 deletion(-)\n>\n> diff --git a/git-gui.sh b/git-gui.sh\n> index cf2209b..c69bfb3 100755\n> --- a/git-gui.sh\n> +++ b/git-gui.sh\n> @@ -1558,7 +1558,11 @@ proc rescan_stage2 {fd after} {\n>\n>  \tset rescan_active 2\n>  \tui_status [mc \"Scanning for modified files ...\"]\n> -\tset fd_di [git_read diff-index --cached -z [PARENT]]\n> +\tif {[git-version >= \"1.7.2\"]} {\n> +\t\tset fd_di [git_read diff-index --cached --ignore-submodules=dirty -z [PARENT]]\n> +\t} else {\n> +\t\tset fd_di [git_read diff-index --cached -z [PARENT]]\n> +\t}\n>  \tset fd_df [git_read diff-files -z]\n>\n>  \tfconfigure $fd_di -blocking 0 -translation binary -encoding binary\n> diff --git a/lib/diff.tcl b/lib/diff.tcl\n> index 30d9a79..b0a5180 100644\n> --- a/lib/diff.tcl\n> +++ b/lib/diff.tcl\n> @@ -287,6 +287,9 @@ proc start_show_diff {cont_info {add_opts {}}} {\n>  \tif {$w eq $ui_index} {\n>  \t\tlappend cmd diff-index\n>  \t\tlappend cmd --cached\n> +\t\tif {[git-version >= \"1.7.2\"]} {\n> +\t\t\tlappend cmd --ignore-submodules=dirty\n> +\t\t}\n>  \t} elseif {$w eq $ui_workdir} {\n>  \t\tif {[string first {U} $m] >= 0} {\n>  \t\t\tlappend cmd diff\n"}]}