Skip to content

Instantly share code, notes, and snippets.

@Symbolk
Created July 21, 2019 12:21
Show Gist options
  • Save Symbolk/02285e24b15146f9669bf2fa27996202 to your computer and use it in GitHub Desktop.
Save Symbolk/02285e24b15146f9669bf2fa27996202 to your computer and use it in GitHub Desktop.
Git custom sub-command to diff with Meld
#!/usr/bin/env python
# import subprocess
import os
import sys
# C:/PROGRA~1/Meld/Meld.exe
binaryPath = "meld"
base = str(sys.argv[1])
ours = base.replace('base', 'ours')
theirs = ours.replace('ours', 'theirs')
print(ours)
print(base)
print(theirs)
# subprocess.call([binaryPath, ours, base, theirs])
cmd = "{0} {1} {2} {3}".format(binaryPath, ours, base, theirs)
os.system(cmd)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment