sxyazi / yazi

💥 Blazing fast terminal file manager written in Rust, based on async I/O.
https://yazi-rs.github.io
MIT License
16.72k stars 389 forks source link

Show Commit Hash When Using ya pack -l #1881

Closed yudai0804 closed 2 weeks ago

yudai0804 commented 2 weeks ago

yazi --debug output

Yazi
    Version: 0.3.3 (7c445ce 2024-09-04)
    Debug  : false
    OS     : linux-x86_64 (unix)

Ya
    Version: 0.3.3 (7c445ce 2024-09-04)

Emulator
    Emulator.via_env: ("xterm-256color", "WezTerm")
    Emulator.via_csi: Ok(WezTerm)
    Emulator.detect : WezTerm

Adapter
    Adapter.matches: Iterm2

Desktop
    XDG_SESSION_TYPE           : Some("wayland")
    WAYLAND_DISPLAY            : Some("wayland-0")
    DISPLAY                    : Some(":1")
    SWAYSOCK                   : None
    HYPRLAND_INSTANCE_SIGNATURE: None
    WAYFIRE_SOCKET             : None

SSH
    shared.in_ssh_connection: false

WSL
    WSL: false

Variables
    SHELL              : Some("/usr/bin/bash")
    EDITOR             : Some("vim")
    VISUAL             : None
    YAZI_FILE_ONE      : None
    YAZI_CONFIG_HOME   : None

Text Opener
    default: Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })
    block  : Some(Opener { run: "${EDITOR:-vi} \"$@\"", block: true, orphan: false, desc: "$EDITOR", for_: None, spread: true })

Multiplexers
    TMUX               : false
    tmux version       : No such file or directory (os error 2)
    ZELLIJ_SESSION_NAME: None
    Zellij version     : No such file or directory (os error 2)

Dependencies
    file             : 5.44
    ueberzugpp       : No such file or directory (os error 2)
    ffmpegthumbnailer: No such file or directory (os error 2)
    magick           : No such file or directory (os error 2)
    fzf              : 0.54.1
    fd               : No such file or directory (os error 2)
    rg               : 13.0.0
    chafa            : 1.12.4
    zoxide           : 0.9.6
    7z               : 16.02
    7zz              : No such file or directory (os error 2)
    jq               : 1.6

--------------------------------------------------
When reporting a bug, please also upload the `yazi.log` log file - only upload the most recent content by time.
You can find it in the "/home/user/.local/state/yazi" directory.

Please describe the problem you're trying to solve

When the ya pack -l command is executed, it shows the username and repository name. I think that showing only the username and repository name is not very helpful. So, I would like to show the commit hash as well. Showing the commit hash is easy because it is written in package.toml. It seems that it can be accomplished just by modifying yazi-cli/src/package/parser.rs.

https://github.com/sxyazi/yazi/blob/0baccdc9aaa26bbea458f0b7fcbe7916c8b2c1df/yazi-cli/src/package/parser.rs#L69-L89

Would you be willing to contribute this feature?

Describe the solution you'd like

current format

user/repo

I want to show the following format

user/repo (hash)

I would like to contribute, but I am a Rust beginner. So it may take time.

I appreciate your help.

Additional context

No response

Validations

yudai0804 commented 2 weeks ago

In the future, I would like to display the commit message. And I am also interested in implementing that feature.

sxyazi commented 2 weeks ago

Nice to have!

To achieve this we need to add a new rev field getting process alongside the existing use, and print it out here:

https://github.com/sxyazi/yazi/blob/e42c621070759c602d2a3630cc51f834dbd95ee7/yazi-cli/src/package/parser.rs#L84-L86

@yudai0804 Would you like to give it a go?

yudai0804 commented 2 weeks ago

Thank you! I'll try it.