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

Git stash push error #2784

Closed
ahmedrafayat opened this issue Jul 2, 2023 · 13 comments
Closed

Git stash push error #2784

ahmedrafayat opened this issue Jul 2, 2023 · 13 comments
Assignees
Labels
bug Something isn't working verified ✔ Verified
Milestone

Comments

@ahmedrafayat
Copy link

Type: Bug

I am getting this type of error everytime I create a stash. The stash is still created but this error shows.

[2023-07-02 16:00:24.887] Push Stash
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m flags api service --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)src/common/flags_api_service.py' did not match any file(s) known to git

Extension version: 14.0.1
VS Code version: Code 1.79.2 (695af097c7bd098fbf017ce3ac85e09bbc5dda06, 2023-06-14T08:58:33.551Z)
OS version: Darwin arm64 22.5.0
Modes:

System Info
Item Value
CPUs Apple M1 Pro (10 x 24)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) 2, 3, 10
Memory (System) 32.00GB (0.08GB free)
Process Argv --crash-reporter-id 9af71aec-dd7b-4f96-9a74-a6c68203e774
Screen Reader no
VM 0%
@anthonytp
Copy link

anthonytp commented Jul 3, 2023

I have experienced the same problem when stashing untracked files.

  1. In a git tracked project create a new file but do not add it to the repository.
  2. Use the "Stash all changes" button to create a new stash
  3. The stash is created but an error is reported:

Error: Command failed: /usr/local/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m stash test --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)app/untracked.php' did not match any file(s) known to git

Untracked files are not added to the stash but are deleted.

Extension version: v14.0.1
VS Code: 1.79.2
Mac OS: 13.3.1

@jkelroy jkelroy added bug Something isn't working needs-more-info Needs further information, steps, details, etc. labels Jul 3, 2023
@jkelroy
Copy link

jkelroy commented Jul 3, 2023

I am unable to reproduce this. What version of Git are you using?

@ahmedrafayat are you also seeing this issue when attempting to stash all changes when there is an untracked file or are you doing anything different?

Also, can either of you please enable debug logging by running from GitLens: Enable Debug Logging from the Command Palette (F1 or ctrl/cmd+shift+p). This will enable logging to the GitLens and GitLens (Git) channel in the Output pane. Once enabled, please reproduce the issue, and attach the log from the both GitLens and GitLens (Git) channels.

@github-actions
Copy link

This issue needs more information and has not had recent activity. Please provide the missing information or it will be closed in 7 days. Thanks!

@github-actions github-actions bot added the inactive Issue has not had recent required feedback label Jul 11, 2023
@eamodio
Copy link
Member

eamodio commented Jul 11, 2023

I can't reproduce this either -- please provide the request information here: #2784 (comment)

@github-actions github-actions bot added triage Needs to be looked at and removed inactive Issue has not had recent required feedback labels Jul 12, 2023
@jkelroy jkelroy removed the triage Needs to be looked at label Jul 13, 2023
@KristjanTammekivi
Copy link

KristjanTammekivi commented Jul 17, 2023

Latest git version, happens to me when stashing tracked files and untracked files at the same time. Stashing just untracked or just tracked works fine. Also doesn't happen when staging the files first.

Here's the debug logs

[2023-07-17 11:59:11.339] [  3ac] W(/home/kristjan/someproject).stashSave(e=ffs, t=[Uri(file:///home/kristjan/someproject/package.json), Uri(file:///home/kristjan/someproject/morph.ts)], i={"includeUntracked":false,"keepIndex":true,"onlyStaged":false})
[2023-07-17 11:59:11.339] [  3ad] GitProviderService.stashSave(e=/home/kristjan/someproject, t=ffs, i=2, r={"includeUntracked":false,"keepIndex":true,"onlyStaged":false})
[2023-07-17 11:59:11.339] [  3ae] LocalGitProvider.stashSave(e=/home/kristjan/someproject, t=ffs, i=2, r={"includeUntracked":false,"keepIndex":true,"onlyStaged":false})
[2023-07-17 11:59:11.388] [GIT  ] [/home/kristjan/someproject] git stash push -u -k -m ffs --pathspec-from-file=- --pathspec-file-nul [49ms]
[2023-07-17 11:59:11.389] [  3ae] LocalGitProvider.stashSave — failed [49ms]
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m ffs --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)morph.ts' did not match any file(s) known to git

[2023-07-17 11:59:11.389] [  3ad] GitProviderService.stashSave — failed [49ms]
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m ffs --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)morph.ts' did not match any file(s) known to git

[2023-07-17 11:59:11.389] [  3ac] W(/home/kristjan/someproject).stashSave — failed [49ms]
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m ffs --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)morph.ts' did not match any file(s) known to git

[2023-07-17 11:59:11.389] Push Stash
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m ffs --pathspec-from-file=- --pathspec-file-nul
error: pathspec ':(,prefix:0)morph.ts' did not match any file(s) known to git

[2023-07-17 11:59:11.389] ShowMessage(error, 'Unable to stash changes. See output channel for more details.', undefined, null)
[2023-07-17 11:59:11.389] [  3af] KeyboardScope.dispose[1]
[2023-07-17 11:59:11.390] [  3b0] Keyboard.createScope[0]()
[2023-07-17 11:59:11.390] [  3b0] Keyboard.createScope[0]() completed [0ms]
[2023-07-17 11:59:11.391] [  3b1] KeyboardScope.resume(paused=true)
[2023-07-17 11:59:11.398] [  3af] KeyboardScope.dispose[1] completed • index=0 [8ms]
[2023-07-17 11:59:11.399] [  3b1] KeyboardScope.resume(paused=true) completed [8ms]
[2023-07-17 11:59:11.515] [  3b2] W(/home/kristjan/someproject).onRepositoryChanged(e=Uri(file:///home/kristjan/someproject/.git/index), t=Uri(file:///home/kristjan/someproject/.git))
[2023-07-17 11:59:11.515] [  3b3] W(/home/kristjan/someproject).fireChange(0)
[2023-07-17 11:59:11.515] [  3b4] GitDocumentTracker.reset(e=repository, t=/home/kristjan/someproject)
[2023-07-17 11:59:11.516] [  3b4] GitDocumentTracker.reset(e=repository, t=/home/kristjan/someproject) completed [0ms]
[2023-07-17 11:59:11.516] [  3b3] W(/home/kristjan/someproject).fireChange(0) completed [0ms]
[2023-07-17 11:59:11.516] [  3b2] W(/home/kristjan/someproject).onRepositoryChanged(e=Uri(file:///home/kristjan/someproject/.git/index), t=Uri(file:///home/kristjan/someproject/.git)) completed [0ms]
[2023-07-17 11:59:11.516] [  3b5] W(/home/kristjan/someproject).onRepositoryChanged(e=Uri(file:///home/kristjan/someproject/.git/refs/stash), t=Uri(file:///home/kristjan/someproject/.git))
[2023-07-17 11:59:11.516] [  3b6] W(/home/kristjan/someproject).fireChange(4)
[2023-07-17 11:59:11.516] [  3b6] W(/home/kristjan/someproject).fireChange(4) completed [0ms]
[2023-07-17 11:59:11.516] [  3b5] W(/home/kristjan/someproject).onRepositoryChanged(e=Uri(file:///home/kristjan/someproject/.git/refs/stash), t=Uri(file:///home/kristjan/someproject/.git)) completed [0ms]

edit: in these logs morph.ts was untracked, package.json was tracked

@eamodio eamodio removed the needs-more-info Needs further information, steps, details, etc. label Jul 17, 2023
@eamodio eamodio added this to the 14.2 milestone Jul 17, 2023
@eamodio
Copy link
Member

eamodio commented Jul 17, 2023

Thanks for the logs -- it seems to only be reproducible if you pick the "Keep staged" option. We will look into that -- thanks!

@eamodio eamodio modified the milestones: 14.2, 14.3 Aug 8, 2023
@eamodio eamodio modified the milestones: 14.3, 14.4 Sep 8, 2023
@SampsonCrowley
Copy link

SampsonCrowley commented Sep 15, 2023

I am having this happen with every stash that contains new (i.e. untracked) files. it does not matter if the stash is staged or not

@SampsonCrowley
Copy link

[2023-09-15 15:42:16.793] Push Stash
Error: Command failed: /usr/bin/git -c core.quotepath=false -c color.ui=false stash push -u -k -m patient evaluations debouncing --pathspec-from-file=- --pathspec-file-nul
<stdin>:7: trailing whitespace.
  
<stdin>:12: trailing whitespace.
  
<stdin>:1227: space before tab in indent.
    	return val.split( /,\s*/ );
<stdin>:1228: space before tab in indent.
  	}
<stdin>:1274: space before tab in indent.
	   	minLength: 0,
warning: squelched 12 whitespace errors
warning: 17 lines add whitespace errors.
error: pathspec ':(,prefix:0)app/assets/javascripts/shared/patient_evaluations.js' did not match any file(s) known to git

@eamodio eamodio modified the milestones: 14.4, 14.5 Oct 18, 2023
@davenovelli
Copy link

I've just started getting this error when attempting to stash tracked and untracked files together. I don't think this has been a problem before.

OS: Darwin arm64 21.6.0
VS Code Version: 1.84.2, Commit: 1a5daa3a0231a0fbba4f14db7ec463cf99d7768e
GitLens version: v14.5.0
git version 2.37.1 (Apple Git-137.1)

@axosoft-ramint axosoft-ramint modified the milestones: 14.5, 14.6 Nov 14, 2023
@yiannisccmath
Copy link

I also started getting the warning lately. I do not get it when trying to stash files that are staged though.

Vs Code: 1.85.0, Commit: af28b32d7e553898b2a91af498b1fb666fdebe0c
OS: Linux x64 6.2.0-37-generic snap
GitLens: 14.5.2 - 2023-11-30
Git: 2.34.1

@eamodio eamodio self-assigned this Dec 12, 2023
@eamodio eamodio modified the milestones: 14.6, 14.7 Dec 12, 2023
@eamodio eamodio closed this as completed in 0d583c2 Jan 4, 2024
@eamodio eamodio added pending-release Resolved but not yet released to the stable edition needs-verification Request for verification labels Jan 4, 2024
@eamodio
Copy link
Member

eamodio commented Jan 4, 2024

I believe I've resolved the issue here, can you please verify this fix in tomorrow's (v2024.01.04xx) 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 of this extension" from the Extensions view.

image

@alexey-yarmosh
Copy link

Just checked the pre-release version, looks fixed, thank you!

@eamodio eamodio added verified ✔ Verified and removed needs-verification Request for verification labels Jan 4, 2024
@axosoft-ramint axosoft-ramint removed the pending-release Resolved but not yet released to the stable edition label Jan 17, 2024
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 Feb 17, 2024
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

11 participants