Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
O
oh-my-zsh
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
github
oh-my-zsh
Commits
fb66b67d
Unverified
Commit
fb66b67d
authored
Nov 12, 2022
by
Lennart Ochel
Committed by
GitHub
Nov 12, 2022
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(git-prompt): show deleted files (#11245)
parent
62929263
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
11 additions
and
3 deletions
+11
-3
git-prompt.plugin.zsh
plugins/git-prompt/git-prompt.plugin.zsh
+5
-0
gitstatus.py
plugins/git-prompt/gitstatus.py
+6
-3
No files found.
plugins/git-prompt/git-prompt.plugin.zsh
View file @
fb66b67d
...
...
@@ -47,6 +47,7 @@ function update_current_git_vars() {
GIT_UNTRACKED
=
$__CURRENT_GIT_STATUS
[
7]
GIT_STASHED
=
$__CURRENT_GIT_STATUS
[
8]
GIT_CLEAN
=
$__CURRENT_GIT_STATUS
[
9]
GIT_DELETED
=
$__CURRENT_GIT_STATUS
[
10]
}
git_super_status
()
{
...
...
@@ -69,6 +70,9 @@ git_super_status() {
if
[
"
$GIT_CHANGED
"
-ne
"0"
]
;
then
STATUS
=
"
$STATUS$ZSH_THEME_GIT_PROMPT_CHANGED$GIT_CHANGED
%{
${
reset_color
}
%}"
fi
if
[
"
$GIT_DELETED
"
-ne
"0"
]
;
then
STATUS
=
"
$STATUS$ZSH_THEME_GIT_PROMPT_DELETED$GIT_DELETED
%{
${
reset_color
}
%}"
fi
if
[
"
$GIT_UNTRACKED
"
-ne
"0"
]
;
then
STATUS
=
"
$STATUS$ZSH_THEME_GIT_PROMPT_UNTRACKED$GIT_UNTRACKED
%{
${
reset_color
}
%}"
fi
...
...
@@ -91,6 +95,7 @@ ZSH_THEME_GIT_PROMPT_BRANCH="%{$fg_bold[magenta]%}"
ZSH_THEME_GIT_PROMPT_STAGED
=
"%{
$fg
[red]%}%{●%G%}"
ZSH_THEME_GIT_PROMPT_CONFLICTS
=
"%{
$fg
[red]%}%{✖%G%}"
ZSH_THEME_GIT_PROMPT_CHANGED
=
"%{
$fg
[blue]%}%{✚%G%}"
ZSH_THEME_GIT_PROMPT_DELETED
=
"%{
$fg
[blue]%}%{-%G%}"
ZSH_THEME_GIT_PROMPT_BEHIND
=
"%{↓%G%}"
ZSH_THEME_GIT_PROMPT_AHEAD
=
"%{↑%G%}"
ZSH_THEME_GIT_PROMPT_UNTRACKED
=
"%{
$fg
[cyan]%}%{…%G%}"
...
...
plugins/git-prompt/gitstatus.py
View file @
fb66b67d
...
...
@@ -44,7 +44,7 @@ if po.returncode != 0:
sys
.
exit
(
0
)
# Not a git repository
# collect git status information
untracked
,
staged
,
changed
,
conflicts
=
[],
[],
[],
[]
untracked
,
staged
,
changed
,
deleted
,
conflicts
=
[],
[],
[],
[],
[]
ahead
,
behind
=
0
,
0
status
=
[(
line
[
0
],
line
[
1
],
line
[
2
:])
for
line
in
stdout
.
decode
(
'utf-8'
)
.
splitlines
()]
for
st
in
status
:
...
...
@@ -75,13 +75,15 @@ for st in status:
else
:
if
st
[
1
]
==
'M'
:
changed
.
append
(
st
)
if
st
[
1
]
==
'D'
:
deleted
.
append
(
st
)
if
st
[
0
]
==
'U'
:
conflicts
.
append
(
st
)
elif
st
[
0
]
!=
' '
:
staged
.
append
(
st
)
stashed
=
get_stash
()
if
not
changed
and
not
staged
and
not
conflicts
and
not
untracked
:
if
not
changed
and
not
deleted
and
not
staged
and
not
conflicts
and
not
untracked
:
clean
=
1
else
:
clean
=
0
...
...
@@ -95,6 +97,7 @@ out = ' '.join([
str
(
len
(
changed
)),
str
(
len
(
untracked
)),
str
(
stashed
),
str
(
clean
)
str
(
clean
),
str
(
len
(
deleted
))
])
print
(
out
,
end
=
''
)
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment