drewdeponte / git-ps-rs

Official git-ps Rust implementation - the future of git-ps
https://git-ps.sh
MIT License
78 stars 8 forks source link

Reduce spacing in `gps ls` #259

Open Alizter opened 10 months ago

Alizter commented 10 months ago

The current output of gps ls has a lot of spacing between the commit messages and the branch names when they are much shorter than 50 chars. We should improve this situation by doing the following:

  1. Setup end-to-end tests for gps ls. A sketch can be found in #240.
  2. Tweak the output of gps ls so that the max of the commit messages is used to calculate the spacing.
  3. Do some more minor tweaks on how we display the branch names.

Currently the output looks like:

main tracking origin/main [ahead 4]
0    a9ed275 nix: add flake                                     ( lr  )
1    cf91753 chore: add macos and windows runners               ()
2    f543b6c exploration: replace gpgme with rpgp               ()
3    de36d0a add expect tests                                   ()

After the above suggestions it could look like:

main tracking origin/main [ahead 4]
0    a9ed275 nix: add flake                       (lr)
1    cf91753 chore: add macos and windows runners ()
2    f543b6c exploration: replace gpgme with rpgp ()
3    de36d0a add expect tests                     ()

A further tweak to replace () with [] gives:

main tracking origin/main [ahead 4]
0    a9ed275 nix: add flake                       [lr]
1    cf91753 chore: add macos and windows runners []
2    f543b6c exploration: replace gpgme with rpgp []
3    de36d0a add expect tests                     []

When a patch has multiple branches we currently print:

0    a5139ee nix: add flake                                     ( foo l ps/rr/nix__add_flake lr  )

this could be improved to:

0    a5139ee nix: add flake  [foo l, ps/rr/nix__add_flake lr]