{"thread":{"id":"36861","subject":"[PATCH] git-gui: show staged submodules regardless of ignore config","startedAt":"2014-06-06T21:10:09Z","lastAt":"2014-06-13T17:36:32Z","messageCount":2,"participants":["Junio C Hamano","Pat Thoyts"],"isPatch":true,"patchVersion":1,"patchTotal":null},"messages":[{"id":"243522","messageId":"xmqqppilpwwe.fsf@gitster.dls.corp.google.com","threadId":"36861","inReplyTo":null,"subject":"[PATCH] git-gui: show staged submodules regardless of ignore config","fromName":"Junio C Hamano","fromEmail":"gitster@pobox.com","sentAt":"2014-06-06T21:10:09Z","receivedAt":"2014-06-06T21:10:09Z","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:30:51 +0200\n\nCurrently 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>\nSigned-off-by: Junio C Hamano <gitster@pobox.com>\n---\n\n * Pat, I've been carrying this in my 'pu' but I would prefer\n   changes to git-gui fed to me through you.  Could you apply this\n   so that I can drop my tentative copy?\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-- \n2.0.0-531-gbd04298\n"},{"id":"244160","messageId":"87k38k66j8.fsf@red.patthoyts.tk","threadId":"36861","inReplyTo":"xmqqppilpwwe.fsf@gitster.dls.corp.google.com","subject":"Re: [PATCH] git-gui: show staged submodules regardless of ignore config","fromName":"Pat Thoyts","fromEmail":"patthoyts@users.sourceforge.net","sentAt":"2014-06-13T17:36:32Z","receivedAt":"2014-06-13T17:36:32Z","isPatch":true,"sender":{"key":"patthoyts@users.sourceforge.net","avatar":"https://avatars.githubusercontent.com/u/30739?v=4"},"body":"Junio C Hamano <gitster@pobox.com> writes:\n\n>From: Jens Lehmann <Jens.Lehmann@web.de>\n>Date: Tue, 8 Apr 2014 21:30:51 +0200\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>Signed-off-by: Junio C Hamano <gitster@pobox.com>\n>---\n>\n> * Pat, I've been carrying this in my 'pu' but I would prefer\n>   changes to git-gui fed to me through you.  Could you apply this\n>   so that I can drop my tentative copy?\n>\n\nOK - Applied.\n\n-- \nPat Thoyts                            http://www.patthoyts.tk/\nPGP fingerprint 2C 6E 98 07 2C 59 C8 97  10 CE 11 E6 04 E0 B9 DD\n"}]}