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

Support forcing color output on/off #799

Merged
merged 2 commits into from
Jan 27, 2023

Conversation

partcyborg
Copy link
Contributor

Closes #798

Introduce flag --color to control the colorization of diff output.

Add flag to all commands that can output colorized diff text:

  • diff
  • apply
  • prune

--color has 3 allowed values:

  • auto (default): colorize if stdout is a terminal (current behavior)
  • always: always colorize output
  • never: never colorize output

Example: --color=always
tk-diff-color-always

Example: --color=never
tk-diff-color-never

Closes grafana#798

Introduce flag `--color` to control the colorization of diff output.

Add flag to all commands that can output colorized diff text:
- `diff`
- `apply`
- `prune`

`--color` has 3 allowed values:
- `auto` (default): colorize if stdout is a tty (current behavior)
- `always`: always colorize output
- `never`: never colorize output
@partcyborg
Copy link
Contributor Author

FYI: it looks like the "Deploy Github Pages" check failed for an unrelated reason:

Pushing changes… (attempt 1 of 3)
/usr/bin/git push --porcelain ***github.com/grafana/tanka.git github-pages-deploy-action/wpzbnqvuu:gh-pages
remote: Permission to grafana/tanka.git denied to github-actions[bot].
fatal: unable to access 'https://github.com/grafana/tanka.git/': The requested URL returned error: 403

@partcyborg
Copy link
Contributor Author

Any chance I can get a review?

@partcyborg
Copy link
Contributor Author

I pushed a build of tk from this branch to our Gitlab pipeline and it makes our diffs much easier to read.

gitlab-ci-tk-diff-color

Copy link
Member

@julienduchesne julienduchesne left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM!

@julienduchesne julienduchesne merged commit 4a53805 into grafana:main Jan 27, 2023
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 this pull request may close these issues.

feature request: support forcing color diff output on/off
3 participants