Re: git-mergetool: wrap tools with 3 files only to use the BASE file instead of MERGED
Jonathan Nieder, 2011-08-10 11:12 UTC-0500:
> I think you forgot to include the example.
--
Tanguy Ortolo
#! /bin/sh
BASE="$1"
LOCAL="$2"
REMOTE="$3"
MERGED="$4"
MTIME_BEFORE="$(stat --format='%Y' "$BASE")"
meld "$LOCAL" "$BASE" "$REMOTE"
MTIME_AFTER="$(stat --format="%Y" "$BASE")"
if [ "$MTIME_BEFORE" != "$MTIME_AFTER" ]
then
# The base file was modified, which means the user saved it
cp "$BASE" "$MERGED"
else
# The user did not save the file: merge failed
exit 1
fi