Change-Id: Iabdc5005ed9376e31414429a76898c0798d8e7ff Former-commit-id:48faf25841
[formerly492e6fe379
] [formerly209299d1cb
[formerly ec3999181ac1f2d2d0ca7f469b69a5bf83633570]] Former-commit-id:209299d1cb
Former-commit-id:2a31a4c3e9
36 lines
944 B
Bash
36 lines
944 B
Bash
#!/bin/bash
|
|
|
|
#
|
|
# Check for a merge tool
|
|
#
|
|
MERGE_TOOL=`git config --get merge.tool`
|
|
if [ "$MERGE_TOOL" != "" ]; then
|
|
echo "I have a merge tool!"
|
|
else
|
|
echo "I have no merge tool :("
|
|
fi
|
|
|
|
# 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).."
|
|
|
|
|
|
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
|