简体   繁体   中英

Sublime Text 3 + Git package: won't launch difftool (Meld)

I'm using Sublime Text 3 plus the Git package to manage my repo. I have the .gitconfig file set up to use the Meld tool (Meld v3.14.2):

[diff]
    external = meld
    tool = meld

which I can launch from a command prompt with $ git difftool with no issues.

I used to be able to do the same with the git package, via the Git Diff Tool Current File and Git Diff Tool All commands. After re-installing Sublime Text 3, when I attempt to do either of those two actions, the window at the bottom of Sublime appears, asking:

Viewing (1/1): 'test.py'
Launch 'meld' [Y/n]: 

I can't input any text here, and furthermore I didn't need to before. If I try Git Diff Current file it opens a new tab with:

Usage: 
  meld                                 Iniciar con una ventana vacía
  meld <archivo|carpeta>               Iniciar una comparación de control de versiones
  meld <archivo> <archivo> [<archivo>] Iniciar una comparación de archivo de 2 ó 3 vías
  meld <carpeta> <carpeta> [<carpeta>] Iniciar una comparación de carpetas de 2 ó 3 vías

Error: too many arguments (expected 0-3, got 7)

fatal: External Diff died, stopping at test.py

(roughly translated from Spanish) So it looks like the arguments to Meld aren't being passed properly. This is my default config file, I have no User configs:

{
    // save before running commands
    "save_first": true

    // if present, use this command instead of plain "git"
    // e.g. "/Users/kemayo/bin/git" or "C:\bin\git.exe"
    ,"git_command": false

    // if present, use this command instead of plain "gitk"
    // e.g. "/Users/kemayo/bin/gitk" or "C:\bin\gitk.exe"
    ,"gitk_command": false

    // point this the installation location of git-flow
    ,"git_flow_command": "/usr/local/bin/git-flow"

    // use the panel for diff output, rather than a new scratch window (new tab)
    ,"diff_panel": false

    // If you'd rather have your status command open files instead of show you a
    // diff, set this to true.  You can still do `Git: Status` followed by
    // 'Git: Diff Current File' to get a file diff
    ,"status_opens_file": false

    // Use --verbose flag for commit messages
    ,"verbose_commits": true

    // How many commit messages to store in the history. Set to 0 to disable.
    ,"history_size": 5

    // Show git flow commands
    ,"flow": false

    // Annotations default to being on for all files. Can be slow in some cases.
    ,"annotations": false

    // statusbar
    ,"statusbar_branch": true
    // Symbols for quick git status in status bar
    ,"statusbar_status": true
    ,"statusbar_status_symbols" : {"modified": "≠", "added": "+", "deleted": "×", "untracked": "?", "conflicts": "‼", "renamed":"R", "copied":"C", "clean": "✓", "separator": " "}

    // e.g. "Packages/Git/syntax/Git Commit Message.tmLanguage"
    ,"diff_syntax": "Packages/Diff/Diff.tmLanguage"

    // Rulers for commit view
    ,"commit_rulers": [70]

    // Watch for gitignore changes?
    ,"gitignore_sync": false
}

Looks like you need to set git to not prompt. In your .gitconfig file, add:

[difftool]
        prompt = false

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM