author | Ted Pavlic <ted@tedpavlic.com> | |
Wed, 11 Feb 2009 18:03:25 +0000 (13:03 -0500) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 11 Feb 2009 19:09:16 +0000 (11:09 -0800) | ||
commit | e5dd864adfeb8b0176b31a132e972d7f7beff32a | |
tree | 724593197158d5ca1d412582d8f64093bcf7d69b | tree | snapshot |
parent | ad244d256865c06804afffef32b753239a06119e | commit | diff |
completion: Better __git_ps1 support when not in working directory
If .git/HEAD is not readable, __git_ps1 does nothing.
If --is-in-git-dir, __git_ps1 returns " (GIT_DIR!)" as a cautionary
note. The previous behavior would show the branch name (and would
optionally attempt to determine the dirtyState of the directory, which
was impossible because a "git diff" was used).
If --is-in-work-tree, __git_ps1 returns the branch name. Additionally,
if showDirtyState is on, the dirty state is displayed.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
If .git/HEAD is not readable, __git_ps1 does nothing.
If --is-in-git-dir, __git_ps1 returns " (GIT_DIR!)" as a cautionary
note. The previous behavior would show the branch name (and would
optionally attempt to determine the dirtyState of the directory, which
was impossible because a "git diff" was used).
If --is-in-work-tree, __git_ps1 returns the branch name. Additionally,
if showDirtyState is on, the dirty state is displayed.
Signed-off-by: Ted Pavlic <ted@tedpavlic.com>
Acked-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
contrib/completion/git-completion.bash | diff | blob | history |