From 9626a342594ce3e44f5774f67baeafaaa971e18b Mon Sep 17 00:00:00 2001 From: Aaron Bieber Date: Wed, 29 Jul 2020 14:01:27 +0000 Subject: [PATCH] Add extensions for got. --- extensions/got.ksh | 17 +++++++++++++++++ extensions/got.org | 8 ++++++++ 2 files changed, 25 insertions(+) create mode 100755 extensions/got.ksh create mode 100644 extensions/got.org diff --git a/extensions/got.ksh b/extensions/got.ksh new file mode 100755 index 0000000..23fb92f --- /dev/null +++ b/extensions/got.ksh @@ -0,0 +1,17 @@ +#!/bin/ksh + +# Thanks to jrick for this one: +# https://gist.github.com/jrick/d47e1be98609401e86ba0bd6bfbfc8fe +function got-push { + local p="$PWD" + while [ ! -e "$p/.got/repository" ]; do + if [ "$p" = "/" ]; then + echo "$PWD: not a got checkout" 1>&2 + return 1 + fi + p=$(dirname "$p") + done + local r + read r < "$p/.got/repository" + (cd "$r" && git push $*) +} diff --git a/extensions/got.org b/extensions/got.org new file mode 100644 index 0000000..32920dc --- /dev/null +++ b/extensions/got.org @@ -0,0 +1,8 @@ +* got + +This extension adds helper functions to the [[https://gameoftrees.org/][got]] tool. + +| Function | Description | +|------------+-------------------------------------------------------------------------| +| ~got-push~ | Pushes (~git push~) from the bare repository found in ~.got/repository~ | +