{"thread":{"id":"22067","subject":"__git_ps1 not showing submodule dirty state","startedAt":"2009-12-30T21:46:30Z","lastAt":"2009-12-31T11:48:41Z","messageCount":3,"participants":["Kevin Ballard","Johan Herland","Thomas Rast"],"isPatch":false,"patchVersion":null,"patchTotal":null},"messages":[{"id":"130582","messageId":"A98B75F4-B9BD-4CB4-9335-754C59ECB64F@sb.org","threadId":"22067","inReplyTo":null,"subject":"__git_ps1 not showing submodule dirty state","fromName":"Kevin Ballard","fromEmail":"kevin@sb.org","sentAt":"2009-12-30T21:46:30Z","receivedAt":"2009-12-30T21:46:30Z","isPatch":false,"sender":{"key":"kevin@sb.org","avatar":"https://avatars.githubusercontent.com/u/714?v=4"},"body":"Why does the __git_ps1 function in git-completion.bash explicitly ignore submodules when showing the GIT_PS1_SHOWDIRTYSTATE status? The most common issue with my current repository is not realizing when submodules need to be updated because I blindly trust my prompt to tell me when I have dirty state.\n\n-Kevin Ballard"},{"id":"130585","messageId":"200912310240.07741.johan@herland.net","threadId":"22067","inReplyTo":"A98B75F4-B9BD-4CB4-9335-754C59ECB64F@sb.org","subject":"Re: __git_ps1 not showing submodule dirty state","fromName":"Johan Herland","fromEmail":"johan@herland.net","sentAt":"2009-12-31T01:40:07Z","receivedAt":"2009-12-31T01:40:07Z","isPatch":false,"sender":{"key":"johan@herland.net","avatar":"https://avatars.githubusercontent.com/u/547031?v=4"},"body":"On Wednesday 30 December 2009, Kevin Ballard wrote:\n> Why does the __git_ps1 function in git-completion.bash explicitly ignore\n>  submodules when showing the GIT_PS1_SHOWDIRTYSTATE status? The most\n>  common issue with my current repository is not realizing when submodules\n>  need to be updated because I blindly trust my prompt to tell me when I\n>  have dirty state.\n\nAccording to git blame, it has been there since GIT_PS1_SHOWDIRTYSTATE was \nintroduced in 738a94a... by Thomas Rast (CCed), but the commit message does \nnot say why submodules are explicitly ignored.\n\nFWIW, I agree with Kevin, and would like changed submodules to be included \nin the status.\n\n\n...Johan\n\n-- \nJohan Herland, <johan@herland.net>\nwww.herland.net\n"},{"id":"130603","messageId":"9108ae77c6551363407265de60c7f1def3fe60f0.1262259747.git.trast@student.ethz.ch","threadId":"22067","inReplyTo":"200912310240.07741.johan@herland.net","subject":"[PATCH] bash completion: factor submodules into dirty state","fromName":"Thomas Rast","fromEmail":"trast@student.ethz.ch","sentAt":"2009-12-31T11:48:41Z","receivedAt":"2009-12-31T11:48:41Z","isPatch":true,"sender":{"key":"tr@thomasrast.ch","avatar":"https://avatars.githubusercontent.com/u/153510?v=4"},"body":"In the implementation of GIT_PS1_SHOWDIRTYSTATE in 738a94a (bash:\noffer to show (un)staged changes, 2009-02-03), I cut&pasted the\ngit-diff invocations from dirty-worktree checks elsewhere, carrying\nalong the --ignore-submodules option.\n\nAs pointed out by Kevin Ballard, this doesn't really make sense: to\nthe _user_, a changed submodule counts towards uncommitted changes.\n\nSigned-off-by: Thomas Rast <trast@student.ethz.ch>\n---\n\nJohan Herland wrote:\n> On Wednesday 30 December 2009, Kevin Ballard wrote:\n> > Why does the __git_ps1 function in git-completion.bash explicitly ignore\n> >  submodules when showing the GIT_PS1_SHOWDIRTYSTATE status? The most\n> >  common issue with my current repository is not realizing when submodules\n> >  need to be updated because I blindly trust my prompt to tell me when I\n> >  have dirty state.\n> \n> According to git blame, it has been there since GIT_PS1_SHOWDIRTYSTATE was \n> introduced in 738a94a... by Thomas Rast (CCed), but the commit message does \n> not say why submodules are explicitly ignored.\n> \n> FWIW, I agree with Kevin, and would like changed submodules to be included \n> in the status.\n\nNo good reason; I really do remember cut&pasting the checks, though\nI'm not sure from where.\n\nI don't really use submodules, so I'll just trust your judgements that\nit's better to factor them into the status.\n\n\n contrib/completion/git-completion.bash |    6 ++----\n 1 files changed, 2 insertions(+), 4 deletions(-)\n\ndiff --git a/contrib/completion/git-completion.bash b/contrib/completion/git-completion.bash\nindex c65462c..a455fe8 100755\n--- a/contrib/completion/git-completion.bash\n+++ b/contrib/completion/git-completion.bash\n@@ -142,11 +142,9 @@ __git_ps1 ()\n \t\telif [ \"true\" = \"$(git rev-parse --is-inside-work-tree 2>/dev/null)\" ]; then\n \t\t\tif [ -n \"${GIT_PS1_SHOWDIRTYSTATE-}\" ]; then\n \t\t\t\tif [ \"$(git config --bool bash.showDirtyState)\" != \"false\" ]; then\n-\t\t\t\t\tgit diff --no-ext-diff --ignore-submodules \\\n-\t\t\t\t\t\t--quiet --exit-code || w=\"*\"\n+\t\t\t\t\tgit diff --no-ext-diff --quiet --exit-code || w=\"*\"\n \t\t\t\t\tif git rev-parse --quiet --verify HEAD >/dev/null; then\n-\t\t\t\t\t\tgit diff-index --cached --quiet \\\n-\t\t\t\t\t\t\t--ignore-submodules HEAD -- || i=\"+\"\n+\t\t\t\t\t\tgit diff-index --cached --quiet HEAD -- || i=\"+\"\n \t\t\t\t\telse\n \t\t\t\t\t\ti=\"#\"\n \t\t\t\t\tfi\n-- \n1.6.6.337.g4932e\n"}]}