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

How to add git SHA in the end of git status info #487

Open
Mmkldb opened this issue Jan 29, 2024 · 1 comment
Open

How to add git SHA in the end of git status info #487

Mmkldb opened this issue Jan 29, 2024 · 1 comment
Labels
❓ question This issue is a question

Comments

@Mmkldb
Copy link

Mmkldb commented Jan 29, 2024

Hello,

How can I add the git SHA in the end of the git status information section?
image

Can you point me to the code or the documentation?

Thanks!

@Mmkldb Mmkldb added the ❓ question This issue is a question label Jan 29, 2024
@ramgp
Copy link

ramgp commented Feb 5, 2024

screenshot git prompt with hash

How it looks, should be easy to tweak it to your liking

This is how I did it:
screenshot of code changes

Please add these changes at the bottom of the original ~/.config/fish/functions/_tide_item_git.fish (consider backing it up, it will be overridden next time tide updates)


    set -l git_info (set_color white; echo -ns $location ' ('$hash')'
        set_color $tide_git_color_operation; echo -ns ' '$operation ' '$step/$total_steps
        set_color $tide_git_color_upstream; echo -ns ' ⇣'$behind ' ⇡'$ahead
        set_color $tide_git_color_stash; echo -ns ' *'$stash
        set_color $tide_git_color_conflicted; echo -ns ' ~'$conflicted
        set_color $tide_git_color_staged; echo -ns ' +'$staged
        set_color $tide_git_color_dirty; echo -ns ' !'$dirty
        set_color $tide_git_color_untracked; echo -ns ' ?'$untracked)

    _tide_print_item git $_tide_location_color$tide_git_icon' ' $git_info
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
❓ question This issue is a question
2 participants