Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when stashing changes #2595

Closed
aeschli opened this issue Mar 22, 2023 · 12 comments
Closed

Error when stashing changes #2595

aeschli opened this issue Mar 22, 2023 · 12 comments
Assignees
Labels
bug Something isn't working verified ✔ Verified
Milestone

Comments

@aeschli
Copy link

aeschli commented Mar 22, 2023

Description

When clicking on Stash All Changes in the Staged Changes node of the Source Control viewlet, the operation fails with the following output in the GitLens output channel

[2023-03-22 14:01:42.198] /home/martin/.vscode-insiders/extensions/eamodio.gitlens-13.4.0/dist/gitlens.js:1:46454
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false -c log.showSignature=false log --format=%x3cr%x3e%x20%H -n3 -m -L 2,2:LICENSE.txt
fatal: There is no path LICENSE.txt in the commit

[2023-03-22 14:01:52.157] Push Stash
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push --staged -m update license reference --
error: unknown option `staged'
usage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
                 [-u|--include-untracked] [-a|--all] [-m|--message <message>]
                 [--] [<pathspec>...]]

    -k, --keep-index      keep index
    -p, --patch           stash in patch mode
    -q, --quiet           quiet mode
    -u, --include-untracked
                          include untracked files in stash
    -a, --all             include ignore files
    -m, --message <message>
                          stash message
    --pathspec-from-file <file>
                          read pathspec from file
    --pathspec-file-nul   with --pathspec-from-file, pathspec elements are separated with NUL character



GitLens Version

13.4.0

VS Code Version

Version: 1.77.0-insider
Commit: 833ac685084e2028b09753392b82c641c7025bbc
Date: 2023-03-21T05:25:51.950Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Linux x64 5.15.0-67-generic
Sandboxed: Yes

Git Version

2.34.1

Logs, Screenshots, Screen Captures, etc

No response

@aeschli aeschli added potential-bug triage Needs to be looked at labels Mar 22, 2023
@Hadakajime
Copy link

Hadakajime commented Mar 24, 2023

same here

git version 2.34.1

GitLens — Git supercharged v13.4.0

Version: 1.76.2 (system setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Ubuntu distro through WSL

@lonelyteapot
Copy link

Same here

git version 2.30.2

GitLens — Git supercharged v13.4.0

Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

Ubuntu distro through WSL

@aeschli aeschli changed the title Error when stashing chnage Error when stashing changes Mar 24, 2023
@daohuei
Copy link

daohuei commented Mar 27, 2023

Same here.

GitLens Version
13.4.0

VS Code Version
Version: 1.76

Git Version
2.17.1

@d13 d13 self-assigned this Mar 27, 2023
@Robin-zero
Copy link

Same here.

GitLens Version
v13.4.0

VS Code Version
Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.19045
Sandboxed: No

Git Version
2.29.2.windows.2

@ChrisCrossCrash
Copy link

Same here.

GitLens — Git supercharged v13.4.0

Version: 1.76.2 (user setup)
Commit: ee2b180d582a7f601fa6ecfdad8d9fd269ab1884
Date: 2023-03-14T17:55:54.936Z
Electron: 19.1.11
Chromium: 102.0.5005.196
Node.js: 16.14.2
V8: 10.2.154.26-electron.0
OS: Windows_NT x64 10.0.22621
Sandboxed: No

Ubuntu distro through WSL

Here is my GitLens output:

[2023-03-29 21:24:59.968] Push Stash
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push --staged -m trade-show-progress --
error: unknown option `staged'
usage: git stash [push [-p|--patch] [-k|--[no-]keep-index] [-q|--quiet]
                 [-u|--include-untracked] [-a|--all] [-m|--message <message>]
                 [--] [<pathspec>...]]

    -k, --keep-index      keep index
    -p, --patch           stash in patch mode
    -q, --quiet           quiet mode
    -u, --include-untracked
                          include untracked files in stash
    -a, --all             include ignore files
    -m, --message <message>
                          stash message
    --pathspec-from-file <file>
                          read pathspec from file
    --pathspec-file-nul   with --pathspec-from-file, pathspec elements are separated with NUL character

@konahart
Copy link

This issue appears to be related to this change from the most recent release of GitLens: #2540

That change uses the --staged flag, which does not exist in git stash versions < 2.35.0 (1/24/2022)

@MarkJeronimus
Copy link

git 2.25.1 (latest in the canonical repos)

Is there a workaround?

@d13 d13 added bug Something isn't working and removed potential-bug triage Needs to be looked at labels Mar 31, 2023
@d13 d13 added this to the 13.5 milestone Mar 31, 2023
@ChrisCrossCrash
Copy link

@MarkJeronimus It worked for me after updating Git. Here's the documentation on how to do that. Here's what I did in Ubuntu:

First, add the official PPA:

sudo add-apt-repository ppa:git-core/ppa

Then update and upgrade:

sudo apt update
sudo apt upgrade

After that, you should have the latest version of Git installed and you won't have any issues using the GitLens stash feature.

@d13 d13 added pending-release Resolved but not yet released to the stable edition needs-verification Request for community verification labels Apr 6, 2023
@d13
Copy link
Member

d13 commented Apr 6, 2023

Resolved with 5f949a9

@d13 d13 closed this as completed Apr 6, 2023
@d13
Copy link
Member

d13 commented Apr 7, 2023

Can you please verify this fix in our pre-release edition of GitLens? Thank you so much!

You can switch to the pre-release edition of GitLens by clicking on the "Switch to Pre-Release Version" from the Extensions view.

switch-to-pre-release-extended

@lonelyteapot
Copy link

lonelyteapot commented Apr 7, 2023 via email

@d13 d13 added verified ✔ Verified and removed needs-verification Request for community verification pending-release Resolved but not yet released to the stable edition labels Apr 7, 2023
@github-actions
Copy link

This issue has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators May 12, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
bug Something isn't working verified ✔ Verified
Projects
None yet
Development

No branches or pull requests

9 participants