You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
TLDR; git repos that use the new SHA256-based object hashing do not show any data in the terminal prompt including branch, dirty status, etc... this can be replicated by creating a new git repo using git init --object-format=sha256
Background
This is more of a note-to-file as SHA256-based hashing is currently not the default for the git init command and the transition will probable take 7-10 years. The goal of the transition by the git team is to avoid SHA1 collisions and attacks. This will likely only become a "noticeable bug" in about 3 years and "breaking bug" in about 7 years.
While Git repos that use SHA256-based object hashing are no longer considered experimental, there is no backward interop between older SHA1 repos and newer SHA256 repos. git v2.45 is the first version to attempt forward interop between the two formats (see Github update on git v2.45.)
Issue
While zsh + p10k can read git data (i.e. branch/commit/etc..) for a legacy SHA1 based repo and display it in the prompt, when the prompt is in a git repo using SHA256-based object hashing p10k does not display any git info in the prompt.
Steps to replicate:
Use zsh with p10k (obvi)
Make sure you are using git > v2.42
Enable the git plugin in zsh
Create a new folder for testing
cd into the new folder
Run git init
Ensure that your prompt now displays the main or master branch (this is expected behaviour)
Now delete the git folder with: rm -Rf .git
Reinitialize with SHA256 using: git init --object-format=sha256
The prompt will not have the main or master branch in the prompt like previously (<-- this is the bug)
As a sanity check, in the same folder, run vcs_info then;
Run echo "${vcs_info_msg_0_}"; this should output the git portion of the terminal prompt you expect to see, but don't (i.e. the branch name)
Environment:
OS: macOS Sonoma 14.4.1 arm64
zsh verison: zsh 5.9 (x86_64-apple-darwin23.0)
powerlevel10k: bde5ca4
git version: 2.45.2
Note: I've tried to trace the bug, however changes I make to my local powerlevel10k does not reflect in the prompt. I suspect the issue is somewhere in gitstatus, but without a way to push debug statements through to the terminal, I can't trace the issue.
The text was updated successfully, but these errors were encountered:
TLDR; git repos that use the new SHA256-based object hashing do not show any data in the terminal prompt including branch, dirty status, etc... this can be replicated by creating a new git repo using
git init --object-format=sha256
Background
This is more of a note-to-file as SHA256-based hashing is currently not the default for the
git init
command and the transition will probable take 7-10 years. The goal of the transition by thegit
team is to avoid SHA1 collisions and attacks. This will likely only become a "noticeable bug" in about 3 years and "breaking bug" in about 7 years.While Git repos that use SHA256-based object hashing are no longer considered experimental, there is no backward interop between older SHA1 repos and newer SHA256 repos.
git v2.45
is the first version to attempt forward interop between the two formats (see Github update ongit v2.45
.)Issue
While
zsh
+p10k
can read git data (i.e. branch/commit/etc..) for a legacy SHA1 based repo and display it in the prompt, when the prompt is in a git repo using SHA256-based object hashingp10k
does not display any git info in the prompt.Steps to replicate:
zsh
with p10k (obvi)git > v2.42
git
plugin in zshcd
into the new foldergit init
main
ormaster
branch (this is expected behaviour)rm -Rf .git
git init --object-format=sha256
main
ormaster
branch in the prompt like previously (<-- this is the bug)vcs_info
then;echo "${vcs_info_msg_0_}"
; this should output the git portion of the terminal prompt you expect to see, but don't (i.e. the branch name)Environment:
macOS Sonoma 14.4.1 arm64
zsh 5.9 (x86_64-apple-darwin23.0)
bde5ca4
2.45.2
Note: I've tried to trace the bug, however changes I make to my local powerlevel10k does not reflect in the prompt. I suspect the issue is somewhere in gitstatus, but without a way to push debug statements through to the terminal, I can't trace the issue.
The text was updated successfully, but these errors were encountered: