{"thread":{"id":"36375","subject":"[PATCH] gitk: show staged submodules regardless of ignore config","startedAt":"2014-04-08T19:36:08Z","lastAt":"2014-04-15T22:34:25Z","messageCount":2,"participants":["Jens Lehmann","Junio C Hamano"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"238561","messageId":"53444FA8.7020504@web.de","threadId":"36375","inReplyTo":null,"subject":"[PATCH] gitk: show staged submodules regardless of ignore config","fromName":"Jens Lehmann","fromEmail":"jens.lehmann@web.de","sentAt":"2014-04-08T19:36:08Z","receivedAt":"2014-04-08T19:36:08Z","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 gitk. This is really\nconfusing, as even when the user chooses to record a new commit for an\nignored submodule by adding it manually this change won't show up under\n\"Local changes checked in to index but not committed\".\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 gitk | 13 ++++++++++---\n 1 file changed, 10 insertions(+), 3 deletions(-)\n\ndiff --git a/gitk b/gitk\nindex 90764e8..f6efaa6 100755\n--- a/gitk\n+++ b/gitk\n@@ -5205,11 +5205,15 @@ proc dohidelocalchanges {} {\n # spawn off a process to do git diff-index --cached HEAD\n proc dodiffindex {} {\n     global lserial showlocalchanges vfilelimit curview\n-    global hasworktree\n+    global hasworktree git_version\n\n     if {!$showlocalchanges || !$hasworktree} return\n     incr lserial\n-    set cmd \"|git diff-index --cached HEAD\"\n+    if {[package vcompare $git_version \"1.7.2\"] >= 0} {\n+\tset cmd \"|git diff-index --cached --ignore-submodules=dirty HEAD\"\n+    } else {\n+\tset cmd \"|git diff-index --cached HEAD\"\n+    }\n     if {$vfilelimit($curview) ne {}} {\n \tset cmd [concat $cmd -- $vfilelimit($curview)]\n     }\n@@ -7705,7 +7709,7 @@ proc addtocflist {ids} {\n }\n\n proc diffcmd {ids flags} {\n-    global log_showroot nullid nullid2\n+    global log_showroot nullid nullid2 git_version\n\n     set i [lsearch -exact $ids $nullid]\n     set j [lsearch -exact $ids $nullid2]\n@@ -7726,6 +7730,9 @@ proc diffcmd {ids flags} {\n \t    }\n \t}\n     } elseif {$j >= 0} {\n+\tif {[package vcompare $git_version \"1.7.2\"] >= 0} {\n+\t    set flags \"$flags --ignore-submodules=dirty\"\n+\t}\n \tset cmd [concat | git diff-index --cached $flags]\n \tif {[llength $ids] > 1} {\n \t    # comparing index with specific revision\n-- \n1.9.1.492.g8149f6f\n"},{"id":"238908","messageId":"xmqqwqeqi5n2.fsf@gitster.dls.corp.google.com","threadId":"36375","inReplyTo":"53444FA8.7020504@web.de","subject":"Re: [PATCH] gitk: show staged submodules regardless of ignore config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-04-15T22:34:25Z","receivedAt":"2014-04-15T22:34:25Z","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 gitk. This is really\n> confusing, as even when the user chooses to record a new commit for an\n> ignored submodule by adding it manually this change won't show up under\n> \"Local changes checked in to index but not committed\".\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/gitk-show-added-submodule-changes\nand park it on 'pu', but I'd prefer it to come to me through your\ntree.\n\nI'll be tagging 2.0.0-rc0 later this week; if you have some\naccumulated changes (I saw that your public repository has an\ninitial vietnamese translation patch that I still do not have),\nplease plan to get them in by the end of next week.\n\nThanks.\n\n>  gitk | 13 ++++++++++---\n>  1 file changed, 10 insertions(+), 3 deletions(-)\n>\n> diff --git a/gitk b/gitk\n> index 90764e8..f6efaa6 100755\n> --- a/gitk\n> +++ b/gitk\n> @@ -5205,11 +5205,15 @@ proc dohidelocalchanges {} {\n>  # spawn off a process to do git diff-index --cached HEAD\n>  proc dodiffindex {} {\n>      global lserial showlocalchanges vfilelimit curview\n> -    global hasworktree\n> +    global hasworktree git_version\n>\n>      if {!$showlocalchanges || !$hasworktree} return\n>      incr lserial\n> -    set cmd \"|git diff-index --cached HEAD\"\n> +    if {[package vcompare $git_version \"1.7.2\"] >= 0} {\n> +\tset cmd \"|git diff-index --cached --ignore-submodules=dirty HEAD\"\n> +    } else {\n> +\tset cmd \"|git diff-index --cached HEAD\"\n> +    }\n>      if {$vfilelimit($curview) ne {}} {\n>  \tset cmd [concat $cmd -- $vfilelimit($curview)]\n>      }\n> @@ -7705,7 +7709,7 @@ proc addtocflist {ids} {\n>  }\n>\n>  proc diffcmd {ids flags} {\n> -    global log_showroot nullid nullid2\n> +    global log_showroot nullid nullid2 git_version\n>\n>      set i [lsearch -exact $ids $nullid]\n>      set j [lsearch -exact $ids $nullid2]\n> @@ -7726,6 +7730,9 @@ proc diffcmd {ids flags} {\n>  \t    }\n>  \t}\n>      } elseif {$j >= 0} {\n> +\tif {[package vcompare $git_version \"1.7.2\"] >= 0} {\n> +\t    set flags \"$flags --ignore-submodules=dirty\"\n> +\t}\n>  \tset cmd [concat | git diff-index --cached $flags]\n>  \tif {[llength $ids] > 1} {\n>  \t    # comparing index with specific revision\n"}]}