aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--README.md3
-rw-r--r--config/p10k-classic.zsh7
-rw-r--r--config/p10k-lean-8colors.zsh7
-rw-r--r--config/p10k-lean.zsh7
-rw-r--r--config/p10k-rainbow.zsh7
5 files changed, 26 insertions, 5 deletions
diff --git a/README.md b/README.md
index 78fcf39f..a670871a 100644
--- a/README.md
+++ b/README.md
@@ -899,13 +899,14 @@ Zsh but it won't do anything.
When using Lean, Classic or Rainbow style, Git status may look like this:
```text
-feature:master ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42
+feature:master wip ⇣42⇡42 ⇠42⇢42 *42 merge ~42 +42 !42 ?42
```
| Symbol | Meaning | Source |
| --------- | -------------------------------------------------------------------- | ------------------------------------------------------ |
| `feature` | current branch; replaced with `#tag` or `@commit` if not on a branch | `git status --ignore-submodules=dirty` |
| `master` | remote tracking branch; only shown if different from local branch | `git rev-parse --abbrev-ref --symbolic-full-name @{u}` |
+| `wip` | the latest commit's summary contains "wip" or "WIP" | `git show --pretty=%s --no-patch HEAD` |
| `⇣42` | this many commits behind the remote | `git status --ignore-submodules=dirty` |
| `⇡42` | this many commits ahead of the remote | `git status --ignore-submodules=dirty` |
| `⇠42` | this many commits behind the push remote | `git rev-list --left-right --count HEAD...@{push}` |
diff --git a/config/p10k-classic.zsh b/config/p10k-classic.zsh
index a3013932..5be4bd86 100644
--- a/config/p10k-classic.zsh
+++ b/config/p10k-classic.zsh
@@ -347,7 +347,7 @@
# Formatter for Git status.
#
- # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
+ # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
@@ -413,6 +413,11 @@
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
fi
+ # Display "wip" if the latest commit's summary contains "wip" or "WIP".
+ if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
+ res+=" ${modified}wip"
+ fi
+
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
diff --git a/config/p10k-lean-8colors.zsh b/config/p10k-lean-8colors.zsh
index 57f1bd12..d02e3a39 100644
--- a/config/p10k-lean-8colors.zsh
+++ b/config/p10k-lean-8colors.zsh
@@ -345,7 +345,7 @@
# Formatter for Git status.
#
- # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
+ # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
@@ -411,6 +411,11 @@
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
fi
+ # Display "wip" if the latest commit's summary contains "wip" or "WIP".
+ if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
+ res+=" ${modified}wip"
+ fi
+
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
diff --git a/config/p10k-lean.zsh b/config/p10k-lean.zsh
index f843f99a..aac1cc81 100644
--- a/config/p10k-lean.zsh
+++ b/config/p10k-lean.zsh
@@ -341,7 +341,7 @@
# Formatter for Git status.
#
- # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
+ # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
@@ -407,6 +407,11 @@
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
fi
+ # Display "wip" if the latest commit's summary contains "wip" or "WIP".
+ if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
+ res+=" ${modified}wip"
+ fi
+
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.
diff --git a/config/p10k-rainbow.zsh b/config/p10k-rainbow.zsh
index 722acbdd..7671a785 100644
--- a/config/p10k-rainbow.zsh
+++ b/config/p10k-rainbow.zsh
@@ -357,7 +357,7 @@
# Formatter for Git status.
#
- # Example output: master ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
+ # Example output: master wip ⇣42⇡42 *42 merge ~42 +42 !42 ?42.
#
# You can edit the function to customize how Git status looks.
#
@@ -414,6 +414,11 @@
res+="${meta}:${clean}${(V)VCS_STATUS_REMOTE_BRANCH//\%/%%}"
fi
+ # Display "wip" if the latest commit's summary contains "wip" or "WIP".
+ if [[ $VCS_STATUS_COMMIT_SUMMARY == (|*[^[:alnum:]])(wip|WIP)(|[^[:alnum:]]*) ]]; then
+ res+=" ${modified}wip"
+ fi
+
# ⇣42 if behind the remote.
(( VCS_STATUS_COMMITS_BEHIND )) && res+=" ${clean}⇣${VCS_STATUS_COMMITS_BEHIND}"
# ⇡42 if ahead of the remote; no leading space if also behind the remote: ⇣42⇡42.