From: Tanguy Ortolo Date: Wed, 10 Aug 2011 17:24:59 GMT Subject: Re: git-mergetool: wrap tools with 3 files only to use the BASE file instead of MERGED Message-ID: <20110810172458.GA18167@ortolo.eu> In-Reply-To: <20110810161211.GC4076@elie.gateway.2wire.net> Jonathan Nieder, 2011-08-10 11:12 UTC-0500: > I think you forgot to include the example. Yes, sorry. Here it is. -- 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