summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 01:33:39 +0200
committerRaymaekers Luca <raymaekers.luca@gmail.com>2024-09-18 01:33:39 +0200
commitc60ce995afab75aaeab193357bb76510ea7a725d (patch)
tree506dc0db44e43ad949629b782eb25939652f2830
parentee13fd88724422f06fd5da0ca940e6ed28e67e17 (diff)
checkpoint
-rwxr-xr-xbin/extra/ginit30
-rwxr-xr-xbin/guiscripts/herbimisu7
-rw-r--r--config/essentials/shell/functions.sh8
3 files changed, 37 insertions, 8 deletions
diff --git a/bin/extra/ginit b/bin/extra/ginit
new file mode 100755
index 0000000..b9e44a6
--- /dev/null
+++ b/bin/extra/ginit
@@ -0,0 +1,30 @@
+#!/bin/sh
+
+# Create a clone of the current git repository on a remote
+
+# Expects the remote to have a git user 'git@remote.net'
+
+if [ -z "$1" ] ;then
+ >&2 printf 'ginit <remote>\n'
+ exit 1
+fi
+
+git_current_branch () {
+ local ref
+ ref=$(__git_prompt_git symbolic-ref --quiet HEAD 2> /dev/null)
+ local ret=$?
+ if [ "$ret" -ne 0 ]
+ then
+ [ "$ret" -eq 128 ] && return
+ ref=$(__git_prompt_git rev-parse --short HEAD 2> /dev/null) || return
+ fi
+ echo ${ref#refs/heads/}
+}
+
+remote="$1"
+name="$(basename "$(git rev-parse --show-toplevel)")"
+[ "$name" ] || exit 1
+
+ssh "git@$remote" "git init --bare $name.git"
+git remote add "$remote" "git@$remote":"$name.git"
+git push "$remote" $(git_current_branch)
diff --git a/bin/guiscripts/herbimisu b/bin/guiscripts/herbimisu
new file mode 100755
index 0000000..267c189
--- /dev/null
+++ b/bin/guiscripts/herbimisu
@@ -0,0 +1,7 @@
+#!/bin/sh
+IFS=' '
+tiramisu -o "#summary #body" |
+ while read -r summary body
+ do
+ herbe "$summary" "$body"
+ done
diff --git a/config/essentials/shell/functions.sh b/config/essentials/shell/functions.sh
index d798a3e..9e12715 100644
--- a/config/essentials/shell/functions.sh
+++ b/config/essentials/shell/functions.sh
@@ -124,14 +124,6 @@ unzipp() {
# fix long waiting time
__git_files() { _wanted files expl 'local files' _files; }
-ginit()
-{
- [ "$1" ] || return 1
- ssh db /var/git/initdir.sh "$1"
- git remote add origin git@db:"$1.git"
- git push --set-upstream origin $(git_current_branch)
-}
-
# Returns current branch
git_current_branch()
{