1

I'm trying to run the rails update script with the following in my .zshrc file (for use in merge conflicts):

export THOR_MERGE="/usr/local/bin/ksdiff --merge --output $MERGED -- $LOCAL $REMOTE"

Kaleidoscope opens up in merge mode however after conflict resolution no changes are persisted. I'm convinced that something must be wrong with the arguments or the order of it.

Any thoughts?

UPDATE:

It seems that $MERGED is not defined and Kaleidoscope tries to write the generated file (the file which includes the conflict resolutions) in file -- thus creating a new file. If only $MERGED was set as expected (the resolved file) this should work...

stratis
  • 7,750
  • 13
  • 53
  • 94

1 Answers1

3

I ended up creating a little wrapper script that I called thor-merge-ksdiff and set THOR_MERGE=.../thor-merge-ksdiff in my environment:

#!/bin/sh -x

LOCAL=$2
REMOTE=$1
MERGED=$(mktemp)
if ksdiff --merge --output "$MERGED" -- "$LOCAL" --snapshot "$REMOTE" --snapshot; then
  mv $MERGED $LOCAL
fi

The ksdiff command line was taken from the latest Kaleidoscope 3 git integration.

Peter Kovacs
  • 2,657
  • 21
  • 19