-
-
Notifications
You must be signed in to change notification settings - Fork 2
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
Smaller commit hash like github? #55
Comments
Hi, @nooblyf After a deep dive through this PR changesets/changesets#1236, I found that this package just needs to:
Additional noteI tested locally and it works as expected. I will add this changes to one of my projects and link it here in a few hours. |
nvm, i was able to achieve it with a local script |
you should at least use a longer slice than 8, a collision can occur more likely with each char you cut |
Do you mean a collision in generated link? |
until @svitejs/changesets-changelog-github-compact decides to update its dependencies svitejs/changesets-changelog-github-compact#55 (comment)
yes |
Well, that case is covered by I made this implementation and used it for this CHANGELOG.md at v0.2.3. Is this enough for publish a new version with these updates? Thanks for reading n_n7 |
collision probability is very low even with 7 chars isn't it? there are 36 possible chars (0-9a-z) in commit hash so 36^7 = ~78.4 Billion combinations. it would take ~40K IDs, in order to have a 1% probability of at least one collision or am i missing something? |
we had collisions with short hashes in vite-ecosystem-ci, better to use the short hash only in the label and full hash in the url. PR welcome. this repo is pretty low prio for me, ideally it's features found it's way back to changesets itself, feel free to raise your voice in their repo |
Yes. The short hash will only be used for label. Generated URL will remain intact. |
released in 1.2.0, thanks! |
You're welcome. n_n7 |
Describe the problem
Instead of using the full commit hash is there a setting to use just the first seven characters just for the text part? 🙂
Describe the proposed solution
Like how GitHub does it, they are using the first 7 characters from commit hash
For example, here's how it looks after using first 7 characters only
Alternatives considered
Manually updating it when PR is created
Importance
nice to have
The text was updated successfully, but these errors were encountered: