-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Do not trim dots from usernames #6657
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
Conversation
Hmm. I think that we need to be a little bit more thoughtful about this than just its removal - this is a breaking change for consumers, and it's a state that we're currently testing for. In addition, it's not clear to me what we should do here, since git does trim trailing dots when generating new signatures for a commit:
So I would expect that if we want to pursue this that it should be an opt-in behavior. But I'm curious about the use case that you're seeing here? Is it that you want trailing dots in a name because - yes - it should be possible? If so, we should consider a mechanism for git and libgit2 to unify here, if there isn't prior art for git itself. Or are you trying to round-trip existing data? Those feel like two different use-cases. |
I want to keep dots inside user names (keeping them inside email is more like a side-effect: trimming from names only required a sligthly more complicated code). We do git commit objects conversion into our internal format and back. At the time re-creating git commit with dots inside names is not possible. |
This is the git commit that removed dot from the list of cruds. |
OK, thanks, that makes sense. I think that there's two problems here:
|
I do not think there is a need for such option. Getting fsck warning is not very helpful either: we can not rewrite the original commit to fix it as we do not control repositories we are converting from, and we are unable to rewrite them. |
That's only "not wrong" because git changed the definition of wrongness in August. Before that, it was wrong. But ignore dots for a moment. What about all the other things that we elide from a signature? Semicolons for example. Imagine a repository that was able to have a commit that has a signature with a trailing semicolon? How do you round trip that? You cannot today, hence you need a mechanism to do so.
I'm not suggesting it's useful for your use case. If I were trying to fsck a repository, though; it would be very helpful, indeed. |
I understand your point here. However, this is not the case for the current PR — it just synchronizes libgit2 and git behavior. |
Yes, I'm speaking in the abstract. I'm not expecting you to solve this problem in this PR. Apologies if I was unclear.
I think that's great. Many unit tests are asserting the current behavior though, and need to be updated to understand how dot trimming should work. |
@ethomson, I have fixed the tests. |
@ethomson, let's merge it. |
Thanks for the fix! |
Sammy Davis Jr. Jr.
is a valid name and the dot shoud not be trimmed.This makes libgit2 a bit more compatible with the git parsing.
See: https://github.com/git/git/blob/master/ident.c#L275