From 19664d4b42fb8bfa37ef67f7224ea49a28a844ab Mon Sep 17 00:00:00 2001 From: Silvio Rhatto Date: Mon, 5 Aug 2024 20:01:48 -0300 Subject: Fix: rename scripts to something more meaningful to others --- sup | 85 +-------------------------------------------------------------------- 1 file changed, 1 insertion(+), 84 deletions(-) mode change 100755 => 120000 sup (limited to 'sup') diff --git a/sup b/sup deleted file mode 100755 index 842ad5a..0000000 --- a/sup +++ /dev/null @@ -1,84 +0,0 @@ -#!/bin/bash -# -# Commit submodule changes -# -# Usage: -# -# 1. From a submodule folder: -# -# sup # go the upward repo and commit -# -# 2. From the top-level git repo: -# -# sup -# -# Usage in an alternative design: -# -# 1. From a submodule folder: -# -# sup # go the upward repo and commit -# -# 2. From the top-level git repo: -# -# sup # detect changed submodules -# sup [..] -# - -# Parameters -DIRNAME="`dirname $0`" -BASENAME="`basename $0`" -PROJECT="$1" -GIT="hit" - -# Check each file at the the submodule registry -#function sup_registry { -# $GIT status --short | grep -v "??" | awk '{ print $2 }' | while read module; do -# if grep -q "\[submodule \"$module\"\]" .gitmodules; then -# true -# fi -# done -#} - -# Check if it is a git repository, and wheter we're in the top of it -if [ ! -d ".git" ]; then - echo "$BASENAME: not a git repository, or not in the top-level of that repository" - exit 1 -fi - -# Remove trailing slash from project name -PROJECT="`echo "$PROJECT" | sed -e 's|/$||'`" - -# Check if param is a project -if [ ! -z "$PROJECT" ]; then - # Check if project is a registered submodule - if ! grep -q "\[submodule \"$PROJECT\"\]" .gitmodules; then - echo "$BASENAME: not a submodule: $PROJECT" - exit 1 - fi - - # Check if it has changes to be commited - #if ! $GIT status --short $PROJECT | grep -q "^[AM]"; then - # echo "$BASENAME: not changes to be commited for $PROJECT" - # exit 1 - #fi - - # Work with cached version only - #COMMIT="`$GIT diff --cached $PROJECT | grep '^\+Subproject commit ' | cut -d ' ' -f 3`" - #LOG="`cd $PROJECT &> /dev/null && git log -1 --oneline $COMMIT`" - - # Always work with the latest commit - $GIT add $PROJECT - LOG="`cd $PROJECT &> /dev/null && git log -1 --oneline`" - - MESSAGE="Updates $PROJECT: $LOG" - $DIRNAME/commit $MESSAGE -else - # Get log - LOG="`git log -1 --oneline`" - BASE="$(basename `pwd`)" - MESSAGE="Updates $BASE: $LOG" - - # Got upward and commit - #( cd .. &> /dev/null && $GIT add $BASE && $DIRNAME/commit "$MESSAGE" ) - ( cd .. &> /dev/null && $GIT add -f $BASE && $DIRNAME/commit "$MESSAGE" ) -fi diff --git a/sup b/sup new file mode 120000 index 0000000..8832612 --- /dev/null +++ b/sup @@ -0,0 +1 @@ +scommit \ No newline at end of file -- cgit v1.2.3