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

🚀 "git blame ... | delta" will colorize based on commit date, even if only "--blame-format '{author} |'" is specified #868

Closed
zachriggle opened this issue Dec 21, 2021 · 1 comment · Fixed by #871

Comments

@zachriggle
Copy link

Much Love ❤️

Thank you so much @dandavison for making a tool that I continue to use on a daily basis!

Up front: The "blame" highlighting functionality works great as-is, this is just an enhancement request.

I've started using the Blame functionality #761, and often the age of the code (or its specific commit) is not as relevant as simply who WROTE the code -- i.e., who can help me understand it better and answer any questions I have.

For example, if we take some code from the Linux kernel and do...

$ git blame drivers/misc/lkdtm/core.c | delta --blame-format '{author}'

There are a lot of commits for various bits of this code, but for the most part it's a single author. It would be nice, if {timestamp} and {commit} are not listed in the format options, that we just do a comparison against the author name. This has the added benefit of reducing the reuse / recycling of colors used to do the highlighting.

Let me know what you think!

@dandavison
Copy link
Owner

dandavison commented Dec 24, 2021

Let me check that I understand the suggestion correctly:

We can describe delta's blame procedure as follows:

  • For each line of blame output we compute a "key"
  • Successive lines are colored differently if their keys differ
  • Currently, the key for a line is the blame commit for that line

The suggestion here is to change the key to be <whatever the blame format will display for that line>

Right?

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

Successfully merging a pull request may close this issue.

2 participants