artrz / vscode-gitstash Goto Github PK
View Code? Open in Web Editor NEWAdds extra Git stash powers to VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=arturock.gitstash
License: MIT License
Adds extra Git stash powers to VS Code
Home Page: https://marketplace.visualstudio.com/items?itemName=arturock.gitstash
License: MIT License
I don't know when time ,this operate which is use the extension by click stash file. It doesn't clear my file which are selected
I had stash the selected files already, but after that there are always in my vscode file explorer,
not in the git stash.
But this action I writed was exist in the before, So I don't know the fail reason ,maybe it's vscode updates cause
I feel fairly silly but I don't know how to even start using the extension. There seems to be a list of stashes in the readme, stored under vscode-gitstash
. But my Stashes pane is empty and I don't know where to create one. Is there a right-click that I'm missing somewhere?
Note: I can stash
/ apply stash
files using the built-in menu but I even when I do this nothing shows up under Stashes.
When I use the "Stash selected files..." staged changes are included in the stash. The staged changes are, however, not removed from the current change set, so they are still staged as well as in the new stash.
First of all; great extension. Very useful and I use it a lot.
That said, when adding something to stash (either from vs code controls or using the button inside the extension itself), the stash list/explorer never updates. Not even when we open a 'stash-group'. We always have to push the refresh button inside the extension to refresh the list.
It would be nice if the module could update its list/explorer automatically when adding or removing stash. That would be less confusing and speedup the workflow.
Keep up the great work!
I noticed that the debug console prints out an error from Git Stash when it's looking at a non-repo path:
rejected promise not handled within 1 second: TypeError: Cannot read property 'length' of undefined
extensionHostProcess.js:730
stack trace: TypeError: Cannot read property 'length' of undefined
at Git.<anonymous> (C:\Users\<user>\.vscode\extensions\arturock.gitstash-1.0.2\out\src\Git.js:65:50)
at Generator.next (<anonymous>)
at fulfilled (C:\Users\<user>\.vscode\extensions\arturock.gitstash-1.0.2\out\src\Git.js:4:58)
at process._tickCallback (internal/process/next_tick.js:68:7)
I'm admittedly not super familiar with JS code, but I'm guessing it's due to there being no else
clause in the getGitRoot function
https://github.com/arturock/vscode-gitstash/blob/82e7160e81222766cfb983dd607dea95c1bf9c8d/src/Git.ts#L74-L84
I fixed this in my local copy by simply adding a
else {
this.gitRootPath = "";
}
between the end of the if and the return statement.
Alternatively, changing hasGitRepository as such:
hasGitRepository() {
return __awaiter(this, void 0, void 0, function* () {
if (this.getGitRoot().length != null)
return (yield this.getGitRoot()).length > 0;
else
return false
});
}
These are probably not the cleanest way to handle it, so I didn't open a pull request with the changes.
Add an option to stash changes and checkout to another branch and automatically pop the stash when switching to the previous branch.
This will make it really easy when we just need to switch to another branch for a quick peek while having a dirty workspace
Right now it seems that this tool only lists the stashes for the primary project are listed. Our project has a few submodules, and lately I've been making small changes that I typically have to stash as I pull new changes in that repo. If I stash, they don't show in the stash list.
I'm, working on a project with a monorepo. Stashes only show the repos in root folders. Can you also look for repos in sub folders?
I have this extension installed on my Ubuntu VM and it works fine. But when I installed it on my Windows 11 VS Code, I don't see the "STASHES" panel in the Explorer. What am I doing wrong?
Hi there!
I had to change my password and I don't see any options to change my credentials in Git Stash. How is this done?
Thanks!!
I was just looking for a way to organise commits and having worked with PyCharm's Changelist, I thought that this extension would be a good candidate to implement such a feature.
It is basically a title string, and commit string associated with a stash that can be used to populate the commit message field. Or even if the commit message field is not populated automatically, at least to have access to the saved string so it can be copy-pasted.
Thanks for reading!
My workspace contains two folders with two different repos. I can stash via the VSC menu options and verify the stash exists on the command line but vscode-gitstash doesn't show anything in the stash - for any repo. It normally does when using a Workspace with just one repo.
Stash explorer - Compare stash changes with current crashes in case of a markdown file.
The editor tab with the changes appears as expected but then the Extension Host keeps restarting until the editor tab is closed.
The built-in vscode.markdown-language-features seems to crash, if I disable the built-in extension there is no issue.
Some other observations:
Windows 10
Vscode version 1.90
Git Stash 5.2.0
git 2.45.2.windows.1
After last vscode upgrade (1.40.x) I noticed slow git
extension panel init (the list of dirty files takes a long time to load), and extremely slow (between 10-30s) opening of files in diff view (comparing old to new).
Disabling this extension fixed the perf issues.
I have ~100 stashes, but this didn't cause a problem in older versions of vscode. Running git gc
didn't improve it at all.
I've switched to Git lens
for git stash related work, so I mainly opened this issue for future reference if people hit similar problems.
Right now blue (tracked) files can be individually used.
But untracked files are shown in gray with a small gray "U" icon. Would be helpful to be able to recreate those files.
After the VS Code 1.33.1 update. The extension chrash with the following error:
Cannot read property 'name' of undefined.
You will not see the stash list anymore.
You get the error when open VS Code
You get the error when push the stash refresh button
Hi, I've installed this extension here. When Open file is clicked, the file cannot be opened, and a parabolic exception occurs.
vscode information:
Version: 1.80.2 (user setup)
Submitted by: 2ccd690cbff1569e4a83d7c43d45101f817401dc
Date: 2023-07-27T20:40:28.909Z
Electronics: 22.3. 14
ElectronBuildId: 22695494
Chromium: 108.0.5359.215
Node.js: 16.17.1
V8:10.8.168.25-electron.0
OS: Windows_NT x64 10.0.19045
extension information:
Version: v5.2.0
Hi,
i installed Git Stash but it doesn't seem to work in a devcontainer; i mean in output tab i don't see anything and STASHES tab doesn't appear in SCM; it works as expected in local workspace.
Thanks in advance.
Hi! Just a note that you can now add the "editPresentation": "multilineText"
key-value pair to any string setting that can take multiple lines (such as gitstash.explorer.labels.repositoryTooltipFormat
). In the settings editor, the setting will then display a textarea rather than a single-line inputbox. The feature is currently available in the Insiders edition of VS Code, and will be released to Stable in around two weeks.
Would you be able to publish this extension to the Open VSX Registry (https://open-vsx.org/) so it's available to VS Code Compatible Editors, such as VSCodium?
Goal: I want to stash my changes but also keep them in the working tree.
With the command line I can stage all changes and then execute git stash --keep-index
. But this extension doesn't allow me to create a stash at all (when all changes are staged) with the error message "There are no changes to stash."
It would be a nice addition to be able to hide repositories in the Stashes-view that has no stashes in them.
For me, when I stash some files it keeps them in the directory as "ghosts", with no ability to either modify, save or delete them. Windows complains that I do not have any permissions to the files. Even checking the ACL of the files is not possible.
Only after rebooting the computer do the files finally disappear.
My system:
V4.0.0
Something seems to have changed as popping via GUI seems to delete the stash, previously the stash was still there after popping.
It would be nice to have a badge indicating the number of stashes on each repo line in the explorer.
This is especially handy when working with multiple repos.
Currently you can delete the stash entries one at-a-time or all of them. It would be good if you could shift + select many stashes and delete them
System: windows 7 x64
vscode-gitstash: 1.0.1
vscode: 1.29.0 (system setup)
When clicking on the compare with current
on a stashed file, it throws:
Unable to open '#0: items.js - Modified (server/)': A system error occurred (UNKNOWN: unknown error, stat '\\c:\repos\test\server\items.js').
I have a handful of pretty old stashes that I forgot to add a custom name to. I'd love to be able to change their names without losing the original commits dates and diffs. A further idea would be to add support for dropping individual files from a stash. Not sure how difficult either of these are with git, but I imagine it's possible.
Love this extension by the way, use it every day. Thanks!
(Side note: I'm not opposed to helping work on this feature if I had your support. I have a couple of simple-ish extensions in the marketplace, so I'm familiar with the VSCode APIs.)
This is a feature request for adding custom stashing for specific changed files.
The way this works is by adding a context menu entry for only stashing selected changes.
A similar feature is available in the GitLens extension, which I want to move away from since it has a big footprint and is filled with features I don't use.
(Choosing "Stash Changes" in this screenshot would only stash the changes in settings.json
, and dashboard.controller.js
since they're selected.)
I'm currently short on time, but I would be happy to help with a PR if needed once I have some free time.
Thanks!
Since it's now possible to put explorers in panes other than the Explorer pane (or even add new panes) I'd like to see the Git Stash explorer on the Source Control pane, which seems to be a more logical place for it.
The "Stash selected files..." fails with did not match any file(s) known to git
error messages if the selected file(s) are not also staged. Adding the -u
parameter will allow git to stash unstaged selected files, too.
It also looks like the stash message is not quoted, which causes issues if the stash message is more than a single word. The parameter should be quoted (with any quotes within the message escaped with a backslash) to prevent this error.
Example of quoted string with internal quotes escaped:
"This is \"the\" way to do it"
Change the current command being executed from:
git stash push -m MESSAGEHERE -- PATHSHERE
to:
git stash push -m "QUOTEESCAPEDMESSAGEHERE" -u -- PATHSHERE
In the settings, the option: gitstash.explorer.labels.modifiedFileFormat
includes docs that indicates that it should support resolving "${index}"
as a format option. It does not. I suspect this is a documentation not feature issue
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.