diff options
author | Silvio Rhatto <rhatto@riseup.net> | 2024-07-30 20:28:21 -0300 |
---|---|---|
committer | Silvio Rhatto <rhatto@riseup.net> | 2024-07-30 20:28:21 -0300 |
commit | af6e0e4186ffd62c1765665589269944e9214c74 (patch) | |
tree | 6eb12782b06dec74bccd952f74cb8c48d80009e5 | |
parent | 382065a2ce25101eabaaae34c37b07010e210248 (diff) | |
download | utils-git-af6e0e4186ffd62c1765665589269944e9214c74.tar.gz utils-git-af6e0e4186ffd62c1765665589269944e9214c74.tar.bz2 |
Feat: adds rsup
-rwxr-xr-x | rsup | 36 |
1 files changed, 36 insertions, 0 deletions
@@ -0,0 +1,36 @@ +#!/bin/bash +# +# Recursively commit submodule changes +# +# Usage: +# +# From a submodule folder: +# +# sup <message> # 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 |