alexcorre / git-blame

Plugin for Atom Editor. Toggle git-blame annotations for the current file in the gutter.
MIT License
98 stars 58 forks source link

Add Option to Assign Color for Each Commit #220

Open sirrow opened 6 years ago

sirrow commented 6 years ago

On v.1.4.0, the new feature assigning colors for each author is great. Furthermore, I want to assign colors for each commit.

alexcorre commented 6 years ago

@sirrow thanks for the contribution. is there a way to migrate on first startup peoples preferences so that it translates over to the new enum properly?

sirrow commented 6 years ago

@alexcorre I don't make any patches for configuration migration. Also, I have not considered yet how to migrate. I am worrying which is better: keeping the code simple, or adding migration function. Which do you think better?

alexcorre commented 6 years ago

@sirrow sorry for the delay. i think its ok to skip the migration function. A happy medium would be to first read the new enum config value, if its not present fall back to the old config value.

How does that sound?

sirrow commented 6 years ago

@alexcorre I caught the ideas you recommended are

I feel this idea can be implemented a little simpler than migration. I will try to write some code for this idea soon.

sirrow commented 6 years ago

@alexcorre I tried to implement the idea but it was too hard to implement simply. Therefore, now , I think it's better to discard old config without any migration.

The reason for retiring implementing the idea is that atom cannot hide the old config from setting page if atom want to read old config.

I want to hide the old config from settings page because it's function is merged new enum config. In the other hand, setting for old config should be set in config.js for reading old config by atom config api. But old config became shown in settings page if setting for old config for reading config is written in config.js.

For reading the old config without showing in setting page, I have to develop another function for reading config for git-blame plugin outside of atom config API. This is too nasty.

In my opinion, for for implementing this config migration cleanly some new function like below is necessary.

  1. Hidden option in config.js is prepared by atom config API.
  2. Migration method like db migration(ex. rake db:migrate) is prepared by atom config API and do the migration when updating plugins.

If someone knows better simple way, please tell me. :cry: