[GH Actions] Colorize git diff by character
See original GitHub issueIf you haven’t already, check out our contributing guidelines for onboarding!
Platform - version:
N/A
Action Performed (reproducible steps):
- We have an automation that runs on our PRs that recompiles all our Javascript Github Actions called
verifyGithubActionsBuilds
. This is useful in catching unexpected errors withncc
(the library we use to bundle our Node.js scripts with their dependencies), and in preventing developers from forgetting to recompile the scripts.
Expected Result:
- if a diff is found, the diff output should have character-level diff highlighting — but presently, it does not. This makes it difficult to spot differences between the committed script and the recompiled script.
Actual Result:
- the diff output does not have character-level diff highlighting. This makes it difficult to spot differences between the committed script and the recompiled script
- Looking at the diff output by
verifyGithubActionsBuilds
can be a useful debugging tool, but it is sometimes very difficult to spot the differences between the the outputted diffs, which wastes time and causes developer headaches. See this workflow run for an example of a not-so-useful diff. Solution - Upgrade the verifyActions script so that it outputs a colored, character-level diff. Something like this:
Issue Analytics
- State:
- Created 3 years ago
- Comments:10 (10 by maintainers)
Top Results From Across the Web
How can I visualize per-character differences in a unified diff ...
Simple (highlights individual character changes; does not highlight space changes): git diff --color-words=. More complex (does highlight space changes):
Read more >Git: Diff per word or character - makandra cards
By default git diff highlights whole lines as changes. ... To diff on a character-by-character basis you can say: git diff --color-words=.
Read more >Diff - scripts - fuchsia Git repositories
diff --git a/AUTHORS b/AUTHORS deleted file mode 100644 index 4c61558..0000000 --- a/AUTHORS ... action="store", default=None, - help="The file to colorize.
Read more >GitLens — Git supercharged - Visual Studio Marketplace
A hidden by default, customizable view to search and explore commit histories by message, author, files, id, etc, or visualize comparisons ...
Read more >Elevate your Terraform Workflow with GitHub Actions
The code herein fits the use case of your average GitOps workflow for Terraform: Develop code against a feature branch and locally run...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
I don’t know if it helps but at least on my side it appears as paid.
2021年8月9日(月) 18:20 Matt Allen @.***>:
Hi @roryabraham and @bfitzexpensify,
Thank you, I start working on the issue as soon as possible.