{"thread":{"id":"36860","subject":"[PATCH] gitk: show staged submodules regardless of ignore config","startedAt":"2014-06-06T21:08:29Z","lastAt":"2014-06-15T04:57:13Z","messageCount":2,"participants":["Junio C Hamano","Paul Mackerras"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"243521","messageId":"xmqqtx7xpwz6.fsf@gitster.dls.corp.google.com","threadId":"36860","inReplyTo":null,"subject":"[PATCH] gitk: show staged submodules regardless of ignore config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-06T21:08:29Z","receivedAt":"2014-06-06T21:08:29Z","isPatch":true,"sender":{"key":"gitster@pobox.com","avatar":"https://avatars.githubusercontent.com/u/54884?v=4"},"body":"From: Jens Lehmann <Jens.Lehmann@web.de>\nDate: Tue, 8 Apr 2014 21:36:08 +0200\n\nCurrently 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>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Paul, I've been carrying this in my 'pu' but I would prefer\n   changes to gitk fed to me through you.  Could you apply this so\n   that I can drop my tentative copy?\n\n   Thanks.\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-- \n2.0.0-531-gbd04298\n"},{"id":"244198","messageId":"20140615045713.GD21978@iris.ozlabs.ibm.com","threadId":"36860","inReplyTo":"xmqqtx7xpwz6.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] gitk: show staged submodules regardless of ignore config","fromName":"Paul Mackerras","fromEmail":"paulus@samba.org","sentAt":"2014-06-15T04:57:13Z","receivedAt":"2014-06-15T04:57:13Z","isPatch":true,"sender":{"key":"paulus@samba.org","avatar":"https://avatars.githubusercontent.com/u/1606439?v=4"},"body":"On Fri, Jun 06, 2014 at 02:08:29PM -0700, Junio C Hamano wrote:\n> From: Jens Lehmann <Jens.Lehmann@web.de>\n> Date: Tue, 8 Apr 2014 21:36:08 +0200\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> Signed-off-by: Junio C Hamano <gitster@pobox.com>\n\nThanks, applied.\n\nPaul.\n"}]}