-
Notifications
You must be signed in to change notification settings - Fork 132
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
Replace /
's for cache version dir name
#258
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just one small suggestion, but otherwise looks great! 👏
@f-f OK updated now. As per @hdgarrood's suggestion also escaping a few other characters that could be in branch names as well. |
I think we should include % in the list of characters to be escaped as currently I think “%2F” and “/“ will both map to “%2F“. Also I’ve just remembered that case insensitive file systems are a thing... |
@hdgarrood agreed, this is currently still not injective but if we add And yes, e.g. my mac is case insensitive, so two branches with different cases would still clash. I think though we can just add a Btw @codedmart if you want to have some fun you could setup Quickcheck with a property that requires that |
Yup forgot |
I suppose one option is to say that any uppercase character needs escaping too; in my experience branch names rarely contain uppercase characters (so this scheme will probably give you nice readable branch names more often than not). |
Also if you want to write a QuickCheck property for this, I think you'd need to be a bit careful if you want to end up with one that's actually useful; if you just write
then the chance of a collision is so astronomically tiny that that test is only really slowing down your test suite. I'd recommend writing your own generator which uses a much smaller set of characters to sample from, in particular including the ones we know to be problematic. Then, instead of running lots of individual tests, we should just run a single test where we generate a large set of potential branch names, apply the |
@codedmart this got a bit out of sync after all the ZuriHac's contributions, so I'll merge it now so we can ship it in the upcoming release later today. Thank you! 🙂 |
Description of the change
TODO
Checklist:
README
P.S.: the above checks are not compulsory to get a change merged, so you may skip them. However, taking care of them will result in less work for the maintainers and will be much appreciated 😊