tide icon indicating copy to clipboard operation
tide copied to clipboard

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

Open Mmkldb opened this issue 1 year ago • 1 comments

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 avatar Jan 29 '24 12:01 Mmkldb

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

ramgp avatar Feb 05 '24 16:02 ramgp