[ADD] script remote git compare: support git cola like git gui

This commit is contained in:
Mathieu Benoit 2024-02-22 03:13:29 -05:00
parent 4a7be4a77f
commit eee8e83ac8
2 changed files with 10 additions and 3 deletions

View file

@ -49,6 +49,9 @@ def get_config():
help="Don't show output of difference.",
)
parser.add_argument("--git_gui", action="store_true", help="Open git gui.")
parser.add_argument(
"--git_cola", action="store_true", help="Open git cola."
)
parser.add_argument("--meld", action="store_true", help="Open meld.")
parser.add_argument(
"--clear",
@ -64,7 +67,7 @@ def main():
# path = tempfile.mkdtemp()
path = tempfile.NamedTemporaryFile().name
if os.path.exists(config.directory1) and os.path.exists(config.directory2):
if config.git_gui:
if config.git_gui or config.git_cola:
shutil.copytree(config.directory1, path)
shutil.copy2("./.gitignore", path)
# repo = Repo(path)
@ -79,8 +82,9 @@ def main():
if not config.quiet:
print(status)
cmd = "git cola" if config.git_cola else "git gui"
try:
subprocess.call(f"cd {path};git gui", shell=True)
subprocess.call(f"cd {path};{cmd}", shell=True)
except:
pass
if config.clear:

View file

@ -131,7 +131,10 @@ def run(config):
options=firefox_options, service=firefox_services
)
except Exception:
print("Cannot open Firefox profile, so will force firefox snap for Ubuntu users.")
print(
"Cannot open Firefox profile, so will force firefox snap for"
" Ubuntu users."
)
firefox_services = Service(
executable_path=getoutput(
"find /snap/firefox -name geckodriver"