diff --git a/extensions/got.ksh b/extensions/got.ksh index 254dfee..ec76c7f 100755 --- a/extensions/got.ksh +++ b/extensions/got.ksh @@ -17,6 +17,24 @@ function got-sync { got rebase master } +function got-clean { + local _opt + _opt=$1 + for f in $(got status | grep ^? | awk '{print $2}'); do + case "$_opt" in + -f) + rm -vf "$f" + ;; + -i) + rm -vi "$f" + ;; + *) + echo "rm $f" + ;; + esac + done +} + function got-commit-v { local _width _session _args diff --git a/extensions/got.org b/extensions/got.org index c276e0d..e35406e 100644 --- a/extensions/got.org +++ b/extensions/got.org @@ -4,6 +4,7 @@ This extension adds helper functions to the [[https://gameoftrees.org/][got]] to | Function | Description | |-------------+-------------------------------------------------------------------------| +| ~got-clean~ | Cleans the work directory. | | ~got-push~ | Pushes (~git push~) from the bare repository found in ~.got/repository~ | | ~got-sync~ | Rebase ~master~ on top of ~[remote]/master~. Defaults to ~origin~. | | ~__got_ps1~ | Current got branch. Intended to be used in ~$PS1~. |