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

Show commit authors in different colors

Open miguelcg opened this issue 7 years ago • 10 comments

As an enhancement, I think it could be nice to show every author in a different color so it's easier to recognise the different authors.

miguelcg avatar Aug 08 '17 06:08 miguelcg

thanks @miguelcg i like this feature. I'd be happy to accept a pull request where this is an configurable option instead of the default commit color differentiation

alexcorre avatar Aug 09 '17 18:08 alexcorre

I can work on this, feel free to assign it to me. Just a minor clarification, what do you mean by the default commit color differentiation? You mean the dark/light background of each row? Thanks

miguelcg avatar Aug 09 '17 18:08 miguelcg

yes. right now the default logic is to make adjacent commits alternate dark / light regardless of author. its very subtle.

image

relevant code here: https://github.com/alexcorre/git-blame/blob/master/lib/util/BlameGutter.js#L106-L117

alexcorre avatar Aug 09 '17 19:08 alexcorre

Thanks @alexcorre, I'll give it a go and see how it looks 😄

miguelcg avatar Aug 09 '17 19:08 miguelcg

Do you like how it looks? screen shot 2017-08-10 at 00 06 34

Since it's just a subtle way to distinguish different authors quickly and not colouring the whole cell, do you still want it as a configurable option or do you want to make it the default view?

miguelcg avatar Aug 09 '17 23:08 miguelcg

not in love with the colors, can we grab some colors from the theme? i think there is a way to use color vars that are set by the theme? don't have time to look it up this second but i think this will help it to match whatever style the person has set up on their particular instance of atom

lets make it an option, but can default it to true

alexcorre avatar Aug 10 '17 18:08 alexcorre

also...does it conflict with linter or git status indicators on the lines? Can you show a screenshot alongside that?

alexcorre avatar Aug 10 '17 18:08 alexcorre

The colours are generated "uniquely" for each author based on its name (same name would always generate the same colour). I don't know about the color vars, I would have to investigate about it. I have to check if it conflicts with linter or git status indicators on the lines, I can't right now though.

miguelcg avatar Aug 14 '17 20:08 miguelcg

This is how it looks with the default git status: screen shot 2017-08-14 at 21 29 01

I haven't tried with the linter but it shouldn't interfere since the indicators are next to the line numbers instead of next to the commit authors.

miguelcg avatar Aug 14 '17 20:08 miguelcg

great thanks for your help. go ahead and open a PR and i'll review the code

alexcorre avatar Aug 15 '17 06:08 alexcorre