Create
cancel
Showing results for 
Search instead for 
Did you mean: 
Sign up Log in

It's not the same without you

Join the community to find out what other Atlassian users are discussing, debating and creating.

Atlassian Community Hero Image Collage

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 Sign up to comment
TAGS
Community showcase
Published in Sourcetree

Tip from the team: configure your repos for hosting goodness!

Supported Platforms macOS Windows We recently introduced support for additional hosting services such as GitHub Enterprise, GitLab (Cloud, Community Edition, Enterprise Edition), and...

5,817 views 4 13
Read article

Community Events

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

Find an event

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

Unfortunately there are no Community Events near you at the moment.

Host an event

You're one step closer to meeting fellow Atlassian users at your local event. Learn more about Community Events

Events near you