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

Feature request: odd length accepted #1

Open
thenger opened this issue Jun 7, 2023 · 1 comment
Open

Feature request: odd length accepted #1

thenger opened this issue Jun 7, 2023 · 1 comment
Labels
enhancement New feature or request question Further information is requested

Comments

@thenger
Copy link

thenger commented Jun 7, 2023

Why the restriction on length ?

# gitc0ffee --update-ref --prefix=eeeee
invalid prefix "eeeee": odd length hex encoded bytes: len(eeeee) = 5
@trichner
Copy link
Owner

trichner commented Jun 7, 2023

Good question! This is because one byte is encoded as two characters in hexadecimal. To support odd lengths one would need to be able to handle prefixes on half-bytes (nibbles).

To avoid the complexity this is not supported for now. Feel free to open a PR though, it would make sense because most git clients show 7 characters (3.5 bytes prefix).

@trichner trichner added enhancement New feature or request question Further information is requested labels Jun 10, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants