sublimehq / sublime_merge

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

Cannot pop/drop stash when using custom git binary path #1719

Closed nicholas-ochoa closed 1 year ago

nicholas-ochoa commented 1 year ago

Version info

Description

When I try and drop / pop stash I'm getting an error message:

image image

If I open a terminal and run the same command it runs successfully:

image

I have a custom Git binary configured in Sublime Merge:

image

I confirmed that the binary I'm calling in the Terminal is the same that I'm calling in Sublime Merge.

When I change this back to bundled it seems to work just fine from Sublime Merge.

I can't remember what issue I had that prompted me to change the Git path, so leaving it at bundled is fine for now but I figured this was still worth reporting.

The version of git I was using is 2.39.1 installed via MSYS2 UCRT64.

Steps to reproduce

Steps to reproduce the behavior:

  1. Open repository
  2. Make some changes to a file and then stash those changes
  3. Right click on the stash in the Locations tab and select Drop Stash

Expected behavior

The stash should drop without issue.

nicholas-ochoa commented 1 year ago

Well, I quickly remembered why I use a custom git binary when I tried to push out some commits. I cannot get the bundled git to pick up my SSH keys correctly (probably because I'm using ssh-agent instead of using pagent even though I'm on windows). I've reverted back to the custom git binary for now, hopefully this issue can be fixed.

Edit: One more update. I found that by creating a custom Stash.sublime-menu in my packages/user directory I can add some entries that do work:

[
  {
    "caption": "Pop Stash",
    "command": "git",
    "args": {"argv": ["stash", "pop", "$stash"]},
  },
  {
    "caption": "Apply Stash",
    "command": "git",
    "args": {"argv": ["stash", "apply", "$stash"]},
  },
  {
    "caption": "Drop Stash",
    "command": "git",
    "args": {"argv": ["stash", "drop", "$stash"]},
  },
  { "caption": "-", "id": "end" }
]

Unfortunately, this doesn't override the defaults but at least I have a workaround.

Showing the built in (failed) stash commands, versus the one I added above:

image
dpjohnst commented 1 year ago

Hi @nicholas-ochoa,

Thanks for reaching out - it looks like your shell is escaping the {/} characters when they're passed in. Could you confirm what shell you're using?

Kind regards, - Dylan from Sublime HQ

nicholas-ochoa commented 1 year ago

I'm using Bash via MSYS2

dpjohnst commented 1 year ago

Hi @nicholas-ochoa,

Sublime Merge 2086 (development build) has been released which fixes this. This fix will also be available in the next stable build.

Kind regards, - Dylan from Sublime HQ