Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

mergetool: provide absolute path to $MERGED #5455

Open
aryairani opened this issue Nov 15, 2024 · 0 comments
Open

mergetool: provide absolute path to $MERGED #5455

aryairani opened this issue Nov 15, 2024 · 0 comments

Comments

@aryairani
Copy link
Contributor

aryairani commented Nov 15, 2024

Is your feature request related to a problem? Please describe.
Currently, $MERGED is a bare filename relative to ucm's current dir. (we want the file in ucm's current dir so it will be parsed automatically). However, if the UCM_MERGETOOL command results in being in a different directory than the ucm current directory, then $MERGED will refer to the wrong location.

Describe the solution you'd like
If Haskell can resolve $MERGED to an absolute path before interpolating UCM_MERGETOOL, then it'll be a little more resilient.

Describe alternatives you've considered
As a workaround, since the interpolated UCM_MERGETOOL string is passed to a shell, I can thread a cd `pwd` into the string, but it makes the messy process of authoring the command string a little messier.

e.g.

UCM_MERGETOOL='osascript -e '"'"'tell app "Terminal" to do script "cd '`pwd`';/Applications/IntelliJ\\ IDEA\\ CE.app/Contents/MacOS/idea merge \"$LOCAL\" \"$REMOTE\" \"$BASE\" \"$MERGED\""'"'" ucm

In my case this also has the side effect of rerunning nix stuff with direnv before the mergetool is launched.

I could move the pwd to something more like `pwd`/$MERGED, but then that will break if $MERGED later is an absolute path.

Open to other suggestions!

Additional context
ucm 0.5.28

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant