Git - handle autostash conflicts when pulling and show autostash entries in the stash list - #325762
Open
tieo wants to merge 1 commit into
Open
Git - handle autostash conflicts when pulling and show autostash entries in the stash list#325762tieo wants to merge 1 commit into
tieo wants to merge 1 commit into
Conversation
Contributor
📬 CODENOTIFYThe following users are being notified based on files changed in this PR: @lszomoruMatched files:
|
Contributor
There was a problem hiding this comment.
Pull request overview
Handles failed Git pull autostash restoration and makes branchless autostashes visible.
Changes:
- Detects autostash conflicts reported through successful pull stderr.
- Parses branchless autostash entries.
- Adds stash parsing tests.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
extensions/git/src/git.ts |
Handles autostash conflicts and branchless stashes. |
extensions/git/src/test/git.test.ts |
Tests stash parsing variants. |
…ies in the stash list
tieo
force-pushed
the
git-autostash-conflict
branch
from
July 14, 2026 11:13
59b78c3 to
0d360d7
Compare
Author
|
Hello? Is somebody there? 🫠 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes #262360
With
git.autoStashenabled, a pull whose autostash fails to re-apply gives no indication of it: no notification, and the autostash entry git leaves behind is not listed under the stash actions.Two causes, both in
git.ts:git pull --autostashexits with 0 when re-applying the autostash fails and only reports it on stderr, sopull()never setsGitErrorCodes.StashConflictand the existing handler never runs. The manual stash apply notifies becausegit stash popexits non-zero.(WIP )on <branch>: <message>, which git writes even for a user provided message. Theautostashentry carries no branch, so it never matchesstashRegexand is dropped byparseGitStashes.To test:
"git.autoStash": true.Git: Pull.Adds
parseGitStashestests for aWIP on <branch>stash, a stash the user namedautostash, and the branchlessautostashentry.Written with the assistance of an LLM and verified manually against a real repository.