change variable-name

This commit is contained in:
Jakobus Schürz 2022-10-21 10:50:14 +02:00
parent 67b1c1bdaf
commit df804c318b

View file

@ -11,7 +11,7 @@
# notes : #
#################################################################################################
[ -z "${SGIT+x}" ] && SGIT=git
[ -z "${MSC_GIT+x}" ] && MSC_GIT=git
[ -z "${MSC_LOGDIR+x}" ] && export MSC_LOGDIR="${HOME}/logs"
[ -z "${MSC_LOGFILE+x}" ] && export MSC_LOGFILE="${MSC_LOGDIR}/myshellconfig.log"
#MSC_LOGDIR="./logs"
@ -88,23 +88,23 @@ if [ $(stat --printf %Y ${MSC_GIT_UPD_SUBMOD_STATFILE} 2>/dev/null || echo 0 )
[ -z "${dosubmodupdate+x}" ] && dosubmodupdate="true"
fi
#echo $SGIT fetch ${MSC_GIT_REMOTE_NAME} -p 1>&2
#echo $MSC_GIT fetch ${MSC_GIT_REMOTE_NAME} -p 1>&2
if $dorepoupdate; then
loginfo "fetch repo${dosubmodupdate:+ and submodules}"
#$SGIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
$SGIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
#$MSC_GIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
$MSC_GIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
if ${dosubmodupdate:-false}; then
lastupdatesubmodules
fi
echo "Check for local changes:" >> "${MSC_LOGFILE}"
if $SGIT diff-index --ignore-submodules --exit-code HEAD -- >> "${MSC_LOGFILE}" ; then
if $MSC_GIT diff-index --ignore-submodules --exit-code HEAD -- >> "${MSC_LOGFILE}" ; then
cat << EOF >> "${MSC_LOGFILE}"
no changes in local repo
$SGIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH}
$MSC_GIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH}
EOF
$SGIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH} 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 2; }
$SGIT merge FETCH_HEAD 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 3; }
$MSC_GIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH} 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 2; }
$MSC_GIT merge FETCH_HEAD 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 3; }
touch $MSC_GIT_UPD_REPO_STATFILE
else
logwarning -n " Lokale Änderungen festgestellt:"
@ -112,17 +112,17 @@ EOF
cat << EOF >> "${MSC_LOGFILE}"
um die Änderung zurückzusetzen bitte
$SGIT checkout \$FILENAME
$MSC_GIT checkout \$FILENAME
oder um alle lokalen Änderungen auf einmal zurückzusetzen:
$SGIT checkout .
$MSC_GIT checkout .
ausführen
Die Änderungen sind:
$($SGIT diff-index HEAD --|awk '{print $5, $6}')
$($SGIT diff-index -p HEAD --)
$($MSC_GIT diff-index HEAD --|awk '{print $5, $6}')
$($MSC_GIT diff-index -p HEAD --)
EOF
gitupdateend
@ -134,8 +134,8 @@ EOF
if ${dosubmodupdate:-false}; then
loginfo "update and commit submodules"
logdebug "$($SGIT submodule update --remote)"
logdebug "$($SGIT commit -a -m 'update submodules')"
logdebug "$($MSC_GIT submodule update --remote)"
logdebug "$($MSC_GIT commit -a -m 'update submodules')"
touch $MSC_GIT_UPD_SUBMOD_STATFILE
logwarning "submodules synced"
fi