Skip to content

Commit

Permalink
Don't just stash things, pop them as well
Browse files Browse the repository at this point in the history
This is a pet peeve of mine. If your script is smart enough to stash changes,
then please also make sure that after the pull --rebase the stashed changes get
re-applied.

Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
  • Loading branch information
dirkhh committed Nov 16, 2015
1 parent 93182bf commit 376c501
Showing 1 changed file with 15 additions and 6 deletions.
21 changes: 15 additions & 6 deletions recipes/subsurface.centos6.sh
Expand Up @@ -51,6 +51,18 @@ set -e
# Be verbose
set -x

git_pull_rebase_helper()
{
GITCLEAN=$(git diff --shortstat 2> /dev/null | tail -n1)
if [ "x$GITCLEAN" != "x" ] ; then
git stash save
git pull --rebase
git stash pop
else
git pull --rebase
fi
}

# Determine which architecture should be built
if [[ "$(arch)" = "i686" || "$(arch)" = "x86_64" ]] ; then
ARCH=$(arch)
Expand All @@ -68,8 +80,7 @@ if [ ! -d AppImages ] ; then
git clone https://github.com/probonopd/AppImages.git
fi
cd AppImages/
git stash save
git pull --rebase
git_pull_rebase_helper
cd ..

# Enable EPEL repository; needed for recent Qt
Expand Down Expand Up @@ -112,8 +123,7 @@ if [ ! -d AppImageKit ] ; then
git clone https://github.com/probonopd/AppImageKit.git
fi
cd AppImageKit/
git stash save
git pull --rebase
git_pull_rebase_helper
cmake .
make clean
make
Expand All @@ -129,8 +139,7 @@ if [ ! -d subsurface ] ; then
git clone git://subsurface-divelog.org/subsurface
fi
cd subsurface/
git stash save
git pull --rebase
git_pull_rebase_helper
cd ..

# this is a bit hackish as the build.sh script isn't setup in
Expand Down

0 comments on commit 376c501

Please sign in to comment.