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

diffmerge does not work from command line #5133

Closed
drew-gross opened this issue Jun 29, 2014 · 2 comments
Closed

diffmerge does not work from command line #5133

drew-gross opened this issue Jun 29, 2014 · 2 comments

Comments

@drew-gross
Copy link
Contributor

Happy to help fix this myself, unfortunately I don't know how at the moment. Note that launching diffmerge from finder works fine, but launching from the command line does not.

This is because diffmerge is a symlink to diffmerge.sh which contains this code:

#!/bin/sh
## A little script to make it easier to launch DiffMerge from the command line.
## Install this script into a folder in your path, such as /usr/bin or /usr/local/bin.
##
## Version 4.2.0.697
## Copyright (C) 2003-2013 SourceGear LLC. All Rights Reserved.
##############################################################################

## Change DIFFMERGE_PATH to point to where you installed DiffMerge

DIFFMERGE_PATH=/Applications/DiffMerge.app

## The actual executable is hidden inside the .app bundle.

DIFFMERGE_EXE=${DIFFMERGE_PATH}/Contents/MacOS/DiffMerge

## Launch DiffMerge using the given command line arguments.  Use --help for
## additional information or see the man page distributed along with this
## shell script.

exec ${DIFFMERGE_EXE} --nosplash "$@"

which assumes DiffMerge lives in /Applications, and indicates that the developer-supported way to launch diffmerge from the command line is to edit this file. I can think of a few solutions, none of which are great. We could write code that will edit this file after downloading, but that seems too brittle, we could symlink the DiffMerge binary instead of this shell script, but then we miss out on the --nosplash option, or we could just add a caveat telling the user to edit the file, but thats not very automatic. Thoughts?

@rolandwalker
Copy link
Contributor

Good catch. For the moment, it seems like the best answer would be to link the DiffMerge binary and add a caveats line explaining how to eg configure git to use the --nosplash option.

For a general fix, I think that (instead of a symlink) we would have to write a one-line bash shim that does

exec /full/path/to/the/real/diffmerge.sh "$@"

This same issue came up recently on cycript.rb, and there is at least on other similar case.

The Cask DSL interface could look like

  binary 'Extras/diffmerge.sh', :shim => true

@drew-gross
Copy link
Contributor Author

I made a pull request to fix this issue, but it introduces another issue. While diffmerge can be invoked from the command line, doing so causes some debug alerts to appear. I haven't been able to figure out why.

@Homebrew Homebrew locked and limited conversation to collaborators May 8, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants