From af6e0e4186ffd62c1765665589269944e9214c74 Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Tue, 30 Jul 2024 20:28:21 -0300 Subject: Feat: adds rsup --- rsup | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) create mode 100755 rsup diff --git a/rsup b/rsup new file mode 100755 index 0000000..7ce9687 --- /dev/null +++ b/rsup @@ -0,0 +1,36 @@ +#!/bin/bash +# +# Recursively commit submodule changes +# +# Usage: +# +# From a submodule folder: +# +# sup # go upwards commit, until there's no parent repository + +# Parameters +DIRNAME="`dirname $0`" +BASENAME="`basename $0`" +MESSAGE="$*" +GIT="hit" + +# Check if it is a git repository +if [ ! -d ".git" ]; then + echo "$BASENAME: not a git repository" + exit 1 +fi + +# Default message +if [ -z "$MESSAGE" ]; then + BASE="$(basename `pwd`)" + MESSAGE="Updates $BASE" +fi + +# Commit +commit $MESSAGE + +# Got up +while -d "../.git"; do + sup + cd .. +done -- cgit v1.2.3