feat: add showGitInfo() for git tag and hash display #41

Merged
SujalRatnaTamrakar merged 1 commit from feature/git-tag-hash into main 2026-08-12 16:39:12 +00:00
SujalRatnaTamrakar commented 2026-08-05 04:55:58 +00:00 (Migrated from github.com)

Adds a general ->showGitInfo(Closure) method that receives a lazy GitInfo instance (branch(), tag(), hash()) and returns the string to render in the badge. This enables displaying the git tag and/or short commit hash, e.g. "2.2.0 - 12345678", in addition to the branch.

->showGitBranch() is now a convenience wrapper over the same GitInfo mechanism and keeps its existing behavior (no breaking change). Both can be combined via showGitInfo(). Git lookups remain opt-in and degrade to null when exec() is unavailable.

Long values are truncated in the badge (with the full value on hover) to keep it compact, per maintainer guidance.

Closes #27

Adds a general ->showGitInfo(Closure) method that receives a lazy GitInfo instance (branch(), tag(), hash()) and returns the string to render in the badge. This enables displaying the git tag and/or short commit hash, e.g. "2.2.0 - 12345678", in addition to the branch. ->showGitBranch() is now a convenience wrapper over the same GitInfo mechanism and keeps its existing behavior (no breaking change). Both can be combined via showGitInfo(). Git lookups remain opt-in and degrade to null when exec() is unavailable. Long values are truncated in the badge (with the full value on hover) to keep it compact, per maintainer guidance. Closes #27
pxlrbt commented 2026-08-12 16:39:18 +00:00 (Migrated from github.com)

Thanks!

Thanks!
SujalRatnaTamrakar commented 2026-08-12 17:40:54 +00:00 (Migrated from github.com)

Thank you so much @pxlrbt! As part of my CodePath AI capstone course, I was learning to leverage AI tools to navigate and contribute to real-world codebases. I'm really grateful for your openness in letting me take on this issue and review my PR. This has been great and happy to have contributed. :)

Thank you so much @pxlrbt! As part of my CodePath AI capstone course, I was learning to leverage AI tools to navigate and contribute to real-world codebases. I'm really grateful for your openness in letting me take on this issue and review my PR. This has been great and happy to have contributed. :)
Sign in to join this conversation.
No reviewers
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
pxlrbt/filament-environment-indicator!41
No description provided.