git-fame icon indicating copy to clipboard operation
git-fame copied to clipboard

When author name contains Chinese characters, redundant spaces added.

Open truebit opened this issue 4 years ago • 5 comments

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 avatar Jan 20 '21 11:01 truebit

@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 avatar Sep 03 '21 23:09 casperdcl

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

waldyrious avatar Sep 03 '21 23:09 waldyrious

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"

casperdcl avatar Sep 04 '21 00:09 casperdcl

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).

waldyrious avatar Sep 04 '21 14:09 waldyrious

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

truebit avatar Sep 06 '21 06:09 truebit