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

When author name contains Chinese characters, redundant spaces added. #53

Open
truebit opened this issue Jan 20, 2021 · 5 comments
Open

Comments

@truebit
Copy link

truebit commented Jan 20, 2021

git-fame-1.14.0, zsh and bash both found this problem.

When git repo author name contains both ascii and Chinese characters, redundant spaces added for Chinese characters.

You could use different Chinese character length to test: such like "张三丰", "李四", different character lengths could got different redutant spaces

@truebit truebit changed the title When author name contains non-ascii characters, redudant spaces added. When author name contains Chinese characters, redudant spaces added. Jan 20, 2021
@truebit truebit changed the title When author name contains Chinese characters, redudant spaces added. When author name contains Chinese characters, redundant spaces added. Jan 20, 2021
@casperdcl
Copy link
Owner

@truebit / @waldyrious what OS & python versions are you using? I can't reproduce this (Ubuntu 16.04/18.04/20.04, Python 2.7/3).

casperdcl added a commit that referenced this issue Sep 3, 2021
@waldyrious
Copy link
Contributor

I'm on Ubuntu 20.04, and my python version is 3.9.6.

@casperdcl
Copy link
Owner

super odd. And I assume you're using git-fame==1.15? Can you try the unilen branch instead?

pip install "git+https://github.com/casperdcl/git-fame.git@unilen#egg=git-fame"

@waldyrious
Copy link
Contributor

And I assume you're using git-fame==1.15?

Yes:

$ git fame --version
1.15.0

Can you try the unilen branch instead?

Sure, but it doesn't seem to help :(

Screenshot from 2021-09-04 15-10-21

Interestingly, on GitHub the misalignment goes the other way:

:
| Matt Singletary         |      85 |      1 |      2 | 0.0/ 0.0/ 0.0   |
| Crestwave               |      74 |      1 |      2 | 0.0/ 0.0/ 0.0   |
| 조성빈                  |      73 |      1 |      3 | 0.0/ 0.0/ 0.1   |
| Batuhan Taskaya         |      72 |      1 |      6 | 0.0/ 0.0/ 0.1   |
| Yorwba                  |      70 |      8 |      9 | 0.0/ 0.1/ 0.2   |
:

What happens on your side? In my terminal "조성빈" is printed with each character taking up the space of two regular-width characters, so it in my terminal, so they align with "Crestw" from the line above, and with "Batuha" from the line below.

If you do echo '|123456 123456|'; echo '|조성빈 조성빈|'; echo '|123456 123456|', does the output look aligned for you? It does for me:

Screenshot from 2021-09-04 15-08-02

Although here on GitHub that doesn't seem to be the case:

$ echo '|123456 123456|'; echo '|조성빈 조성빈|'; echo '|123456 123456|'
|123456 123456|
|조성빈 조성빈|
|123456 123456|

I tested swapping the font of my terminal to DejaVu Mono, FreeMono, Liberation Mono, Noto Mono, Ubuntu Mono and Unifont, and in all cases the effect was the same (the text is aligned).

@truebit
Copy link
Author

truebit commented Sep 6, 2021

on git-fame 1.15, the misalign problem fixed on my MBP.
BTW, i use iTerm with Powerlevel10k and on macOS Big Sur 11.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants