Skip to content

Commit

Permalink
bash completion: factor submodules into dirty state
Browse files Browse the repository at this point in the history
In the implementation of GIT_PS1_SHOWDIRTYSTATE in 738a94a (bash:
offer to show (un)staged changes, 2009-02-03), I cut&pasted the
git-diff invocations from dirty-worktree checks elsewhere, carrying
along the --ignore-submodules option.

As pointed out by Kevin Ballard, this doesn't really make sense: to
the _user_, a changed submodule counts towards uncommitted changes.

Signed-off-by: Thomas Rast <trast@student.ethz.ch>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
  • Loading branch information
trast authored and gitster committed Dec 31, 2009
1 parent c8cba79 commit cf6e7ba
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions contrib/completion/git-completion.bash
Expand Up @@ -148,11 +148,9 @@ __git_ps1 ()
elif [ "true" = "$(git rev-parse --is-inside-work-tree 2>/dev/null)" ]; then
if [ -n "${GIT_PS1_SHOWDIRTYSTATE-}" ]; then
if [ "$(git config --bool bash.showDirtyState)" != "false" ]; then
git diff --no-ext-diff --ignore-submodules \
--quiet --exit-code || w="*"
git diff --no-ext-diff --quiet --exit-code || w="*"
if git rev-parse --quiet --verify HEAD >/dev/null; then
git diff-index --cached --quiet \
--ignore-submodules HEAD -- || i="+"
git diff-index --cached --quiet HEAD -- || i="+"
else
i="#"
fi
Expand Down

0 comments on commit cf6e7ba

Please sign in to comment.