git-log--graph icon indicating copy to clipboard operation
git-log--graph copied to clipboard

Long branch names text limit

Open dimateos opened this issue 5 months ago • 1 comments

Having https://github.com/phil294/GitLG/issues/127#event-18376377164 fix was great! Helps a lot with this issue too. So this situation now is much rarer, so less imporant, but wanted to comment on it.

In a commit row, there is no limit for how much space is used by branch names. This could lead to:

  • poor message visibility
  • diffcult access to commit context menu (unless you click on the graph instead of text, but less intuitive IMO)

When you hover the graph the branch names collapse, sometimes even to a few characters. I guess this was the solution for the cut commit message text!

TBH not sure about the exact logic, but seems weird:

  • To read the message I have to move the cursor to the opposite direction (or select it)
  • I might want to see branch names while hovering the graph and looking at merge points etc

Image

So what comes to mind would be:

  • Never cut currently checked out branch name!
  • Cut other branch names when combined length exceeds e.g. 50 chars (combined including checked out)
    • Give equal visible chars to each non checked-out branch
  • Show branch name on hover as a tooltip if it was cut?
  • Could invert the hovering graph, so show full branch names when hovering it

As always, could add settings to keep default behavior and offer this as an alternative etc

Best regards!

dimateos avatar Jul 07 '25 09:07 dimateos

Hi! I hear ya, and ideally not only the branches' name lengths should be taken into account, but also the commit message length. In your suggestion, the commit subject could still be cut off, still requiring some way to show the full width. It would be preferable to have that be triggered by hovering the subject though, and not the graph, as you correctly pointed out. Calculating width based on content or character count quickly results in spaghetti code, so if possible, I want to keep this a pure CSS solution. Right now I think it's solved with flex-grow weights.

Never cut currently checked out branch name!

unless it covers the entire subject message, in which case you'd need certain extra logic / wrapper(s)

phil294 avatar Jul 07 '25 10:07 phil294