change variable-name
This commit is contained in:
parent
45f598ebe6
commit
bb7037c54e
1 changed files with 12 additions and 11 deletions
|
@ -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,21 +88,22 @@ 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 "git submodule sync"
|
||||
logdebug "$(git submodule sync 2>&1)"
|
||||
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; }
|
||||
#$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; }
|
||||
|
@ -116,17 +117,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
|
||||
|
@ -138,8 +139,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
|
||||
|
|
Loading…
Reference in a new issue