forked from cmcculloh/GitScripts
-
Notifications
You must be signed in to change notification settings - Fork 1
/
git-merge-diffmerge-wrapper.sh
executable file
·59 lines (39 loc) · 1.19 KB
/
git-merge-diffmerge-wrapper.sh
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
#!/bin/bash
# Passing the following parameters to mergetool:
# local base remote merge_result
echo "Merge Result: " $4
#"C:/Program Files/SourceGear/DiffMerge/DiffMerge.exe" "$1" "$2" "$3" --result="$4" --title1="Mine" --title2="Merging to: $4" --title3="Theirs"
# TortoiseMerge BaseFilePath MyFilePath [ TheirFilePath ]
file="$2"
#echo "filename: ${file%.*}"
#echo "extension: ${file##*.}"
#filename="${file%.*}"
extension="${file##*.}"
# echo "extension: " $extension
if [[ "$1" == '/dev/null' ]]
then
myfile="NUL"
else
myfile=$1
fi
if [[ "$2" == '/dev/null' ]]
then
basefile="NUL"
else
basefile=$2
fi
if [[ "$3" == '/dev/null' ]]
then
remotefile="NUL"
else
remotefile=$3
fi
if [[ "$extension" == png ]]
then
"${TORTOISE_BIN}TortoiseIDiff.exe" $basefile $myfile $remotefile
else
"${TORTOISE_BIN}TortoiseMerge.exe" $basefile $myfile $remotefile
fi
# works, but leaves orig files behind
# "C:/Program Files/TortoiseGit/bin/TortoiseMerge.exe" "$1" "$2" "$3" --result="$4" --title1="Mine" --title2="Merging to: $4" --title3="Theirs"
# echo "C:/Program Files/TortoiseGit/bin/TortoiseMerge.exe" "$1" "$2" "$3" --result="$4" --title1="Mine" --title2="Merging to: $4" --title3="Theirs"