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
115cee17
Unverified
Commit
115cee17
authored
Jun 05, 2023
by
Ihor
Committed by
GitHub
Jun 05, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(git): add `gunwipall` function (#11725)
Co-authored-by:
Carlo Sala
<
carlosalag@protonmail.com
>
parent
d1c64bfd
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
15 additions
and
0 deletions
+15
-0
README.md
plugins/git/README.md
+1
-0
git.plugin.zsh
plugins/git/git.plugin.zsh
+14
-0
No files found.
plugins/git/README.md
View file @
115cee17
...
...
@@ -254,6 +254,7 @@ These features allow to pause a branch development and switch to another one (_"
| work_in_progress | Echoes a warning if the current branch is a wip |
| gwip | Commit wip branch |
| gunwip | Uncommit wip branch |
| gunwipall | Uncommit
`--wip--`
commits recursively |
### Deprecated functions
...
...
plugins/git/git.plugin.zsh
View file @
115cee17
...
...
@@ -27,6 +27,20 @@ function work_in_progress() {
command
git
-c
log.showSignature
=
false
log
-n
1 2>/dev/null |
grep
-q
--
"--wip--"
&&
echo
"WIP!!"
}
# Same as `gunwip` but recursive
# "Unwips" all recent `--wip--` commits in loop until there is no left
function
gunwipall
()
{
while
true
;
do
commit_message
=
$(
git rev-list
--max-count
=
1
--format
=
"%s"
HEAD
)
if
[[
$commit_message
=
~
"--wip--"
]]
;
then
git reset
"HEAD~1"
((
$?
))
&&
return
1
else
break
fi
done
}
# Check if main exists and use instead of master
function
git_main_branch
()
{
command
git rev-parse
--git-dir
&>/dev/null
||
return
...
...
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