Repository navigation
Closed
Labels
bugConfirmed bugs or reports that are very likely to be bugsepic:stashingTracking label for work related to the stashing flowpriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions
Description
- checkout
masterat sha A - create
branch-aat sha A - commit to
mastera change toconfig/routes.rbso master is now at sha B - checkout
branch-a(which is at sha A) - make a conflicting change to
config/routes.rb - hit the "current branch" button and create a new branch (branch-b), based off master, bring changes with me
- after a moment branch-a will be checked out, the changes are gone
- but
git stash showwill show the changes - and the new branch (branch-b) will have been created, if you switch to it manually, the UI Shows the stashed changes
2019-06-18T11:22:55.114Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: github - latentflip (has token)
2019-06-18T11:22:56.120Z - error: [ui] `git -c credential.helper= -c protocol.version=2 checkout --progress live-update-new-notifications --` exited with an unexpected code: 1.
stderr:
error: Your local changes to the following files would be overwritten by checkout:
config/routes.rb
Please commit your changes or stash them before you switch branches.
Aborting
(The error was parsed as 37: Unable to switch branches as there are working directory changes which would be overwritten. Please commit or stash your changes.)
2019-06-18T11:23:00.092Z - info: [ui] Executing createStashEntry: git stash push --include-untracked -m !!GitHub_Desktop<live-update-new-notifications> (took 3.968s)
2019-06-18T11:23:01.252Z - warn: [ui] failed fetching updated PRs for repository github/github
Error: got max pull requests, aborting
at Object.continue (/webpack:/app/src/lib/api.ts:677:23)
at k.fetchAll (/webpack:/app/src/lib/api.ts:755:5)
2019-06-18T11:23:02.251Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 5.190s)
2019-06-18T11:23:34.681Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 3.567s)
2019-06-18T11:23:50.231Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 3.341s)
2019-06-18T11:24:28.502Z - info: [ui] Executing getCommits: git log HEAD --date=raw --max-count=100 --pretty=%H%x1F%h%x1F%s%x1F%b%x1F%an <%ae> %ad%x1F%cn <%ce> %cd%x1F%P%x1F%(trailers:unfold,only) -z --no-show-signature --no-color --not --remotes -- (took 1.928s)
2019-06-18T11:24:32.343Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 5.799s)
2019-06-18T11:24:51.958Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 5.367s)
2019-06-18T11:24:53.423Z - info: [ui] Executing getCommits: git log HEAD --date=raw --max-count=100 --pretty=%H%x1F%h%x1F%s%x1F%b%x1F%an <%ae> %ad%x1F%cn <%ce> %cd%x1F%P%x1F%(trailers:unfold,only) -z --no-show-signature --no-color --not --remotes -- (took 1.230s)
2019-06-18T11:25:03.645Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 5.927s)
2019-06-18T11:25:22.263Z - info: [ui] [AppStore.withAuthenticatingUser] account found for repository: github - latentflip (has token)
2019-06-18T11:25:25.580Z - info: [ui] Executing checkoutBranch: git -c credential.helper= -c protocol.version=2 checkout --progress new-notifications-banner -- (took 3.291s)
2019-06-18T11:25:27.190Z - info: [ui] Executing getStatus: git --no-optional-locks status --untracked-files=all --branch --porcelain=2 -z (took 1.609s)
2019-06-18T11:25:41.509Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 14.318s)
2019-06-18T11:25:49.379Z - info: [ui] Executing getStatus: git --no-optional-locks status --untracked-files=all --branch --porcelain=2 -z (took 1.428s)
2019-06-18T11:26:11.440Z - info: [ui] Executing getStatus: git --no-optional-locks status --untracked-files=all --branch --porcelain=2 -z (took 1.022s)
2019-06-18T11:26:19.724Z - info: [ui] Executing getBranches: git for-each-ref --format=%(refname)%00%(refname:short)%00%(upstream:short)%00%(objectname)%00%(objectname:short)%00%(author)%00%(committer)%00%(parent)%00%(symref)%00%(subject)%00%(body)%00%(trailers:unfold,only)%00%1F refs/heads refs/remotes (took 8.268s)
2019-06-18T11:26:37.620Z - info: [ui] Executing createCommit: git commit -F - (took 10.268s)
build 2.0.4, mac
Metadata
Metadata
Assignees
Labels
bugConfirmed bugs or reports that are very likely to be bugsepic:stashingTracking label for work related to the stashing flowpriority-2Bug that affects more than a few users in a meaningful way but doesn't prevent core functions

Activity
tierninho commentedon Jun 19, 2019
Confirming the above steps do reproduce the issue.
After step 6, this is what Desktop looked like. Note the changes are stashed and you are on the new branch.

2.0.4-beta1, mac
[-]Stashed error is suppressed upon new branch creation[/-][+]Stash error with conflicted file upon new branch creation[/+]tierninho commentedon Jul 24, 2019
Bumping this up as two more users experienced this. 😿 ⬆️
tierninho commentedon Aug 3, 2019
Summary of the issue from a user perspective:
As a user, when I have two branches and create conflicting changes, and then create a new branch and opt to bring some of the conflicting changes with me, I end up with a short error message and my changes appear to be lost. I would expect my changes to be visible and the error message to be more helpful and descriptive.
kuychaco commentedon Aug 8, 2019
@tierninho I tried to reproduce this based on the steps you outlined in the body of this issue and was unable to (on development a6a2bf7). The new branch
branch-bwas checked out successfully and changes brought over, with a resulting merge conflict. @outofambit also failed to reproduce on their machine with 2.1.1-beta3.We do, however, see the same error in the console
Unable to switch branches as there are working directory changes which would be overwritten.. Which seems puzzling because the UI shows that the branch switching was successful.And it seems like the error in #7827 (comment) might be a separate but related... specifically showing up when untracked files are involved.
Could you please see if you could still reproduce this on dev?
tierninho commentedon Aug 8, 2019
@kuychaco So I tested the steps again on
v2.1.0and could not reproduce the bug. After Step 6, I ended up in this state while testing:I too received the console error and the file I changed was marked as conflicted as expected.
I believe the error is related to Step 7 in the initial comment. The logic is trying to switch back to previous branch, but can't as the merge conflicted file "blocks" it. The console shows the error and the UI shows the conflicted file.
I will try similar scenarios to see if I can trip it up.
kuychaco commentedon Aug 9, 2019
Ah I see, so maybe there's a bug related to switching branches and carrying over conflicted changes...? I can definitely dig into that once you're able to find solid repro steps.
☝️ extracted this into a separate issue (#8084) since it's a bug specifically related to untracked files
tierninho commentedon Aug 9, 2019
So I can reproduce this with untracked files but we are siphoned this specific issue off into #8084
I am therefore going to close this bug for now in light of #8084 and as I believe they are the same underlying issue, ie: Attempting to stash files that conflict with existing files on the target branch will fail.
I do not think creating a new branch is directly related, it is just an extra step in the same process.
Happy to reopen if needed.