Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

🐛 Using --hyperlink, commit hashes are only clickable when at least of length 8 #1923

Closed
chrisgrieser opened this issue Dec 8, 2024 · 3 comments

Comments

@chrisgrieser
Copy link

# commit hashes are not clickable
git log -n5 --abbrev=7 

# they are clickable now
git log -n5 --abbrev=8

This is kinda unfortunate, since 7 seems to be the default output length by git, meaning you have to explicitly set the length to 8 to make it work.

@dandavison
Copy link
Owner

Hi @chrisgrieser,

7 seems to be the default output length by git

Do you have log.abbrev-commit set in your git config? I see that makes it defaults to 7, so maybe it would make sense for our lower bound to be 7.

@chrisgrieser
Copy link
Author

chrisgrieser commented Dec 9, 2024

Yes, I have.

However, 7 is not only caused by log.abbrevCommit, but also by using format="%h", so it is far more common

@th1000s
Copy link
Collaborator

th1000s commented Dec 9, 2024

Indeed, if the number of objects isn't to large the commit hashes can be abbreviated to 7 characters. Git will only use longer prefixes when needed. Fixed in #1924

@th1000s th1000s closed this as completed Dec 9, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants