external diff show empty files sometimes (macosx)

Hello

Quite often, when I open "external diff" (launching excellent Syntevo SmartSynchronize), one of the files extracted in temp dir /var/folders/... is empty ! (using SourceTree 2.5.2 for MacOsX)

I give it here for information :

#!/bin/bash
# SourceTree custom action
# example : /Users/rc/ADL/admin/gitgettemp.sh /Users/rc/E5/dev/git/5flowv2dev mise-en-prod-riccardo.txt 4dcf879789ed246c050494100c3b245db17766e3
#echo $0 $1 $2 $3 $4 $5
dir=$1
filepath=$2
commit=$3
#
cd $dir
branch=`git name-rev --name-only $commit | cut -d \~ -f 1`
commits=`git log --pretty=format:"%H" --all $filepath`
#
echo
echo DIRECTORY=$dir
echo BRANCH=$branch
echo COMMITS=
echo $commits
#
echo
curfound=0
prevcommit=0
for idcom in $commits ; do
if [ "$curfound" == "1" ] ; then
prevcommit=$idcom
curfound=2
fi
if [ "$idcom" == "$commit" ] ; then
curfound=1
fi
done
echo curcommit=$commit, prevcommit=$prevcommit
#
echo
outdir=/Users/rc/zdrop/appdata/gitextract
filename=$(basename $filepath)
if [ "$prevcommit" == "0" ] ; then
echo NOTHING BEFORE
else
echo Exported to $outdir
curfile=${outdir}/${filename}-${commit}
prevfile=${outdir}/${filename}-${prevcommit}
git show $commit:$filepath > $curfile
git show $prevcommit:$filepath > $prevfile
/Applications/soft/SmartSynchronize.app/Contents/MacOS/SmartSynchronize $curfile $prevfile >/dev/null 2>&1
fi
#
echo
echo END

0 comments

Comment

Log in or Join to comment
Community showcase
Brian Ganninger
Published Jan 23, 2018 in Sourcetree

Tip from the team: workflow and keyboard shortcuts

Supported Platforms macOS Sourcetree has a lot to offer and, like many developer tools, finding and using it all can be a challenge, especially for a new user. Everyone might not love ...

251 views 0 3
Read article

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you
Atlassian Team Tour

Join us on the Team Tour

We're bringing product updates and pro tips on teamwork to ten cities around the world.

Save your spot