awips2/tools/scripts/upull
Steve Harris f2fac39428 12.9.1-5 baseline
Former-commit-id: d85b989f77196d20eb2d2a21cf4daa13d50474ae
2012-08-21 15:27:03 -05:00

32 lines
925 B
Bash

#!/bin/bash
#
# Check for a merge tool
#
MERGE_TOOL=`git config --get merge.tool`
if [ "$MERGE_TOOL" == "" ]; then
echo "I have no merge tool :("
# Tool disclaimer / continue prompt
echo " "
echo "No merge tool has been set for git. A merge tool would make conflicts easier to resolve."
echo "To set a merge tool, see if you have one of the following merge tools installed:"
echo " meld opendiff kdiff3 tkdiff xxdiff tortoisemerge gvimdiff diffuse ecmerge p4merge araxis emerge vimdiff "
echo "And install thusly (kdiff3 used as example here): "
echo " git config --global merge.tool kdiff3"
echo " "
read -p "Press [Enter] key to continue (ctrl-c to quit).."
fi
changes=`git status | grep "nothing to commit (working directory clean)"`
if [ -z "$changes" ]
then
git stash save "Saving for pull..."
fi
git pull --rebase
if [ -z "$changes" ]
then
git stash pop
git mergetool
fi