simple-bitbucket-commit-checker icon indicating copy to clipboard operation
simple-bitbucket-commit-checker copied to clipboard

Matching author with special character always fails

Open 0ge opened this issue 6 years ago • 7 comments

One in our team has Swedish letters in his name. When he tries to push he gets the following errors from SBCC:

remote: - Bitbucket: 'Hugo Sjöberg' != Commit: 'Hugo Sjöberg'
remote: 
remote: - Commit: 'Hugo Sjöberg'

We have the following (related) configuration:

Require Matching Author Name: yes Require Userslug Matching Author Name: no Require Author Name in Bitbucket: yes Require Author Name As Userslug in Bitbucket: no Require Matching Committer Name: yes Require Userslug Matching Committer Name: no

I compared his gitconfig with mine and couldn't find anything amiss.

[user]
    name = Hugo Sjöberg
    email = [email protected]

0ge avatar Nov 19 '18 12:11 0ge

I made a test and is getting expected output.

I would suspect that ö is configured with some different encoding. Perhaps copy/pasted from somewhere.

Here is my test:

✔ ~/workspace/rep_1 [master {origin/master} ↓·1↑·1|✔] 
18:09 $ GIT_COMMITTER_NAME="cTomas Björre" GIT_COMMITTER_EMAIL="[email protected]" git commit --amend --author="aTomas Björre <[email protected]>"
[master 2d3ffe2] asd
 Author: aTomas Björre <[email protected]>
 Date: Mon Nov 19 17:48:01 2018 +0100
 1 file changed, 0 insertions(+), 0 deletions(-)
 create mode 100644 hej
✔ ~/workspace/rep_1 [master {origin/master} ↓·1↑·1|✔] 
18:09 $ git push -f
Password for 'http://admin@localhost:7990': 
Räknar upp objekt: 4, klart.
Räknar objekt: 100% (4/4), klart.
Deltakomprimering använder upp till 4 trådar
Komprimerar objekt: 100% (2/2), klart.
Skriver objekt: 100% (3/3), 284 bytes | 284.00 KiB/s, klart.
Totalt 3 (delta 1), återanvände 0 (delta 0)
remote: At least one change is not ok
remote: refs/heads/master 2dd10ae821 -> 2d3ffe2ec1
remote: 
remote: 
remote: 2d3ffe2ec135aa9a5e53a6b685df85884a02b063 aTomas Björre <[email protected]>
remote: >>> asd
remote: 
remote: - Bitbucket: 'Tomas Björre' != Commit: 'aTomas Björre'
remote: 
remote: - Bitbucket: 'Tomas Björre' != Commit: 'cTomas Björre'
remote: 
remote: - Commit: 'aTomas Björre'
remote: 
remote: 
remote: Simple Bitbucket Commit Checker
remote: 
To http://localhost:7990/bitbucket/scm/project_1/rep_1.git
 ! [remote rejected] master -> master (pre-receive hook declined)
error: misslyckades sända vissa referenser till "http://admin@localhost:7990/bitbucket/scm/project_1/rep_1.git"

tomasbjerre avatar Nov 19 '18 17:11 tomasbjerre

Not sure I understand your test - that would fail regardless? How can I check the encoding used?

0ge avatar Dec 03 '18 08:12 0ge

I should probably have included more in that comment... Don't remember exactly how I tested it now...

I'm not sure how to check the encoding of a name like that. Perhaps just re-enter it in the Bitbucket admin GUI.

tomasbjerre avatar Dec 03 '18 08:12 tomasbjerre

And I should have gotten back faster. 😉

I opened his gitconfig file with Sublime Text and UTF-8 encoding and there it looks OK. If I open it with ISO 8859-1 (Latin-1) the special characters are wonky. I re-entered his name in JIRA (synced with Bitbucket), but it didn't help.

0ge avatar Dec 03 '18 08:12 0ge

I ran SHOW SERVER_ENCODING in the SQL database that holds our JIRA application and its also using UTF-8.

0ge avatar Dec 03 '18 09:12 0ge

Perhaps this can be solved by adding logging. Logging each character ascii value.

tomasbjerre avatar Dec 03 '18 09:12 tomasbjerre

I could try this, but not sure where or how to add the logging?

0ge avatar Dec 03 '18 12:12 0ge