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

Incorrectly rendered git status details after version 3.12.1-beta #628

Closed
2 tasks done
edumserrano opened this issue Apr 11, 2021 · 10 comments · Fixed by #641
Closed
2 tasks done

Incorrectly rendered git status details after version 3.12.1-beta #628

edumserrano opened this issue Apr 11, 2021 · 10 comments · Fixed by #641
Labels
🤔 info needed Further information is requested

Comments

@edumserrano
Copy link

edumserrano commented Apr 11, 2021

Prerequisites

  • I have read and understand the CONTRIBUTING guide
  • I looked for duplicate issues before submitting this one

Description

When in a git directory some of the symbols are not showing correctly when displaying the git status details.

I've installed several versions of the oh-my-posh powershell module using Install-Module -Name oh-my-posh -RequiredVersion <specify version> -AllowPrerelease and found that from version 3.4.7-beta to version 3.12.1-beta this problem does not exist. However after version 3.12.1-beta I couldn't find another version where the problem was fixed.

Environment

  • Oh my Posh version: 3.134.0
  • Theme: happens in all themes that display detailed git information
  • Operating System: Windows 10 Version 2004 (OS Build 19041.867)
  • Shell: powershell 7.1.3
  • Terminal: Windows Terminal 1.6.10571.0
  • Font: FiraCode NF

Steps to Reproduce

  1. Install oh-my-posh via powershell using the command Install-Module -Name oh-my-posh -AllowPrerelease
  2. Import oh-my-posh via Import-Module oh-my-posh
  3. Set a theme, such as the agnoster, via Set-PoshPrompt -Theme agnoster

Expected behavior: [What you expected to happen]

It should show this:
image

Notice that the git status details shows correctly with +2 ~2 -0

The above image was taken using version 3.12.1-beta of oh-my-posh.

Actual behavior: [What actually happened]

I'm getting this:
image

Notice the ~2 ?2 at the end of the git status details

The above image was taken using version 3.134.0 of oh-my-posh.

@edumserrano
Copy link
Author

Tried the poshgit segment and it displays the info correctly using version 3.134.0 of oh-my-posh. Maybe it's an issue with the git segment?

Example of poshgit which displays git status details correctly and git segment which displays it incorrectly:

image

@edumserrano edumserrano changed the title Incorrectly rendered git status summary after version 3.12.1-beta Incorrectly rendered git status details after version 3.12.1-beta Apr 11, 2021
@JanDeDobbeleer
Copy link
Owner

@edumserrano can you give me the output of git --no-optional-locks -c core.quotepath=false -c color.status=false status -unormal --short --branch?

@JanDeDobbeleer JanDeDobbeleer added the 🐛 bug Something isn't working label Apr 11, 2021
@edumserrano
Copy link
Author

edumserrano commented Apr 11, 2021

image

@JanDeDobbeleer
Copy link
Owner

@edumserrano would you mind copy-pasting that as text?

@JanDeDobbeleer
Copy link
Owner

JanDeDobbeleer commented Apr 11, 2021

@edumserrano I'm sorry but we provide the correct state.?? implies the file is untracked, not "added". That's reserved for A.

When I do the following, it's first marked as untracked and after adding to the index it changes to added. This is, according to my understanding 100% correct. @dahlbyk any context on why posh-git does this differently?

image

@JanDeDobbeleer JanDeDobbeleer added 🤔 info needed Further information is requested and removed 🐛 bug Something isn't working labels Apr 11, 2021
@dahlbyk
Copy link

dahlbyk commented Apr 11, 2021

posh-git splits status between staged/unstaged, so red +2 means there are two untracked files to be added and green +2 (from A) means two new files have been staged.

@edumserrano
Copy link
Author

edumserrano commented Apr 12, 2021

Of course I don't mind that this is considered working as expected but I thought it might be something to consider as an improvement since posh-git displays the information in a more sensible way and because up until version 3.12.1-beta so did the git segment (arguably).

@JanDeDobbeleer
Copy link
Owner

@edumserrano given that we have the same rendering as posh-git, I suggest we align the behaviour.

JanDeDobbeleer added a commit that referenced this issue Apr 12, 2021
JanDeDobbeleer added a commit that referenced this issue Apr 12, 2021
@edumserrano
Copy link
Author

That was quick! Thanks for picking this up @JanDeDobbeleer. I can confirm the new release shows correctly:
image

Copy link

This issue has been automatically locked since there has not been any recent activity (i.e. last half year) after it was closed. It helps our maintainers focus on the active issues.
If you have found a problem that seems similar, please open a discussion first, complete the body with all the details necessary to reproduce, and mention this issue as reference.

@github-actions github-actions bot locked as resolved and limited conversation to collaborators Apr 22, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
🤔 info needed Further information is requested
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants