altsem / gitu

A TUI Git client inspired by Magit
MIT License
1.66k stars 87 forks source link

feat: 3 sections in show refs screen: branches, remotes, tags #134

Closed golden-expiriensu closed 2 months ago

golden-expiriensu commented 2 months ago

Resolves: https://github.com/altsem/gitu/issues/125

golden-expiriensu commented 2 months ago

@altsem PTAL, can I start writing some tests or you would like me to change something (not sure if current approach is the best one)

golden-expiriensu commented 2 months ago

This is how it looks when every section uses its dedicated style, what do you think?

Screenshot 2567-04-14 at 18 47 48
altsem commented 2 months ago

It is a first step at least :+1: One thing, I noticed that both the remote and the local branch are prefixed with a *. If I checkout a remote branch, a local branch would still have a *, even though the HEAD is detached.

golden-expiriensu commented 2 months ago

Okay, this should be much better now:

Remotes section is now segregated by the prefix before first slash (origin/main -> origin, text-text/main -> text-text) where header is capitalized prefix (origin -> Origin, text-text -> Text-text).

I am hesitant about current solution of detached head, as far as I see there is two options:

  1. Show some special symbol on every match by target (current solution with "? " prefix)
  2. Compare reference to last target in reflog of head I implemented the first one because its easier, but if you decide that 2nd is better I will do so, so let me know
codecov[bot] commented 2 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.35%. Comparing base (fad4740) to head (112cca9).

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #134 +/- ## ========================================== + Coverage 87.04% 87.35% +0.31% ========================================== Files 53 53 Lines 3750 3834 +84 ========================================== + Hits 3264 3349 +85 + Misses 486 485 -1 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

altsem commented 2 months ago

I had a Quick Look at the code now. Will do some testing after work maybe 👍

altsem commented 2 months ago

Merging this, gj! :rocket: