mirror of
https://github.com/ohmyzsh/ohmyzsh.git
synced 2025-12-31 20:07:39 +08:00
Compare commits
3 Commits
cda1a8e33c
...
22cf9affd7
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
22cf9affd7 | ||
|
|
f84341c574 | ||
|
|
92a9fee013 |
@ -117,7 +117,7 @@ function _omz_git_prompt_status() {
|
|||||||
fi
|
fi
|
||||||
|
|
||||||
# For each status prefix, do a regex comparison
|
# For each status prefix, do a regex comparison
|
||||||
for status_prefix in ${(k)prefix_constant_map}; do
|
for status_prefix in "${(@k)prefix_constant_map}"; do
|
||||||
local status_constant="${prefix_constant_map[$status_prefix]}"
|
local status_constant="${prefix_constant_map[$status_prefix]}"
|
||||||
local status_regex=$'(^|\n)'"$status_prefix"
|
local status_regex=$'(^|\n)'"$status_prefix"
|
||||||
|
|
||||||
|
|||||||
@ -268,6 +268,7 @@ receive further support.
|
|||||||
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
|
| `grename <old> <new>` | Renames branch `<old>` to `<new>`, including on the origin remote. |
|
||||||
| `gbda` | Deletes all merged branches |
|
| `gbda` | Deletes all merged branches |
|
||||||
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
| `gbds` | Deletes all squash-merged branches (**Note: performance degrades with number of branches**) |
|
||||||
|
| `glb` | List latest switched to branches (default 10, can use glb X to get latest X branches)
|
||||||
|
|
||||||
### Work in Progress (WIP)
|
### Work in Progress (WIP)
|
||||||
|
|
||||||
|
|||||||
@ -71,6 +71,12 @@ function grename() {
|
|||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
|
# List latest X (default 10) used branches
|
||||||
|
glb() {
|
||||||
|
local count=${1:-10}
|
||||||
|
git reflog | grep 'checkout: moving' | awk '{print $8}' | awk '!seen[$0]++' | head -n "$count"
|
||||||
|
}
|
||||||
|
|
||||||
#
|
#
|
||||||
# Functions Work in Progress (WIP)
|
# Functions Work in Progress (WIP)
|
||||||
# (sorted alphabetically by function name)
|
# (sorted alphabetically by function name)
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user