sublime_merge
sublime_merge copied to clipboard
custom menu item disabled
Version info
- OS: Debian testing
- Build: 4169
Description
it seems that using any other command than "git" in custom menus leads to the menu item being ignored. Example Commit.sublime-menu:
[
{
"caption": "Show branches containing this commit",
"command": "git",
"args": {"argv": ["branch", "-a", "--contains", "$commit"]}
},
{
"caption": "Find merge commit",
"command": "/home/me/bin/find_merge.sh",
"args": {"argv": ["$commit"]}
},
{
"caption": "Find merge commit2",
"command": "/bin/sh",
"args": {"argv": ["-c", "'commit=$commit && branch=${1:-HEAD} && (git rev-list $commit..$branch --ancestry-path | cat -n; git rev-list $commit..$branch --first-parent | cat -n) | sort -k2 -s | uniq -f1 -d | sort -n | tail -1 | cut -f2'"]}
},
{
"caption": "test",
"command": "sh",
"args": {"argv": []}
}
]
Only the first one works
G'day @br4nnigan,
Thanks for reaching out!
The command portion of the menu item refers to a Sublime Merge command.
Sublime Merge currently doesn't support running ad-hoc processes.
As a temporary work-around you can define a git alias to run your scripts, and then run the associated alias through the git command.
- Add your custom alias using the following git command
git config alias.customalias '!f() { echo $1; }; f' - Add the associated command definition to your menu file
{
"caption": "My Custom Command",
"command": "git",
"args": {"argv": ["customalias", "$commit"]}
},
Cheers, - Dylan from Sublime HQ