Sublime Forum

Macro weirdness

#1

I want to create a macro, using commands from the Git plugin, that (1) unstages all files, (2) adds the current file and then (3) commits to the repo.

My macro file is this:


	{ "command": "git_reset_head_all" },
	{ "command": "git_add" },
	{ "command": "git_commit" }
]

When I execute the macro, I get this error:

Unknown macro command git_reset_head_all
Unknown macro command git_commit

Both are valid Git commands. Any idea what’s going on?

Alex

0 Likes

#2

It’s possible those are window commands. ST macros only support text commands. You may want to check out viewtopic.php?f=5&t=8677&start=10#p50802 for an example key binding/arguments.

You can install the plugin by adding it as a repository in package control. The command you will use for the key binding (if you use my version) is “run_multiple_commands”.

0 Likes

#3

I still can’t get the git commands to work. Grumble, grumble.

After installing the plugin, this is the command I’m using:

    {
        "caption": "Git: Commit Current File (Macro)",
        "command": "run_multiple_commands",
        "args": {
            "commands":
            
                { "command": "git_reset_head_all" },
                { "command": "git_add" },
                { "command": "git_commit" }
            ]
        }
    },

The run_multiple_commands works fine with other commands, but the git stuff do nothing.

No errors in the console and command logging only returns:

command: run_multiple_commands {"commands": {"command": "git_reset_head_all"}, {"command": "git_add"}, {"command": "git_commit"}]}

Any ideas?

Alex

0 Likes