-
Notifications
You must be signed in to change notification settings - Fork 102
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
wrong error message when popping an empty stash #2227
Comments
Ever since I upgraded to version 10, I encounter this issue every time I execute ❯ git sync
[main] git fetch --prune --tags
[main] git add -A
[main] git stash
No local changes to save
[main] git rebase origin/main
Current branch main is up to date.
[main] git push --tags
Everything up-to-date
[main] git stash pop
No stash entries found.
Error: conflicts between your uncommmitted changes and the main branch
To abort, run "git-town abort".
To continue after having resolved conflicts, run "git-town continue".
To continue by skipping the current branch, run "git-town skip". I attempted to run |
The issue is also occurring with the the ❯ git hack new-branch
[main] git fetch --prune --tags
[main] git add -A
[main] git stash
No local changes to save
[main] git rebase origin/main
Current branch main is up to date.
[main] git branch new-branch main
[main] git checkout new-branch
Switched to branch 'new-branch'
[new-branch] git stash pop
No stash entries found.
Error: conflicts between your uncommmitted changes and the main branch
To abort, run "git-town abort".
To continue after having resolved conflicts, run "git-town continue". |
Thanks for the bug report, interesting edge case! It seems the problem you experience happens because Git Town wrongfully assumes your branch contains uncommitted changes. It therefore runs Let's find out why this happens. @IGassmann can you please post the output of this command:
Please make sure to scrub any confidential information like your GitHub tokens from the output. It would show up in the beginning when Git Town runs |
@kevgo the issue is actually happening with all commands whenever the stash is empty. Here is the verbose output: ❯ git sync --verbose
(verbose) git version
git version 2.42.1
(verbose) git config -lz --global
[redacted]
(verbose) git config -lz --local
[redacted]
(verbose) git stash list
(verbose) git branch -vva
* main bb97914f [origin/main] Commit message
(verbose) git remote
origin
[main] git fetch --prune --tags
(verbose) git branch -vva
* main bb97914f [origin/main] Commit message
(verbose) git rev-parse --verify --abbrev-ref @{-1}
igor/previous-branch
(verbose) git status --ignore-submodules
## main...origin/main
[main] git add -A
[main] git stash
No local changes to save
[main] git rebase origin/main
Current branch main is up to date.
(verbose) git rev-list --left-right main...origin/main
(verbose) git show-ref --quiet refs/heads/main
[main] git push --tags
Everything up-to-date
(verbose) git show-ref --quiet refs/heads/igor/previous-branch
(verbose) git rev-parse --verify --abbrev-ref @{-1}
igor/previous-branch
[main] git stash pop
No stash entries found.
(verbose) git config -lz --global
[redacted]
(verbose) git config -lz --local
[redacted]
(verbose) git branch -vva
* main bb97914f [origin/main] Commit message
(verbose) git stash list
(verbose) git status --ignore-submodules
## main...origin/main
Ran 25 shell commands.
Error: conflicts between your uncommmitted changes and the main branch
To abort, run "git-town abort".
To continue after having resolved conflicts, run "git-town continue".
To continue by skipping the current branch, run "git-town skip". |
I've recorded a video that shows the issue is happening across all commands. It seems that the problem is that commands always try to unstash changes even when they shouldn't. iTerm2.2023-11-07.at.09.56.24-converted.mp4My git version: |
Thanks for the details! The video has also been helpful. I notice that the output of
When you run the exact same command, it seems you get just something like this:
I suspect you enabled the Edit: you can determine this by running |
I have released v10.0.2 with a fix for the problem of getting a wrong error message when short output is enabled for Git. Please take it for a ride and let me know if the problem still exists. Thanks! |
That's right. I have both enabled.
That fixed it! Thanks :) |
steps to reproduce:
git town continue
git town continue
expected result
Git Town ignores the issue that it cannot pop the Git stash because there is no Git stash.
actual result
Git Town thinks its inability to pop the stash is a failure condition and prints this error:
The text was updated successfully, but these errors were encountered: