sublimehq / sublime_merge

Issue tracker for Sublime Merge
https://www.sublimemerge.com
272 stars 14 forks source link

custom `create_branch` command doesn't read `$branch` prefix #1855

Closed ivribalko closed 5 months ago

ivribalko commented 6 months ago

Problem description

this opens 'create branch' menu without any prefix:

    {
        "keys": ["super+alt+b"],
        "command": "show_command_palette",
        "args":
        {
            "command": "create_branch",
            "args": { "prefix": "$branch" },
        }
    },

but this works and adds current commit as prefix:

    {
        "keys": ["super+alt+b"],
        "command": "show_command_palette",
        "args":
        {
            "command": "create_branch",
            "args": { "prefix": "$commit" },
        }
    },

Preferred solution

$branch should give current branch name to the command

Alternatives

more involved custom command? I know there's 'right click -> create branch...' from branch folder but it doesn't do it for me and 'right click -> copy $branch' on a branch is almost good but also not quite

Screenshots

image
dpjohnst commented 5 months ago

Hi @ivribalko,

Thanks for reaching out!

You might be looking for the head variable.

This variable will resolve to the current branch name if a branch is checked out. If a commit is checked out instead, this variable will resolve to the commit hash.

Kind regards, - Dylan from Sublime HQ

ivribalko commented 5 months ago

yup, that works! thank you!